예제 #1
0
        public void FileNameComparer_Equals_ReturnsTrueForEqualFiles()
        {
            var comparer = new FileNameComparer();

            Assert.True(comparer.Equals(@"aa.txt", @"aa.txt"));
            Assert.True(comparer.Equals(@"./aa.txt", @"./aa/../aa.txt"));  // Path.GetFullPath can properly normalize path on linux only if it contains forward slashes. On Windows, any slashes work fine.
        }
예제 #2
0
        public void FileNameComparer_Equals_ReturnsTrueForEqualFiles()
        {
            var comparer = new FileNameComparer();

            Assert.IsTrue(comparer.Equals(@"aa.txt", @"aa.txt"));
            Assert.IsTrue(comparer.Equals(@".\aa.txt", @".\aa\..\aa.txt"));
        }
예제 #3
0
        public void FileNameComparer_Equals_ReturnsTrueIfBothEmpty()
        {
            var comparer = new FileNameComparer();

            Assert.True(comparer.Equals("", ""));
            Assert.True(comparer.Equals(" ", ""));
            Assert.True(comparer.Equals("", " "));
            Assert.True(comparer.Equals(null, ""));
            Assert.True(comparer.Equals("", null));
            Assert.False(comparer.Equals("", "something"));
            Assert.False(comparer.Equals("something", ""));
        }
예제 #4
0
        public void FileNameComparer_Equals_IsCaseInsensitive()
        {
            var comparer = new FileNameComparer();

            Assert.True(comparer.Equals(@"aa.txt", @"AA.txt"));
        }