Example #1
0
        public void TestEquals()
        {
            var pathInfo = new UPath("x");

            Assert.False(pathInfo.Equals((object)"no"));
            Assert.False(pathInfo.Equals(null));
        }
Example #2
0
        public void TestNormalize(string pathAsText, string expectedResult)
        {
            var path = new UPath(pathAsText);

            Assert.Equal(expectedResult, path.FullName);

            // Check Equatable
            var expectedPath = new UPath(expectedResult);

            Assert.Equal(expectedPath, path);
            Assert.True(expectedPath.Equals((object)path));
            Assert.Equal(expectedPath.GetHashCode(), path.GetHashCode());
            Assert.True(path == expectedPath);
            Assert.False(path != expectedPath);

            // Check TryParse
            UPath result;

            Assert.True(UPath.TryParse(path.FullName, out result));
        }