-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathAudioTest.cs
38 lines (29 loc) · 1.02 KB
/
AudioTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using NUnit.Framework;
using TwoCaptcha.Captcha;
namespace TwoCaptcha.Tests
{
[TestFixture]
public class AudioTest : AbstractWrapperTestCase
{
[Test]
public async Task TestAllParameters()
{
byte[] bytes = File.ReadAllBytes("../../../resources/audio-en.mp3");
string base64EncodedImage = Convert.ToBase64String(bytes);
AudioCaptcha captcha = new AudioCaptcha();
captcha.SetBase64(base64EncodedImage);
captcha.SetLang("en");
var parameters = new Dictionary<string, string>();
parameters["method"] = "audio";
parameters["lang"] = "en";
parameters["body"] = base64EncodedImage;
parameters["soft_id"] = "4582";
parameters["json"] = "0";
await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
}
}
}