Example #1
0
        private static void TestAbsolutePathEquality(PathTable pt1, PathTable pt2, string absolutePath)
        {
            var remapper = new PathRemapper(pt1, pt2);
            var r1       = AbsolutePath.Create(pt1, absolutePath);

            var r1Remap = remapper.Remap(r1);
            var r2      = AbsolutePath.Create(pt2, absolutePath);

            XAssert.AreEqual(r1.ToString(pt1), r2.ToString(pt2));
            XAssert.AreEqual(r1Remap, r2);
        }
Example #2
0
        private static void TestRelativePathEquality(PathTable pt1, PathTable pt2, string relativePath)
        {
            var remapper = new PathRemapper(pt1, pt2);
            var r1       = RelativePath.Create(pt1.StringTable, relativePath);

            var r1Remap = remapper.Remap(r1);
            var r2      = RelativePath.Create(pt2.StringTable, relativePath);

            XAssert.AreEqual(r1.ToString(pt1.StringTable), r2.ToString(pt2.StringTable));
            XAssert.AreEqual(r1Remap, r2);
        }
Example #3
0
        private static void TestRelativePathModuloCustomRemap(
            PathTable pt1,
            PathTable pt2,
            Func <string, string> customRemapper,
            string relativePath,
            string expectedRelativePath)
        {
            var remapper = new PathRemapper(pt1, pt2, pathAtomStringRemapper: customRemapper);
            var r1       = RelativePath.Create(pt1.StringTable, relativePath);

            var r1Remap = remapper.Remap(r1);
            var r2      = RelativePath.Create(pt2.StringTable, expectedRelativePath);

            XAssert.AreEqual(r2, r1Remap, $"Expected: {r2.ToString(pt2.StringTable)}, Actual: {r1Remap.ToString(pt2.StringTable)}");
        }
Example #4
0
        private static void TestAbsolutePathModuloCustomRemap(
            PathTable pt1,
            PathTable pt2,
            Func <string, string> customRemapper,
            string absolutePath,
            string expectedAbsolutePath)
        {
            var remapper = new PathRemapper(pt1, pt2, pathStringRemapper: customRemapper);
            var r1       = AbsolutePath.Create(pt1, absolutePath);

            var r1Remap = remapper.Remap(r1);
            var r2      = AbsolutePath.Create(pt2, expectedAbsolutePath);

            XAssert.AreEqual(r2, r1Remap, $"Expected: {r2.ToString(pt2)}, Actual: {r1Remap.ToString(pt2)}");
        }