Added test for APIs
This commit is contained in:
@ -12,8 +12,7 @@ public record AppSettings(string BaseAPIAddress,
|
||||
bool IsStaging,
|
||||
string MonAResource,
|
||||
string MonASite,
|
||||
string ToolStateOwnerFilePath,
|
||||
string URLs)
|
||||
string ToolStateOwnerFilePath)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
|
@ -19,7 +19,6 @@ public class AppSettings
|
||||
[Display(Name = "MonA Resource"), Required] public string MonAResource { get; set; }
|
||||
[Display(Name = "MonA Site"), Required] public string MonASite { get; set; }
|
||||
[Display(Name = "Tool State Owner File Path"), Required] public string ToolStateOwnerFilePath { get; set; }
|
||||
[Display(Name = "URLs"), Required] public string URLs { get; set; }
|
||||
|
||||
#nullable enable
|
||||
|
||||
@ -54,8 +53,6 @@ public class AppSettings
|
||||
throw new NullReferenceException(nameof(MonAResource));
|
||||
if (appSettings.MonASite is null)
|
||||
throw new NullReferenceException(nameof(MonASite));
|
||||
if (appSettings.URLs is null)
|
||||
throw new NullReferenceException(nameof(URLs));
|
||||
if (appSettings.ToolStateOwnerFilePath is null)
|
||||
throw new NullReferenceException(nameof(ToolStateOwnerFilePath));
|
||||
result = new(
|
||||
@ -69,8 +66,7 @@ public class AppSettings
|
||||
appSettings.IsStaging.Value,
|
||||
appSettings.MonAResource,
|
||||
appSettings.MonASite,
|
||||
appSettings.ToolStateOwnerFilePath,
|
||||
appSettings.URLs);
|
||||
appSettings.ToolStateOwnerFilePath);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
using ReportingServices.UI.Models;
|
||||
using Serilog;
|
||||
|
||||
internal class Program
|
||||
namespace ReportingServices.UI;
|
||||
|
||||
public class Program
|
||||
{
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
@ -9,7 +11,7 @@ internal class Program
|
||||
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
_ = builder.Configuration.AddUserSecrets<Program>();
|
||||
AppSettings appSettings = ReportingServices.UI.Models.Binder.AppSettings.Get(builder.Configuration);
|
||||
AppSettings appSettings = Models.Binder.AppSettings.Get(builder.Configuration);
|
||||
Environment.SetEnvironmentVariable("workingDirectory", "D:\\tmp\\logging\\MesaReportingServices\\UI");
|
||||
_ = loggerConfiguration.ReadFrom.Configuration(builder.Configuration);
|
||||
_ = builder.Host.UseSerilog();
|
||||
|
Reference in New Issue
Block a user