Example #1
0
        public void ReturnToRelative()
        {
            var root = @"C:\fake\dir\";
            var file = @"another\file.js";
            var expected = @"another/file.js";

            var builder = new KeyBuilder(root, "");
            Assert.AreEqual(expected, builder.GetKeyFor(root + file));
        }
Example #2
0
        public void ReturnToRelative_Only_Replaces_First_Occurrence_Of_Root()
        {
            var root = @"test/";
            var file = @"another/andthen/test/again.js";
            var expected = @"another/andthen/test/again.js";

            var builder = new KeyBuilder(root, "");
            Assert.AreEqual(expected, builder.GetKeyFor(root + file));
        }
Example #3
0
        public void ReturnToRelative()
        {
            var root     = @"C:\fake\dir\";
            var file     = @"another\file.js";
            var expected = @"another/file.js";

            var builder = new KeyBuilder(root, "");

            Assert.AreEqual(expected, builder.GetKeyFor(root + file));
        }
Example #4
0
        public void ReturnToRelative_Only_Replaces_First_Occurrence_Of_Root()
        {
            var root     = @"test/";
            var file     = @"another/andthen/test/again.js";
            var expected = @"another/andthen/test/again.js";

            var builder = new KeyBuilder(root, "");

            Assert.AreEqual(expected, builder.GetKeyFor(root + file));
        }
Example #5
0
        public void ReturnToRelative_Injects_Virtual_Directory()
        {
            var root = @"C:\fake\dir\";
            var file = @"another\file.js";
            var vdir = "/this";
            var expected = @"this/another/file.js";

            var builder = new KeyBuilder(root, vdir);
            Assert.AreEqual(expected, builder.GetKeyFor(root + file));
        }
Example #6
0
        public void ReturnToRelative_Injects_Virtual_Directory()
        {
            var root     = @"C:\fake\dir\";
            var file     = @"another\file.js";
            var vdir     = "/this";
            var expected = @"this/another/file.js";

            var builder = new KeyBuilder(root, vdir);

            Assert.AreEqual(expected, builder.GetKeyFor(root + file));
        }