Esempio n. 1
0
            public void ShouldReturnTargetPathIfProvidersDontMatch()
            {
                // Given
                DirectoryPath sourcePath = new DirectoryPath("foo:///A/B");
                FilePath targetPath = new FilePath("bar", "/A/B/C/test.txt");

                // When
                FilePath resultPath = RelativePathResolver.Resolve(sourcePath, targetPath);

                // Then
                // Assert.AreEqual(targetPath, resultPath); // Uncomment and use this when NUnit is fixed
                Assert.IsTrue(targetPath.Equals(resultPath)); // Workaround for bug in NUnit with explicitly implemented interface method IEquality.Equals()
            }
Esempio n. 2
0
            public void SamePathsWithDifferentProvidersAreNotConsideredEqual()
            {
                // Given, When
                FilePath first = new FilePath(new Uri("foo:///"), "/shaders/basic.vert");
                FilePath second = new FilePath(new Uri("bar:///"), "/shaders/basic.vert");

                // Then
                Assert.False(first.Equals(second));
                Assert.False(second.Equals(first));
            }
Esempio n. 3
0
            public void SamePathsButDifferentCasingAreNotConsideredEqual()
            {
                // Given, When
                FilePath first = new FilePath("shaders/basic.vert");
                FilePath second = new FilePath("SHADERS/BASIC.VERT");

                // Then
                Assert.False(first.Equals(second));
                Assert.False(second.Equals(first));
            }
Esempio n. 4
0
            public void DifferentPathsAreNotConsideredEqual()
            {
                // Given, When
                FilePath first = new FilePath("shaders/basic.vert");
                FilePath second = new FilePath("shaders/basic.frag");

                // Then
                Assert.False(first.Equals(second));
                Assert.False(second.Equals(first));
            }
Esempio n. 5
0
            public void SamePathsAreConsideredEqual(bool isCaseSensitive)
            {
                // Given, When
                FilePath first = new FilePath("shaders/basic.vert");
                FilePath second = new FilePath("shaders/basic.vert");

                // Then
                Assert.True(first.Equals(second));
                Assert.True(second.Equals(first));
            }
Esempio n. 6
0
            public void SameAssetInstancesIsConsideredEqual(bool isCaseSensitive)
            {
                // Given, When
                FilePath path = new FilePath("shaders/basic.vert");

                // Then
                Assert.True(path.Equals(path));
            }