Beispiel #1
0
        public void FileExtensionIsProper()
        {
            var path = new FilePath("asdf.txt");

            Assert.AreEqual("asdf.txt", path.FileName);
            Assert.IsTrue(path.HasExtension(".txt"));
            Assert.AreEqual(".txt", path.Extension);
            Assert.AreEqual("asdf", path.FileNameWithoutExtension);

            path = new FilePath(".gitignore");
            Assert.False(path.HasExtension(".gitignore"));
            Assert.AreEqual(".gitignore", path.FileName);
            Assert.AreEqual(".gitignore", path.Extension);
            Assert.AreEqual("", path.FileNameWithoutExtension);
        }
Beispiel #2
0
        public void FileExtensionIsProper()
        {
            var path = new FilePath("asdf.txt");

            Assert.AreEqual("asdf.txt", path.FileName);
            Assert.IsTrue(path.HasExtension(".txt"));
            Assert.AreEqual(FilePath.PathComparison == StringComparison.OrdinalIgnoreCase, path.HasExtension(".TXT"));
            Assert.AreEqual(".txt", path.Extension);
            Assert.AreEqual("asdf", path.FileNameWithoutExtension);

            path = new FilePath(".gitignore");
            Assert.False(path.HasExtension(".gitignore"));
            Assert.AreEqual(".gitignore", path.FileName);
            Assert.AreEqual(".gitignore", path.Extension);
            Assert.AreEqual("", path.FileNameWithoutExtension);
        }