This commit is contained in:
Paul Schneider 2026-02-16 00:14:33 +00:00
commit ca03b496db
19 changed files with 45 additions and 106 deletions

View file

@ -3,7 +3,6 @@ using Microsoft.Extensions.DependencyInjection;
using Yavsc.Models;
using Xunit.Abstractions;
using Yavsc.Server.Models.IT.SourceCode;
using yavscTests.Settings;
using Microsoft.EntityFrameworkCore;
using isnd.tests;
@ -14,13 +13,11 @@ namespace yavscTests
public class BaseTestContext: IClassFixture<WebServerFixture>, IDisposable
{
public readonly WebServerFixture _serverFixture;
private readonly TestingSetup _testingOptions;
private readonly ITestOutputHelper _output;
public BaseTestContext(ITestOutputHelper output, WebServerFixture fixture)
{
this._serverFixture = fixture;
_testingOptions = fixture.TestingSetup;
this._output = output;
}

View file

@ -1,6 +1,4 @@
using System;
using isnd.tests;
using Xunit;
using Xunit.Abstractions;
namespace yavscTests.Mandatory
@ -18,7 +16,6 @@ namespace yavscTests.Mandatory
this.output = output;
_serverFixture = serverFixture;
output.WriteLine($"Testing connection string is {_serverFixture?.TestingSetup?.ConnectionStrings.DefaultConnection}");
}
/// <summary>

View file

@ -1,12 +1,8 @@
using isnd.tests;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
using Yavsc.Abstract.Manage;
using Yavsc.Interface;
using Yavsc.Models;
namespace yavscTests
{

View file

@ -1,7 +0,0 @@
namespace yavscTests.Settings
{
public class DbConnectionSettings
{
public string? DefaultConnection { get; set; }
}
}

View file

@ -1,23 +0,0 @@
namespace yavscTests.Settings
{
public class PasswordCreds
{
public string UserName { get; set; }
public string Password { get; set; }
}
public class TestingSetup
{
public DbConnectionSettings ConnectionStrings { get; set; }
public PasswordCreds ValidCreds
{
get; set;
}
public PasswordCreds InvalidCreds
{
get; set;
}
public string YavscWebPath {get; set; }
}
}

View file

@ -1,7 +1,4 @@
using System.Net;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.AspNetCore.Identity;
@ -9,15 +6,10 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Xunit;
using Yavsc;
using Yavsc.Models;
using Yavsc.Services;
using yavscTests.Settings;
using Yavsc.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
using Yavsc.Models.Auth;
using Serilog;
using Serilog.Events;
using Serilog.Sinks.SystemConsole.Themes;
@ -46,7 +38,6 @@ namespace isnd.tests
public ApplicationUser TestingUser { get; private set; }
public bool DbCreated { get; internal set; }
public SiteSettings SiteSettings { get => siteSettings; set => siteSettings = value; }
public TestingSetup? TestingSetup { get; internal set; }
public string TestClientSecret { get; private set; } = "TestClientSecret";
public WebServerFixture()
@ -118,10 +109,7 @@ namespace isnd.tests
Addresses.Add(address);
}
SiteSettings = app.Services.GetRequiredService<IOptions<SiteSettings>>().Value;
}
public void EnsureUser(string testingUserName, string password)

View file

@ -24,11 +24,11 @@
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Yavsc\Yavsc.csproj" />
<ProjectReference Include="..\..\src\Yavsc.Abstract\Yavsc.Abstract.csproj" />
<ProjectReference Include="..\..\src\Yavsc.Server\Yavsc.Server.csproj" />
<ProjectReference Include="..\..\src\Org\Org.csproj" />
<ProjectReference Include="..\..\src\Abstract\Abstract.csproj" />
<ProjectReference Include="..\..\src\Server\Server.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
</Project>
</Project>