test: Fix CompositionRoot tests

Some types do not get registered until later on after
CompositionRoot.Setup() is called. Use IntegrationFixture to fulfill
mock versions of those types.
pull/151/head
Robert Dailey 2 years ago
parent d83edd9e2b
commit 794c8733ef

@ -10,6 +10,7 @@ using FluentAssertions;
using NSubstitute; using NSubstitute;
using NUnit.Framework; using NUnit.Framework;
using Recyclarr.Command; using Recyclarr.Command;
using Recyclarr.TestLibrary;
using Serilog; using Serilog;
using TrashLib; using TrashLib;
using TrashLib.Config.Services; using TrashLib.Config.Services;
@ -31,7 +32,7 @@ public static class FactoryForService<TService>
[TestFixture] [TestFixture]
[Parallelizable(ParallelScope.All)] [Parallelizable(ParallelScope.All)]
public class CompositionRootTest public class CompositionRootTest : IntegrationFixture
{ {
private static readonly List<ServiceFactoryWrapper> FactoryTests = new() private static readonly List<ServiceFactoryWrapper> FactoryTests = new()
{ {
@ -43,8 +44,7 @@ public class CompositionRootTest
{ {
var act = () => var act = () =>
{ {
using var container = CompositionRoot.Setup(); service.Instantiate(Container);
service.Instantiate(container);
}; };
// Do not use `NotThrow()` here because fluent assertions doesn't show the full exception details // Do not use `NotThrow()` here because fluent assertions doesn't show the full exception details

Loading…
Cancel
Save