Fixing coverage - 10

This commit is contained in:
2024-05-13 21:43:49 +02:00
parent 57391d3e51
commit fb578026eb
3 changed files with 38 additions and 2 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
**/obj
**/bin
**/appsettings.*.json
**/coverage.xml

View File

@@ -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()
{

View File

@@ -28,6 +28,7 @@ You can find the integration in [build.yml](.github/workflows/build.yml).
#### Quality gate
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=csimonapastore_BasicDotnetTemplate&metric=alert_status)](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: