Skip to content

Commit cdb93de

Browse files
committed
Skip tests due to sandbox outage
The tests for `TestAvailableLanguages`, `TestSearchSubtitle`, `TestDownloadSubtitle`, and `TestUploadSubtitle` are now skipped because the sandbox environment is down. Added comments to use a mock API and improve the test setup with NSubstitute.
1 parent 8eb98d1 commit cdb93de

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

SubDBSharp.UnitTest/SubDBClient.Test.cs

+9-6
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,37 @@ public class UnitTest
1010
{
1111
private static readonly IResponseParser ReponseParser = new CsvResponseParser();
1212

13-
[Fact]
13+
[Fact(Skip = "Sandbox is down")]
1414
public async Task TestAvailableLanguages()
1515
{
16+
// NOTE: SINCE THE SANDBOX IS ALSO DOWN, USE MOCK API
17+
// TODO:
18+
// * Use NSubstitue to mock the http clien
1619
var subDbClient = new SubDBClient(GetProductInfo(), ApiUrls.SubDBApiSandBoxUrl);
1720
var response = await subDbClient.GetAvailableLanguagesAsync();
1821
Assert.NotNull(response.Body);
1922

20-
var buffer = (byte[]) response.Body;
23+
var buffer = (byte[])response.Body;
2124
var body = Encoding.UTF8.GetString(buffer, 0, buffer.Length);
2225
var availableLanguages = ReponseParser.ParseGetAvailablesLanguages(body);
2326

2427
Assert.True(availableLanguages.Count > 0);
2528
}
2629

27-
[Fact]
30+
[Fact(Skip = "Sandbox is down")]
2831
public async Task TestSearchSubtitle()
2932
{
3033
var subDbClient = new SubDBClient(GetProductInfo(), ApiUrls.SubDBApiSandBoxUrl);
3134
var response = await subDbClient.SearchSubtitleAsync("ffd8d4aa68033dc03d1c8ef373b9028c", false);
3235
Assert.NotNull(response.Body);
33-
var buffer = (byte[]) response.Body;
36+
var buffer = (byte[])response.Body;
3437
Assert.True(buffer.Length > 0);
3538
var body = Encoding.UTF8.GetString(buffer, 0, buffer.Length);
3639
var availableLanguages = ReponseParser.ParseGetAvailablesLanguages(body);
3740
Assert.True(availableLanguages.Count > 0);
3841
}
3942

40-
[Fact]
43+
[Fact(Skip = "Sandbox is down")]
4144
public async Task TestDownloadSubtitle()
4245
{
4346
var subDbClient = new SubDBClient(GetProductInfo(), ApiUrls.SubDBApiSandBoxUrl);
@@ -46,7 +49,7 @@ public async Task TestDownloadSubtitle()
4649
Assert.True(response.StatusCode == System.Net.HttpStatusCode.OK);
4750
}
4851

49-
[Fact]
52+
[Fact(Skip = "Sandbox is down")]
5053
public async Task TestUploadSubtitle()
5154
{
5255
var movie = "./Assets/dexter.mp4";

0 commit comments

Comments
 (0)