Fixing coverage - 9
This commit is contained in:
@@ -63,9 +63,9 @@ public class ProgramUtils_Tests
|
|||||||
{
|
{
|
||||||
OpenApiInfo expectedOpenApiInfo = new OpenApiInfo()
|
OpenApiInfo expectedOpenApiInfo = new OpenApiInfo()
|
||||||
{
|
{
|
||||||
Title = "",
|
Title = null,
|
||||||
Description = "",
|
Description = null,
|
||||||
Version = "",
|
Version = null,
|
||||||
Contact = null,
|
Contact = null,
|
||||||
TermsOfService = null,
|
TermsOfService = null,
|
||||||
License = null,
|
License = null,
|
||||||
@@ -109,6 +109,35 @@ public class ProgramUtils_Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void CreateOpenApiInfo_NullOpenApiSettings()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
AppSettings appSettings = new AppSettings()
|
||||||
|
{
|
||||||
|
Settings = new Settings
|
||||||
|
{
|
||||||
|
Name = "Test",
|
||||||
|
Description = "This is a test description",
|
||||||
|
Version = "v1"
|
||||||
|
},
|
||||||
|
OpenApiSettings = null
|
||||||
|
};
|
||||||
|
OpenApiInfo realOpenApiInfo = ProgramUtils.CreateOpenApiInfo(appSettings);
|
||||||
|
Assert.IsTrue(realOpenApiInfo != null);
|
||||||
|
Assert.IsTrue(realOpenApiInfo.Title == appSettings.Settings.Name);
|
||||||
|
Assert.IsTrue(realOpenApiInfo.Description == appSettings.Settings.Description);
|
||||||
|
Assert.IsTrue(realOpenApiInfo.Version == appSettings.Settings.Version);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.InnerException);
|
||||||
|
Assert.Fail($"An exception was thrown: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void OpenApiConfig_NotNull()
|
public void OpenApiConfig_NotNull()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user