Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -r46f39b6003e678cb2fa3add0365f78f09701cf63 -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 46f39b6003e678cb2fa3add0365f78f09701cf63) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -15,29 +15,7 @@ { private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Application.Ringtoets.Storage, "DatabaseFiles"); private readonly string tempRingtoetsFile = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Application.Ringtoets.Storage, "DatabaseFiles"), "tempProjectFile.rtd"); - private Project fullProject; - [SetUp] - public void Setup() - { - fullProject = new Project() - { - Name = "tempProjectFile", - Description = "description", - Items = - { - new DikeAssessmentSection - { - Name = "dikeAssessmentSection" - }, - new DuneAssessmentSection - { - Name = "duneAssessmentSection" - } - } - }; - } - [TestFixtureTearDown] [TearDown] public void TearDownTempRingtoetsFile() @@ -49,6 +27,7 @@ public void SaveProjectAs_SaveAsNewFile_ProjectAsEntitiesInBothFiles() { // Setup + Project fullProject = GetFullProject(); var tempFile = Path.Combine(testDataPath, "tempProjectAsFile.rtd"); StorageSqLite storage = new StorageSqLite(); @@ -102,6 +81,7 @@ { // Setup StorageSqLite storage = new StorageSqLite(); + Project fullProject = GetFullProject(); TestDelegate precondition = () => storage.SaveProjectAs(tempRingtoetsFile, fullProject); Assert.DoesNotThrow(precondition, String.Format("Precondition: file '{0}' must be a valid Ringtoets database file.", tempRingtoetsFile)); @@ -207,6 +187,26 @@ } } + private static Project GetFullProject() + { + return new Project() + { + Name = "tempProjectFile", + Description = "description", + Items = + { + new DikeAssessmentSection + { + Name = "dikeAssessmentSection" + }, + new DuneAssessmentSection + { + Name = "duneAssessmentSection" + } + } + }; + } + private void TearDownTempRingtoetsFile(string filePath) { GC.Collect();