Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageMigrationIntegrationTest.cs =================================================================== diff -u -rd4f3eeb2e013b9ed46b4a7fd21e3965f25bd763d -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageMigrationIntegrationTest.cs (.../StorageMigrationIntegrationTest.cs) (revision d4f3eeb2e013b9ed46b4a7fd21e3965f25bd763d) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageMigrationIntegrationTest.cs (.../StorageMigrationIntegrationTest.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -36,13 +36,11 @@ [TestFixture] public class StorageMigrationIntegrationTest { - private static readonly string testPath = TestHelper.GetTestDataPath(TestDataPath.Application.Ringtoets.Migration); - [Test] [Apartment(ApartmentState.STA)] public void GivenRingtoetsGuiWithStorageSql_WhenRunWithMigratedFile_MigratedProjectSet() { - string targetFilePath = Path.Combine(testPath, Path.GetRandomFileName()); + string targetFilePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); using (new FileDisposeHelper(targetFilePath)) { string sourceFilePath = TestHelper.GetTestDataPath(TestDataPath.Application.Ringtoets.Migration, "FullTestProject164.rtd"); Index: Core/Common/test/Core.Common.Gui.TestUtil.Test/Settings/TestSettingsHelperTest.cs =================================================================== diff -u -rb2c3b97977c16298442b149bed3c9050fbc6de7c -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Core/Common/test/Core.Common.Gui.TestUtil.Test/Settings/TestSettingsHelperTest.cs (.../TestSettingsHelperTest.cs) (revision b2c3b97977c16298442b149bed3c9050fbc6de7c) +++ Core/Common/test/Core.Common.Gui.TestUtil.Test/Settings/TestSettingsHelperTest.cs (.../TestSettingsHelperTest.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -52,7 +52,7 @@ string directory = settingsHelper.GetApplicationLocalUserSettingsDirectory(null); // Assert - string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Gui.Path); + string testDataPath = TestHelper.GetScratchPadPath(); Assert.AreEqual(testDataPath, directory); } @@ -84,7 +84,7 @@ string directory = settingsHelper.GetApplicationLocalUserSettingsDirectory(postfix); // Assert - string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Gui.Path, postfix); + string testDataPath = TestHelper.GetScratchPadPath(postfix); Assert.AreEqual(testDataPath, directory); Assert.IsTrue(Directory.Exists(testDataPath)); Directory.Delete(testDataPath); Index: Core/Common/test/Core.Common.Gui.TestUtil/Settings/TestSettingsHelper.cs =================================================================== diff -u -rb2c3b97977c16298442b149bed3c9050fbc6de7c -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Core/Common/test/Core.Common.Gui.TestUtil/Settings/TestSettingsHelper.cs (.../TestSettingsHelper.cs) (revision b2c3b97977c16298442b149bed3c9050fbc6de7c) +++ Core/Common/test/Core.Common.Gui.TestUtil/Settings/TestSettingsHelper.cs (.../TestSettingsHelper.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -38,7 +38,7 @@ /// public TestSettingsHelper() { - ExpectedApplicationLocalUserSettingsDirectory = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Gui.Path); + ExpectedApplicationLocalUserSettingsDirectory = TestHelper.GetScratchPadPath(); ApplicationName = string.Empty; ApplicationVersion = string.Empty; } Index: Core/Common/test/Core.Common.TestUtil.Test/DirectoryDisposeHelperTest.cs =================================================================== diff -u -r28abea0fa843f62a5c0835cba5831cf2206abc5d -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Core/Common/test/Core.Common.TestUtil.Test/DirectoryDisposeHelperTest.cs (.../DirectoryDisposeHelperTest.cs) (revision 28abea0fa843f62a5c0835cba5831cf2206abc5d) +++ Core/Common/test/Core.Common.TestUtil.Test/DirectoryDisposeHelperTest.cs (.../DirectoryDisposeHelperTest.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -29,7 +29,7 @@ [TestFixture] public class DirectoryDisposeHelperTest { - private static readonly TestDataPath testPath = TestDataPath.Core.Common.TestUtils; + private static readonly string rootFolder = TestHelper.GetScratchPadPath(); [Test] public void Constructor_NullRoot_ThrowsArgumentNullException() @@ -48,11 +48,8 @@ [Test] public void Constructor_NullSubfolder_ThrowsArgumentException() { - // Setup - string rootfolder = "root folder"; - // Call - TestDelegate test = () => new DirectoryDisposeHelper(rootfolder, null); + TestDelegate test = () => new DirectoryDisposeHelper(rootFolder, null); // Assert ArgumentException exception = Assert.Throws(test); @@ -63,7 +60,6 @@ public void Constructor_NotExistingFolder_CreatesFolder() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subFolder = Path.GetRandomFileName(); string folderPath = Path.Combine(rootFolder, subFolder); bool folderExists = false; @@ -90,7 +86,6 @@ public void Constructor_NotExistingFolders_CreatesFolders() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subFolder = Path.GetRandomFileName(); string subSubFolder = Path.GetRandomFileName(); string folderPath = Path.Combine(rootFolder, subFolder, subSubFolder); @@ -118,7 +113,6 @@ public void Constructor_ExistingFolder_DoesNotThrowException() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subFolder = Path.GetRandomFileName(); string folderPath = Path.Combine(rootFolder, subFolder); @@ -166,7 +160,6 @@ public void Dispose_AlreadyDisposed_DoesNotThrowException() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subfolder = Path.GetRandomFileName(); // Call @@ -186,7 +179,6 @@ public void Dispose_FolderAlreadyRemoved_DoesNotThrowException() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subfolder = Path.GetRandomFileName(); string folderPath = Path.Combine(rootFolder, subfolder); @@ -207,7 +199,6 @@ public void LockDirectory_ValidPath_LocksDirectory() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subfolder = Path.GetRandomFileName(); string folderPath = Path.Combine(rootFolder, subfolder); @@ -234,7 +225,6 @@ public void LockDirectory_RightNotSupported_ThrowsInvalidOperationException() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subfolder = Path.GetRandomFileName(); string folderPath = Path.Combine(rootFolder, subfolder); @@ -264,7 +254,6 @@ public void LockDirectory_DirectoryAlreadyLocked_DoesNotThrowException() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testPath); string subfolder = Path.GetRandomFileName(); string folderPath = Path.Combine(rootFolder, subfolder); Index: Core/Common/test/Core.Common.TestUtil.Test/DirectoryPermissionsRevokerTest.cs =================================================================== diff -u -r28abea0fa843f62a5c0835cba5831cf2206abc5d -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Core/Common/test/Core.Common.TestUtil.Test/DirectoryPermissionsRevokerTest.cs (.../DirectoryPermissionsRevokerTest.cs) (revision 28abea0fa843f62a5c0835cba5831cf2206abc5d) +++ Core/Common/test/Core.Common.TestUtil.Test/DirectoryPermissionsRevokerTest.cs (.../DirectoryPermissionsRevokerTest.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -31,7 +31,7 @@ [TestFixture] public class DirectoryPermissionsRevokerTest { - private readonly TestDataPath testWorkDir = TestDataPath.Core.Common.TestUtils; + private readonly string rootFolder = TestHelper.GetScratchPadPath(); [Test] [TestCase(null)] @@ -65,7 +65,6 @@ { // Setup const FileSystemRights rights = FileSystemRights.Synchronize; - string rootFolder = TestHelper.GetTestDataPath(testWorkDir); string subfolder = "UnsupportedRight" + rights; string folderPath = Path.Combine(rootFolder, subfolder); @@ -103,7 +102,6 @@ public void Constructor_ValidPathDenyRight_SetsDenyRight(FileSystemRights rights) { // Setup - string rootFolder = TestHelper.GetTestDataPath(testWorkDir); string subfolder = "ValidPathDenyRight_SetsDenyRight" + rights; string folderPath = Path.Combine(rootFolder, subfolder); @@ -144,7 +142,6 @@ public void Dispose_RightAlreadySet_DoesNotRemoveRight(FileSystemRights rights) { // Setup - string rootFolder = TestHelper.GetTestDataPath(testWorkDir); string subfolder = "RightAlreadySet" + rights; string folderPath = Path.Combine(rootFolder, subfolder); @@ -177,7 +174,6 @@ public void Dispose_DirectoryAlreadyRemoved_DoesNotThrowException() { // Setup - string rootFolder = TestHelper.GetTestDataPath(testWorkDir); string subfolder = "Deleted"; string folderPath = Path.Combine(rootFolder, subfolder); Index: Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs =================================================================== diff -u -r701ddc282bbb77d089a68ce276af1a80614435bf -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs (.../FileDisposeHelperTest.cs) (revision 701ddc282bbb77d089a68ce276af1a80614435bf) +++ Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs (.../FileDisposeHelperTest.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -28,13 +28,11 @@ [TestFixture] public class FileDisposeHelperTest { - private static readonly TestDataPath testPath = TestDataPath.Core.Common.TestUtils; - [Test] public void Constructor_NotExistingFile_DoesNotThrowException() { // Setup - string filePath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); FileDisposeHelper disposeHelper = null; // Precondition @@ -53,7 +51,7 @@ public void Constructor_ExistingFile_DoesNotThrowException() { // Setup - string filePath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); FileDisposeHelper disposeHelper = null; try @@ -79,7 +77,7 @@ public void Constructor_FileDoesNotExist_Createsfile() { // Setup - string filePath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); try { @@ -120,8 +118,8 @@ // Setup var filePaths = new[] { - TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()), - TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()) + TestHelper.GetScratchPadPath(Path.GetRandomFileName()), + TestHelper.GetScratchPadPath(Path.GetRandomFileName()) }; try @@ -150,7 +148,7 @@ public void Constructor_FilePathThatCannotBeCreated_ThrowsArgumentException() { // Setup - string filePath = Path.Combine(TestHelper.GetTestDataPath(testPath), "nonExistingPath", "fileThatCannotBeCreated"); + string filePath = TestHelper.GetScratchPadPath(Path.Combine("nonExistingPath", "fileThatCannotBeCreated")); // Call TestDelegate test = () => new FileDisposeHelper(filePath); @@ -165,7 +163,7 @@ // Setup var filePaths = new[] { - Path.Combine(TestHelper.GetTestDataPath(testPath), "nonExistingPath", "fileThatCannotBeCreated") + TestHelper.GetScratchPadPath(Path.Combine("nonExistingPath", "fileThatCannotBeCreated")) }; // Call @@ -179,7 +177,7 @@ public void LockFiles_ValidFilePath_LocksFile() { // Setup - string filePath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); try { @@ -205,7 +203,7 @@ public void LockFiles_FileAlreadyLocked_ThrowsInvalidOperationException() { // Setup - string filePath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); try { @@ -232,7 +230,7 @@ public void LockFiles_DirectoryAlreadyDeleted_ThrowsInvalidOperationException() { // Setup - string directoryPath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string directoryPath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); string filePath = Path.Combine(directoryPath, Path.GetRandomFileName()); try @@ -268,7 +266,7 @@ public void LockedFiles_LockFilesCalledAlready_DoesNotThrowException() { // Setup - string filePath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); try { @@ -309,7 +307,7 @@ public void Dispose_ExistingFile_DeletesFile() { // Setup - string filePath = TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()); + string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); try { @@ -337,8 +335,8 @@ // Setup var filePaths = new[] { - TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()), - TestHelper.GetTestDataPath(testPath, Path.GetRandomFileName()) + TestHelper.GetScratchPadPath(Path.GetRandomFileName()), + TestHelper.GetScratchPadPath(Path.GetRandomFileName()) }; try @@ -374,7 +372,7 @@ public void Dispose_FileAlreadyDeleted_DoesNotThrowException() { // Setup - string directoryPath = TestHelper.GetTestDataPath(testPath, "willBeRemoved"); + string directoryPath = TestHelper.GetScratchPadPath("willBeRemoved"); string filePath = Path.Combine(directoryPath, Path.GetRandomFileName()); // Call Index: Core/Common/test/Core.Common.Utils.Test/IOUtilsTest.cs =================================================================== diff -u -rc53daf92d7ca4689ea2cd7bb8e532d02b52a7f34 -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Core/Common/test/Core.Common.Utils.Test/IOUtilsTest.cs (.../IOUtilsTest.cs) (revision c53daf92d7ca4689ea2cd7bb8e532d02b52a7f34) +++ Core/Common/test/Core.Common.Utils.Test/IOUtilsTest.cs (.../IOUtilsTest.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -98,7 +98,7 @@ public void GetFullPath_ValidPath_ReturnsFullPath() { // Setup - string path = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils); + string path = TestHelper.GetScratchPadPath(); // Call string actualFilePath = IOUtils.GetFullPath(path); @@ -172,7 +172,7 @@ public void IsValidFolderPath_ValidPath_ReturnTrue() { // Setup - string path = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils); + string path = TestHelper.GetScratchPadPath(); // Call bool isFolderPathValid = IOUtils.IsValidFilePath(path); @@ -234,7 +234,7 @@ public void ValidateFolderPath_ValidPath_DoesNotThrow() { // Setup - string path = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils); + string path = TestHelper.GetScratchPadPath(); // Call TestDelegate call = () => IOUtils.ValidateFolderPath(path); @@ -293,7 +293,7 @@ public void ValidateFilePath_PathEndsWithEmptyFileName_ThrowsArgumentException() { // Setup - string folderPath = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils) + Path.DirectorySeparatorChar; + string folderPath = TestHelper.GetScratchPadPath() + Path.DirectorySeparatorChar; // Call TestDelegate call = () => IOUtils.ValidateFilePath(folderPath); @@ -349,7 +349,7 @@ public void IsValidFilePath_PathIsActuallyFolder_ReturnsFalse() { // Setup - string folderPath = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils) + Path.DirectorySeparatorChar; + string folderPath = TestHelper.GetScratchPadPath() + Path.DirectorySeparatorChar; // Call bool valid = IOUtils.IsValidFilePath(folderPath); @@ -379,7 +379,7 @@ public void DeleteOldFiles_InvalidSearchPattern_ThrowsArgumentException(string invalidSearchPattern) { // Setup - string path = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils); + string path = TestHelper.GetScratchPadPath(); // Call TestDelegate call = () => IOUtils.DeleteOldFiles(path, invalidSearchPattern, 0); @@ -403,7 +403,7 @@ // Assert IOException exception = Assert.Throws(call); - var message = string.Format("Er is een fout opgetreden bij het verwijderen van bestanden in de map '{0}'.", path); + var message = $"Er is een fout opgetreden bij het verwijderen van bestanden in de map '{path}'."; Assert.AreEqual(message, exception.Message); Assert.IsInstanceOf(exception.InnerException); } @@ -412,7 +412,7 @@ public void DeleteOldFiles_ValidPathWithFile_DeletesFile() { // Setup - string path = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils); + string path = TestHelper.GetScratchPadPath(); string filePath = Path.Combine(path, "fileToDelete.log"); using (new FileDisposeHelper(filePath)) Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs =================================================================== diff -u -rf02614d781e389e05b9b481e8d165286e6baad4d -r3a1d4488d68236efe6eccbd60be3484735aa689b --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (.../MapControlTest.cs) (revision f02614d781e389e05b9b481e8d165286e6baad4d) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (.../MapControlTest.cs) (revision 3a1d4488d68236efe6eccbd60be3484735aa689b) @@ -55,7 +55,7 @@ { private const double padding = 0.05; private const string tileCachesFolder = "tilecaches"; - private static readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Core.Components.DotSpatial.Forms); + private static readonly string rootPath = TestHelper.GetScratchPadPath(); [Test] public void DefaultConstructor_DefaultValues() @@ -252,9 +252,9 @@ using (new UseCustomSettingsHelper(new TestSettingsHelper { - ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(testDataPath, folderWithoutPermission) + ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(rootPath, folderWithoutPermission) })) - using (var disposeHelper = new DirectoryDisposeHelper(testDataPath, folderWithoutPermission, tileCachesFolder)) + using (var disposeHelper = new DirectoryDisposeHelper(rootPath, folderWithoutPermission, tileCachesFolder)) using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) using (var map = new MapControl { @@ -297,9 +297,9 @@ using (new UseCustomSettingsHelper(new TestSettingsHelper { - ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(testDataPath, folderWithoutPermission) + ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(rootPath, folderWithoutPermission) })) - using (var disposeHelper = new DirectoryDisposeHelper(testDataPath, folderWithoutPermission, tileCachesFolder)) + using (var disposeHelper = new DirectoryDisposeHelper(rootPath, folderWithoutPermission, tileCachesFolder)) using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) using (var map = new MapControl()) { @@ -366,7 +366,7 @@ { // Given string folderWithoutPermission = Path.GetRandomFileName(); - string settingsDirectory = Path.Combine(testDataPath, folderWithoutPermission); + string settingsDirectory = Path.Combine(rootPath, folderWithoutPermission); WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); var mapDataContainer = new BackgroundMapDataContainer @@ -378,7 +378,7 @@ { ExpectedApplicationLocalUserSettingsDirectory = settingsDirectory })) - using (new DirectoryDisposeHelper(testDataPath, folderWithoutPermission, tileCachesFolder)) + using (new DirectoryDisposeHelper(rootPath, folderWithoutPermission, tileCachesFolder)) using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) using (var map = new MapControl()) { @@ -456,9 +456,9 @@ using (new UseCustomSettingsHelper(new TestSettingsHelper { - ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(testDataPath, folderWithoutPermission) + ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(rootPath, folderWithoutPermission) })) - using (var disposeHelper = new DirectoryDisposeHelper(testDataPath, folderWithoutPermission, tileCachesFolder)) + using (var disposeHelper = new DirectoryDisposeHelper(rootPath, folderWithoutPermission, tileCachesFolder)) using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) using (var map = new MapControl()) { @@ -1672,9 +1672,9 @@ using (new UseCustomSettingsHelper(new TestSettingsHelper { - ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(testDataPath, folderWithoutPermission) + ExpectedApplicationLocalUserSettingsDirectory = Path.Combine(rootPath, folderWithoutPermission) })) - using (var disposeHelper = new DirectoryDisposeHelper(testDataPath, folderWithoutPermission, tileCachesFolder)) + using (var disposeHelper = new DirectoryDisposeHelper(rootPath, folderWithoutPermission, tileCachesFolder)) using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) using (var map = new MapControl()) {