Fixing coverage - 10
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
**/obj
|
||||
**/bin
|
||||
**/appsettings.*.json
|
||||
**/coverage.xml
|
||||
@@ -138,6 +138,40 @@ public class ProgramUtils_Tests
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CreateOpenApiInfo_NullTermsOfServiceUrl()
|
||||
{
|
||||
try
|
||||
{
|
||||
AppSettings appSettings = new AppSettings()
|
||||
{
|
||||
Settings = new Settings
|
||||
{
|
||||
Name = "Test",
|
||||
Description = "This is a test description",
|
||||
Version = "v1"
|
||||
},
|
||||
OpenApiSettings = new OpenApiSettings
|
||||
{
|
||||
TermsOfServiceUrl = null,
|
||||
OpenApiContact = null,
|
||||
OpenApiLicense = 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);
|
||||
Assert.IsTrue(realOpenApiInfo.TermsOfService == null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.InnerException);
|
||||
Assert.Fail($"An exception was thrown: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void OpenApiConfig_NotNull()
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ You can find the integration in [build.yml](.github/workflows/build.yml).
|
||||
|
||||
#### Quality gate
|
||||
[](https://sonarcloud.io/summary/new_code?id=csimonapastore_BasicDotnetTemplate)
|
||||
|
||||
A Quality Gate is a set of measure-based, Boolean conditions. It helps you know immediately whether your projects are production-ready.
|
||||
This project uses **Sonar way** quality gate:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user