Fixing sonarcloud issues

This commit is contained in:
2025-06-22 22:00:12 +02:00
parent 4c3aa30cbb
commit 9e95ad1cc8
4 changed files with 35 additions and 35 deletions

View File

@@ -22,7 +22,7 @@ public class JwtTokenUtils_Tests
AppSettings appSettings = ProgramUtils.AddConfiguration(ref builder, System.AppDomain.CurrentDomain.BaseDirectory + "/JsonData");
JwtTokenUtils jwtUtils = new JwtTokenUtils(appSettings);
var jwt = jwtUtils.GenerateToken(_guid);
Assert.IsTrue(!String.IsNullOrEmpty(jwt));
Assert.IsFalse(String.IsNullOrEmpty(jwt));
}
catch (Exception ex)
{
@@ -41,7 +41,7 @@ public class JwtTokenUtils_Tests
JwtTokenUtils jwtUtils = new JwtTokenUtils(appSettings);
var jwt = jwtUtils.GenerateToken(_guid);
var guid = jwtUtils.ValidateToken($"Bearer {jwt}");
Assert.IsTrue(_guid == guid);
Assert.AreEqual(_guid, guid);
}
catch (Exception ex)
{

View File

@@ -92,7 +92,7 @@ public class ProgramUtils_Tests
AppSettings appSettings = new AppSettings();
OpenApiInfo realOpenApiInfo = ProgramUtils.CreateOpenApiInfo(appSettings);
Assert.IsTrue(realOpenApiInfo != null);
Assert.IsNotNull(realOpenApiInfo);
}
catch (Exception ex)
{
@@ -118,10 +118,10 @@ public class ProgramUtils_Tests
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);
Assert.IsNotNull(realOpenApiInfo);
Assert.AreEqual(appSettings.Settings.Name, realOpenApiInfo.Title);
Assert.AreEqual(appSettings.Settings.Description, realOpenApiInfo.Description);
Assert.AreEqual(appSettings.Settings.Version, realOpenApiInfo.Version);
}
catch (Exception ex)
{
@@ -151,11 +151,11 @@ public class ProgramUtils_Tests
}
};
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);
Assert.IsNotNull(realOpenApiInfo);
Assert.AreEqual(appSettings.Settings.Name, realOpenApiInfo.Title);
Assert.AreEqual(appSettings.Settings.Description, realOpenApiInfo.Description);
Assert.AreEqual(appSettings.Settings.Version, realOpenApiInfo.Version);
Assert.IsNull(realOpenApiInfo.TermsOfService);
}
catch (Exception ex)
{