From 2078334e19078d846fdbd4e8ca4a855f237d3b5d Mon Sep 17 00:00:00 2001 From: Andrew Horth Date: Tue, 10 Dec 2024 15:08:46 +0000 Subject: [PATCH] Amended to clear down data between tests which was causing indeterminate test results --- .../Services/TrsDataSync/TrsDataSyncServiceTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Tests/Services/TrsDataSync/TrsDataSyncServiceTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Tests/Services/TrsDataSync/TrsDataSyncServiceTests.cs index 7a0252337..c2e1ffa2c 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Tests/Services/TrsDataSync/TrsDataSyncServiceTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Tests/Services/TrsDataSync/TrsDataSyncServiceTests.cs @@ -1,9 +1,14 @@ + namespace TeachingRecordSystem.Core.Tests.Services.TrsDataSync; [Collection(nameof(TrsDataSyncTestCollection))] -public partial class TrsDataSyncServiceTests(TrsDataSyncServiceFixture fixture) : IClassFixture +public partial class TrsDataSyncServiceTests(TrsDataSyncServiceFixture fixture) : IClassFixture, IAsyncLifetime { private TestableClock Clock => fixture.Clock; private TestData TestData => fixture.TestData; + + Task IAsyncLifetime.DisposeAsync() => Task.CompletedTask; + + Task IAsyncLifetime.InitializeAsync() => fixture.DbFixture.DbHelper.ClearDataAsync(); }