Пример #1
0
 public void AddOrReplaceExtensionWorks()
 {
     var pb = new VirtualPathBuilder().CombineWith("~/t.cs");
     Assert.IsTrue(pb.GetExtension() == "cs");
     pb.AddOrReplaceExtension("vb");
     Assert.IsTrue(pb.GetExtension() == "vb");
     pb.Clear().CombineWith("foo");
     Assert.IsFalse(pb.HasExtension());
     pb.AddOrReplaceExtension("vb");
     Assert.IsTrue(pb.GetExtension() == "vb");
 }
Пример #2
0
 public void GetExtensionWorks()
 {
     var pb = new VirtualPathBuilder().CombineWith(".");
     Assert.IsTrue(pb == ".");
     Assert.IsFalse(pb.HasExtension());
     Assert.IsNull(pb.GetExtension());
     pb.Clear().CombineWith("~/oops.cshtml");
     Assert.IsTrue(pb.HasExtension());
     pb.Normalize();
     Assert.IsTrue(pb.HasExtension());
     Assert.IsTrue(pb.GetExtension() == "cshtml");
     Assert.IsTrue(pb.HasExtension());
     Assert.IsTrue(pb.GetExtension(true) == "cshtml");
     Assert.IsFalse(pb.HasExtension());
 }
Пример #3
0
 public void RemoveExtensionWorks()
 {
     var pb = new VirtualPathBuilder();
     pb.RemoveExtension();
     pb.CombineWith("oops.cs");
     Assert.IsTrue(pb.GetExtension() == "cs");
     pb.RemoveExtension();
     Assert.IsNull(pb.GetExtension());
 }