Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqliteCreatorTest.cs =================================================================== diff -u -rb2b750256550d807650f79419692cad0548d754d -r9e5ed1951ee2cf1e00c8dc3bc367711600fa77e0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqliteCreatorTest.cs (.../StorageSqliteCreatorTest.cs) (revision b2b750256550d807650f79419692cad0548d754d) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqliteCreatorTest.cs (.../StorageSqliteCreatorTest.cs) (revision 9e5ed1951ee2cf1e00c8dc3bc367711600fa77e0) @@ -28,6 +28,8 @@ { public class StorageSqliteCreatorTest { + private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Application.Ringtoets.Storage, "DatabaseFiles"); + [Test] [TestCase(null)] [TestCase("")] @@ -47,10 +49,11 @@ { // Setup const string fileName = "DoesNotExist.sqlite"; - var localPath = Path.Combine(@"c:\", fileName); - var uncPath = Path.Combine(@"\\localhost\c$", fileName); - using (new FileDisposeHelper(localPath)) + var fullPath = Path.GetFullPath(Path.Combine(testDataPath, fileName)); + var uncPath = GetUncPath(fullPath); + + using (new FileDisposeHelper(fullPath)) { // Call TestDelegate call = () => StorageSqliteCreator.CreateDatabaseStructure(uncPath); @@ -59,5 +62,17 @@ Assert.DoesNotThrow(call); } } + + private static string GetUncPath(string fullPath) + { + var root = Path.GetPathRoot(fullPath); + Assert.IsNotNull(root); + + var relativePath = fullPath.Replace(root, ""); + var drive = root.Remove(1); + + var uncPath = new Uri(Path.Combine(@"\\localhost", drive + "$", relativePath)); + return uncPath.LocalPath; + } } } \ No newline at end of file