NonThrowTryCatch
This commit is contained in:
parent
644cde644d
commit
23f6e83c8d
@ -29,12 +29,20 @@ public class UnitTestAppSettingsController
|
|||||||
_ControllerName = nameof(Server.ApiControllers.AppSettingsController)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.AppSettingsController)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void NonThrowTryCatch()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{ throw new Exception(); }
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IAppSettingsController<object>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IAppSettingsController<object>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -45,6 +53,7 @@ public class UnitTestAppSettingsController
|
|||||||
IAppSettingsRepository<Server.Models.Binder.AppSettings> appSettingsRepository = serviceProvider.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>();
|
IAppSettingsRepository<Server.Models.Binder.AppSettings> appSettingsRepository = serviceProvider.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>();
|
||||||
appSettingsRepository.VerifyConnectionStrings();
|
appSettingsRepository.VerifyConnectionStrings();
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -55,6 +64,7 @@ public class UnitTestAppSettingsController
|
|||||||
AppSettings appSettings = serviceProvider.GetRequiredService<AppSettings>();
|
AppSettings appSettings = serviceProvider.GetRequiredService<AppSettings>();
|
||||||
Assert.IsNotNull(appSettings);
|
Assert.IsNotNull(appSettings);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -66,6 +76,7 @@ public class UnitTestAppSettingsController
|
|||||||
Server.Models.Binder.AppSettings appSettings = appSettingsRepository.GetAppSettings();
|
Server.Models.Binder.AppSettings appSettings = appSettingsRepository.GetAppSettings();
|
||||||
Assert.IsTrue(appSettings is not null);
|
Assert.IsTrue(appSettings is not null);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -82,6 +93,7 @@ public class UnitTestAppSettingsController
|
|||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
Assert.IsTrue(json != "[]");
|
Assert.IsTrue(json != "[]");
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -93,6 +105,7 @@ public class UnitTestAppSettingsController
|
|||||||
string result = appSettingsRepository.GetBuildNumberAndGitCommitSeven();
|
string result = appSettingsRepository.GetBuildNumberAndGitCommitSeven();
|
||||||
Assert.IsTrue(result is not null);
|
Assert.IsTrue(result is not null);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -108,6 +121,7 @@ public class UnitTestAppSettingsController
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetBuildNumberAndGitCommitSeven)}.json"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetBuildNumberAndGitCommitSeven)}.json"), json);
|
||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -54,8 +54,8 @@ public class UnitTestClientSettingsController
|
|||||||
{
|
{
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
string actionName = nameof(IClientSettingsController<object>.Action.Client);
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
string actionName = nameof(IClientSettingsController<object>.Action.Client);
|
||||||
HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}");
|
HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}");
|
||||||
Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode);
|
Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode);
|
||||||
Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString());
|
Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString());
|
||||||
|
@ -29,12 +29,20 @@ public class UnitTestExportController
|
|||||||
_ControllerName = nameof(Server.ApiControllers.ExportController)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.ExportController)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void NonThrowTryCatch()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{ throw new Exception(); }
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IExportController<string>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IExportController<string>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HeaderCommon GetHeaderCommon() =>
|
private static HeaderCommon GetHeaderCommon() =>
|
||||||
@ -52,6 +60,7 @@ public class UnitTestExportController
|
|||||||
string result = exportRepository.GetExport(GetHeaderCommon());
|
string result = exportRepository.GetExport(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -63,6 +72,7 @@ public class UnitTestExportController
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExport)}.txt"), result);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExport)}.txt"), result);
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -73,6 +83,7 @@ public class UnitTestExportController
|
|||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/export", GetStringContent());
|
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/export", GetStringContent());
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -84,6 +95,7 @@ public class UnitTestExportController
|
|||||||
Result<HeaderCommon[]> result = exportRepository.GetHeaders(GetHeaderCommon());
|
Result<HeaderCommon[]> result = exportRepository.GetHeaders(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -96,6 +108,7 @@ public class UnitTestExportController
|
|||||||
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -106,6 +119,7 @@ public class UnitTestExportController
|
|||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/headers", GetStringContent());
|
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/headers", GetStringContent());
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -117,6 +131,7 @@ public class UnitTestExportController
|
|||||||
Result<HeaderCommon[]> result = exportRepository.GetLogistics(GetHeaderCommon());
|
Result<HeaderCommon[]> result = exportRepository.GetLogistics(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -129,6 +144,7 @@ public class UnitTestExportController
|
|||||||
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -139,6 +155,7 @@ public class UnitTestExportController
|
|||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/logistics", GetStringContent());
|
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/logistics", GetStringContent());
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -150,6 +167,7 @@ public class UnitTestExportController
|
|||||||
string result = exportRepository.GetProcessDataStandardFormat(GetHeaderCommon());
|
string result = exportRepository.GetProcessDataStandardFormat(GetHeaderCommon());
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -161,6 +179,7 @@ public class UnitTestExportController
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProcessDataStandardFormat)}.pdsf"), result);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProcessDataStandardFormat)}.pdsf"), result);
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -171,6 +190,7 @@ public class UnitTestExportController
|
|||||||
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/processDataStandardFormat", GetStringContent());
|
HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/processDataStandardFormat", GetStringContent());
|
||||||
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -28,15 +28,23 @@ public class UnitTestInfinityQSController
|
|||||||
_ControllerName = nameof(Server.ApiControllers.InfinityQSController)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.InfinityQSController)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void NonThrowTryCatch()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{ throw new Exception(); }
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IInfinityQSController<string>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IInfinityQSController<string>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -48,9 +56,10 @@ public class UnitTestInfinityQSController
|
|||||||
string result = infinityQSRepository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
string result = infinityQSRepository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -62,9 +71,10 @@ public class UnitTestInfinityQSController
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -82,9 +92,10 @@ public class UnitTestInfinityQSController
|
|||||||
Assert.IsNotNull(result?.Results[0].TD_NAME);
|
Assert.IsNotNull(result?.Results[0].TD_NAME);
|
||||||
Assert.IsNotNull(result?.Results[0].TD_TEST);
|
Assert.IsNotNull(result?.Results[0].TD_TEST);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -98,9 +109,10 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -115,9 +127,10 @@ public class UnitTestInfinityQSController
|
|||||||
Assert.IsNotNull(result?.Results[0].SD_SGRP);
|
Assert.IsNotNull(result?.Results[0].SD_SGRP);
|
||||||
Assert.IsNotNull(result?.Results[0].SD_TSNO);
|
Assert.IsNotNull(result?.Results[0].SD_TSNO);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -131,9 +144,10 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSDescriptor[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptor[]>>(json);
|
Result<InfinityQSDescriptor[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptor[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -145,9 +159,10 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSEvent[]> result = infinityQSRepository.GetEvents("1677273357");
|
Result<InfinityQSEvent[]> result = infinityQSRepository.GetEvents("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -160,9 +175,10 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -174,9 +190,10 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSBase[]> result = infinityQSRepository.GetHeader("1677273357");
|
Result<InfinityQSBase[]> result = infinityQSRepository.GetHeader("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -189,6 +206,7 @@ public class UnitTestInfinityQSController
|
|||||||
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -28,17 +28,22 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
_ControllerName = nameof(Server.ApiControllers.InfinityQSV2Controller)[..^10];
|
_ControllerName = nameof(Server.ApiControllers.InfinityQSV2Controller)[..^10];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void NonThrowTryCatch()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{ throw new Exception(); }
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestControllerName()
|
public void TestControllerName()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
Assert.AreEqual(IInfinityQSV2Controller<string>.GetRouteName(), _ControllerName);
|
Assert.AreEqual(IInfinityQSV2Controller<string>.GetRouteName(), _ControllerName);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
|
||||||
[Ignore]
|
|
||||||
#endif
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetCommandText()
|
public void GetCommandText()
|
||||||
{
|
{
|
||||||
@ -48,9 +53,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
string result = infinityQSV2Repository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
string result = infinityQSV2Repository.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", "");
|
||||||
Assert.IsNotNull(result);
|
Assert.IsNotNull(result);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -62,9 +68,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json);
|
||||||
Assert.IsNotNull(json);
|
Assert.IsNotNull(json);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -82,9 +89,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Assert.IsNotNull(result?.Results[0].VariableNumber);
|
Assert.IsNotNull(result?.Results[0].VariableNumber);
|
||||||
Assert.IsNotNull(result?.Results[0].SubGroupDateTime);
|
Assert.IsNotNull(result?.Results[0].SubGroupDateTime);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -98,9 +106,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -115,9 +124,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Assert.IsNotNull(result?.Results[0].SubGroupId);
|
Assert.IsNotNull(result?.Results[0].SubGroupId);
|
||||||
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
Assert.IsNotNull(result?.Results[0].SiteNumber);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -131,9 +141,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSDescriptorV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV2[]>>(json);
|
Result<InfinityQSDescriptorV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV2[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -145,9 +156,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSEventV2[]> result = infinityQSV2Repository.GetEvents("1677273357");
|
Result<InfinityQSEventV2[]> result = infinityQSV2Repository.GetEvents("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -160,9 +172,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -174,9 +187,10 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSBaseV2[]> result = infinityQSV2Repository.GetHeader("1677273357");
|
Result<InfinityQSBaseV2[]> result = infinityQSV2Repository.GetHeader("1677273357");
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if !DEBUG
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -189,6 +203,7 @@ public class UnitTestInfinityQSV2Controller
|
|||||||
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
|
NonThrowTryCatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -132,6 +132,14 @@ steps:
|
|||||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
displayName: "Publish Test Results **/coverage.cobertura.xml"
|
||||||
|
inputs:
|
||||||
|
testResultsFormat: VSTest
|
||||||
|
testResultsFiles: "**/coverage.cobertura.xml"
|
||||||
|
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||||
|
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
|
||||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||||
displayName: "Create work item"
|
displayName: "Create work item"
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -110,6 +110,14 @@ steps:
|
|||||||
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||||
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
displayName: "Publish Test Results **/coverage.cobertura.xml"
|
||||||
|
inputs:
|
||||||
|
testResultsFormat: VSTest
|
||||||
|
testResultsFiles: "**/coverage.cobertura.xml"
|
||||||
|
testRunTitle: "$(GitCommitSeven)-$(Build.BuildId)-$(CoreVersion)-$(Configuration)-$(Build.Repository.Name)"
|
||||||
|
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
|
||||||
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||||
displayName: "Create work item"
|
displayName: "Create work item"
|
||||||
inputs:
|
inputs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user