コード例 #1
0
 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());
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 public void IsRelativePathWorks()
 {
     var pb = new VirtualPathBuilder();
     Assert.IsFalse(pb.IsRelativePath());
     pb.CombineWith(".");
     Assert.IsTrue(pb.IsRelativePath());
     pb.Clear().CombineWith("Foo");
     Assert.IsTrue(pb.IsRelativePath());
     pb.Normalize();
     Assert.IsFalse(pb.IsRelativePath());
     Assert.IsTrue(pb.IsAbsolutePath());
 }