Example #1
0
        public void load_should_cache_configuration_for_next_call()
        {
            // given
            var            store  = new JsonConfigurationStore(_configLocatorMock.Object);
            IConfiguration config = store.Load();

            string newConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "configuration-storetests.json");

            CopyConfigFile(newConfigPath);
            ChangeConfigFile(newConfigPath);

            // when
            IConfiguration config2 = store.Load();

            // then
            Assert.That(config, Is.EqualTo(config2));
        }
Example #2
0
        public void load_should_resolve_relative_config_file()
        {
            // given
            string expectedTestDirPath     = new DirectoryInfo("..\\..\\..\\..\\Example-TestFiles").FullName;
            string expectedSnippetsDirPath = new DirectoryInfo("..\\..\\..\\..\\Example-TestFiles\\ScriptSnippets").FullName;

            var store = new JsonConfigurationStore(_configLocatorMock.Object);

            // when
            IConfiguration config = store.Load();

            // then
            Assert.That(config.TestFilesBaseDirectory, Is.EqualTo(expectedTestDirPath));
            Assert.That(config.ScriptSnippetDirectory, Is.EqualTo(expectedSnippetsDirPath));
        }