Esempio n. 1
0
        public void PathCasingIsRestored()
        {
            // Arrange

            var runningDir = AppDomain.CurrentDomain.BaseDirectory;

            var relativePath = Path.Combine(
                "TestingData",
                "PathCasingRestorerTestFile.txt");

            var fullName  = Path.Combine(runningDir, relativePath);
            var lowerCase = fullName.ToLowerInvariant();

            var restorer = new PathCasingRestorer();

            // Act

            // Full name is converted to be entirely lower case; this should be
            // corrected by the call to RestoreCasing
            var output = restorer.RestoreCasing(lowerCase);

            // Assert

            // String comparison is case sensitive; only assert that casing is
            // correct on the relative path so the test is not affect by
            // relocating the project
            Assert.That(output, Contains.Substring(relativePath));
        }
Esempio n. 2
0
        public void FirstCharIsUpperCase()
        {
            // Arrange

            var runningDir = AppDomain.CurrentDomain.BaseDirectory;

            var relativePath = Path.Combine(
                "TestingData",
                "PathCasingRestorerTestFile.txt");

            var fullName = Path.Combine(runningDir, relativePath);

            var restorer = new PathCasingRestorer();

            // Act

            var output = restorer.RestoreCasing(fullName);

            // Assert

            var isUpperCase = char.IsUpper(output[0]);

            Assert.IsTrue(isUpperCase);
        }