diff --git a/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs b/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs index 7a1279ba19..fff9e27b76 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs +++ b/backend/FwLite/FwLiteProjectSync.Tests/Fixtures/SyncFixture.cs @@ -31,7 +31,7 @@ private SyncFixture(string projectName, string projectFolder) _services = rootServiceProvider.CreateAsyncScope(); } - public SyncFixture(): this("sena-3_" + Guid.NewGuid().ToString("N"), "FwLiteSyncFixture") + public SyncFixture(): this("sena-3_" + Guid.NewGuid().ToString().Split("-")[0], "FwLiteSyncFixture" + Guid.NewGuid().ToString().Split("-")[0]) { } @@ -56,8 +56,19 @@ public async Task InitializeAsync() public async Task DisposeAsync() { + var dbContext = _services.ServiceProvider.GetRequiredService(); + await dbContext.Database.EnsureDeletedAsync(); // this is necessary or else the db is still in use when we try to delete the crdtProjectsFolder. Is that bad? + + var projectsFolder = _services.ServiceProvider.GetRequiredService>().Value + .ProjectsFolder; + var crdtProjectsFolder = + _services.ServiceProvider.GetRequiredService>().Value.ProjectPath; + await _services.DisposeAsync(); _cleanup.Dispose(); + + Directory.Delete(crdtProjectsFolder, true); + Directory.Delete(projectsFolder, true); } public CrdtMiniLcmApi CrdtApi { get; set; } = null!;