From 794c8733ef653f852c497d2a422b5fd1a68215bd Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Fri, 18 Nov 2022 07:38:22 -0600 Subject: [PATCH] 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. --- src/Recyclarr.Tests/CompositionRootTest.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Recyclarr.Tests/CompositionRootTest.cs b/src/Recyclarr.Tests/CompositionRootTest.cs index 162edb71..62935953 100644 --- a/src/Recyclarr.Tests/CompositionRootTest.cs +++ b/src/Recyclarr.Tests/CompositionRootTest.cs @@ -10,6 +10,7 @@ using FluentAssertions; using NSubstitute; using NUnit.Framework; using Recyclarr.Command; +using Recyclarr.TestLibrary; using Serilog; using TrashLib; using TrashLib.Config.Services; @@ -31,7 +32,7 @@ public static class FactoryForService [TestFixture] [Parallelizable(ParallelScope.All)] -public class CompositionRootTest +public class CompositionRootTest : IntegrationFixture { private static readonly List FactoryTests = new() { @@ -43,8 +44,7 @@ public class CompositionRootTest { 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