public void AppendTrailingSlashWorks()
 {
     var pb = new VirtualPathBuilder().CombineWith("/").AppendTrailingSlash();
     Assert.IsTrue(pb == "/");
     pb.Clear().CombineWith("/foo").AppendTrailingSlash();
     Assert.IsTrue(pb.HasTrailingSlash());
     Assert.IsTrue(pb == "/foo/");
 }
 private static void MonkeyTest(string appName)
 {
     var pb = new VirtualPathBuilder(appName);
     Assert.AreEqual("", pb.ToString());
     Assert.AreEqual((appName+"/").Replace("//","/"), pb.ApplicationRoot);
     Assert.AreEqual(pb.Length, 0);
     Assert.IsTrue(pb == "");
     Assert.IsFalse(pb.IsAbsolutePath());
     Assert.IsFalse(pb.IsApplicationRoot());
     Assert.IsFalse(pb.IsRelativePath());
     Assert.IsFalse(pb.HasRootOperator());
     Assert.IsFalse(pb.HasExtension());
     Assert.IsFalse(pb.HasTrailingSlash());
     Assert.IsFalse(pb.IsValidAbsolutePath());
 }
 private static void AssertIsValidRoot(VirtualPathBuilder pb)
 {
     Assert.IsTrue(pb.IsAbsolutePath());
     Assert.IsTrue(pb.IsApplicationRoot());
     Assert.IsFalse(pb.IsRelativePath());
     Assert.IsFalse(pb.HasRootOperator());
     Assert.IsFalse(pb.HasExtension());
     Assert.IsFalse(pb.HasTrailingSlash(ignoreRoot:true));
     Assert.IsTrue(pb.IsValidAbsolutePath());
 }
 public void HasTrailingSlashWorks()
 {
     var pb = new VirtualPathBuilder().CombineWith("/").Normalize();
     Assert.IsTrue(pb.HasTrailingSlash());
     Assert.IsFalse(pb.HasTrailingSlash(true));
     pb.Clear().CombineWith("/foo/");
     Assert.IsTrue(pb.HasTrailingSlash());
     pb.Clear().CombineWith("/foo");
     Assert.IsFalse(pb.HasTrailingSlash());
 }