namespace VirtualFS.Tests { [TestClass] public class PathTests { [TestMethod] public virtual void TestPathCast() { Path p = "/test/path"; Assert.IsNotNull(p); Assert.AreEqual("/test/path", (string)p); } [TestMethod] public virtual void TestPathDirectoryNotDirectory() { Assert.IsFalse(((Path)"/test/path").IsDirectory == ((Path)"/test/path/").IsDirectory); } [TestMethod] public virtual void TestPathAddPath() { Assert.AreEqual((Path)"/test/path/SomeFile.txt", ((Path)"/test/path/") + "SomeFile.txt"); } [TestMethod] public virtual void TestPathExt() { Assert.AreEqual("txt", ((Path)"/test/path/SomeFile.txt").GetExtension()); } [TestMethod] public virtual void TestPathParent() { Assert.IsNull(new Path().Parent); Assert.AreEqual(new Path(), ((Path)"/test/").Parent); Assert.AreEqual((Path)"/test/", ((Path)"/test/path/").Parent); } [TestMethod] public virtual void TestInvalidPath() { Assert.ThrowsException(() => new Path("test")); } } }