Fixing coverage - 9
This commit is contained in:
@@ -63,9 +63,9 @@ public class ProgramUtils_Tests
|
||||
{
|
||||
OpenApiInfo expectedOpenApiInfo = new OpenApiInfo()
|
||||
{
|
||||
Title = "",
|
||||
Description = "",
|
||||
Version = "",
|
||||
Title = null,
|
||||
Description = null,
|
||||
Version = null,
|
||||
Contact = null,
|
||||
TermsOfService = 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]
|
||||
public void OpenApiConfig_NotNull()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user