Reorganize tests by API and service concerns
This commit is contained in:
30
RpgRoller.Tests/HostingCoverageTests.cs
Normal file
30
RpgRoller.Tests/HostingCoverageTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using RpgRoller.Hosting;
|
||||
|
||||
namespace RpgRoller.Tests;
|
||||
|
||||
public sealed class HostingCoverageTests
|
||||
{
|
||||
[Fact]
|
||||
public void AddRpgRollerCore_WithInMemoryConnectionString_RegistersCoreServices()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.AddInMemoryCollection(new Dictionary<string, string?>
|
||||
{
|
||||
["ConnectionStrings:RpgRoller"] = "Data Source=:memory:"
|
||||
})
|
||||
.Build();
|
||||
|
||||
var environment = new TestWebHostEnvironment
|
||||
{
|
||||
ContentRootPath = Path.GetTempPath()
|
||||
};
|
||||
|
||||
services.AddRpgRollerCore(configuration, environment);
|
||||
|
||||
Assert.Contains(services, d => d.ServiceType == typeof(RpgRoller.Services.IGameService));
|
||||
Assert.Contains(services, d => d.ServiceType == typeof(RpgRoller.Services.IDiceRoller));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user