示例#1
0
        public void Should_not_modify_passed_absolute_path()
        {
            ConfigurationRepositoryAbsoltePathTester reposiotryUnderTest = new ConfigurationRepositoryAbsoltePathTester();
            string configurationFile = "D:\\Configs\\NConfigTest.config";

            string absolutePath = reposiotryUnderTest.TestToAbsolutePath(configurationFile);

            Assert.That(absolutePath, Is.EqualTo(configurationFile));
        }
        public void Should_not_modify_passed_absolute_path()
        {
            ConfigurationRepositoryAbsoltePathTester reposiotryUnderTest = new ConfigurationRepositoryAbsoltePathTester();
            string configurationFile = "D:\\Configs\\NConfigTest.config";

            string absolutePath = reposiotryUnderTest.TestToAbsolutePath(configurationFile);

            Assert.That(absolutePath, Is.EqualTo(configurationFile));
        }
        public void Should_convert_passed_relative_paths_to_absolute_correctly()
        {
            ConfigurationRepositoryAbsoltePathTester reposiotryUnderTest = new ConfigurationRepositoryAbsoltePathTester();
            string configurationFile = "Configs\\NConfigTest.config";

            string validPath = AppDomain.CurrentDomain.BaseDirectory;
            validPath = Path.Combine(Path.GetDirectoryName(validPath), "Debug\\" + configurationFile);

            string absolutePath = reposiotryUnderTest.TestToAbsolutePath(configurationFile);

            Assert.That(absolutePath, Is.EqualTo(validPath));
        }
示例#4
0
        public void Should_convert_passed_relative_paths_to_absolute_correctly()
        {
            ConfigurationRepositoryAbsoltePathTester reposiotryUnderTest = new ConfigurationRepositoryAbsoltePathTester();
            string configurationFile = "Configs\\NConfigTest.config";

            string validPath = AppDomain.CurrentDomain.BaseDirectory;

            validPath = Path.Combine(Path.GetDirectoryName(validPath), "Debug\\" + configurationFile);

            string absolutePath = reposiotryUnderTest.TestToAbsolutePath(configurationFile);

            Assert.That(absolutePath, Is.EqualTo(validPath));
        }