Beispiel #1
0
        public void Test_FileExtension()
        {
            FilePath filePath = new FilePathRelative(@".\File.txt");

            Assert.IsTrue(filePath.FileExtension == @".txt");
            Assert.IsTrue(filePath.HasExtension(@".txt"));
            Assert.IsTrue(filePath.HasExtension(@".TxT"));
            Assert.IsTrue(filePath.HasExtension(@".TXT"));

            filePath = new FilePathRelative(@".\File");
            Assert.IsTrue(filePath.FileExtension == string.Empty);

            filePath = new FilePathRelative(@".\File.");
            Assert.IsTrue(filePath.FileExtension == string.Empty);

            filePath = new FilePathAbsolute(@"C:\dir1\\//dir2\File.txt.Exe");
            Assert.IsTrue(filePath.FileExtension == @".Exe");
            Assert.IsTrue(filePath.HasExtension(@".exe"));
        }
Beispiel #2
0
        public void Test_HasExtensionError3()
        {
            FilePath filePath = new FilePathRelative(@".\File.");

            Assert.IsTrue(filePath.HasExtension("."));
        }
Beispiel #3
0
        public void Test_HasExtensionError1()
        {
            FilePath filePath = new FilePathRelative(@".\File");

            Assert.IsTrue(filePath.HasExtension(string.Empty));
        }
Beispiel #4
0
 public void Test_HasExtensionError3()
 {
     FilePath filePath = new FilePathRelative(@".\File.");
      Assert.IsTrue(filePath.HasExtension("."));
 }
Beispiel #5
0
 public void Test_HasExtensionError1()
 {
     FilePath filePath = new FilePathRelative(@".\File");
      Assert.IsTrue(filePath.HasExtension(string.Empty));
 }
Beispiel #6
0
        public void Test_FileExtension()
        {
            FilePath filePath = new FilePathRelative(@".\File.txt");
             Assert.IsTrue(filePath.FileExtension == @".txt");
             Assert.IsTrue(filePath.HasExtension(@".txt"));
             Assert.IsTrue(filePath.HasExtension(@".TxT"));
             Assert.IsTrue(filePath.HasExtension(@".TXT"));

             filePath = new FilePathRelative(@".\File");
             Assert.IsTrue(filePath.FileExtension == string.Empty);

             filePath = new FilePathRelative(@".\File.");
             Assert.IsTrue(filePath.FileExtension == string.Empty);

             filePath = new FilePathAbsolute(@"C:\dir1\\//dir2\File.txt.Exe");
             Assert.IsTrue(filePath.FileExtension == @".Exe");
             Assert.IsTrue(filePath.HasExtension(@".exe"));
        }