Exemple #1
0
        public void When_loading_just_one_file_with_no_override_Then_works()
        {
            var result = FlexibleConfiguration.Load(false, "../../Configuration/External.config");

            Assert.That(result.AppSettings, Has.Count.EqualTo(2));
            Assert.That(result.AppSettings["Setting1"], Is.EqualTo("Setting1Value"));
            Assert.That(result.AppSettings["Setting2"], Is.EqualTo("Setting2Value"));

            Assert.That(result.ConnectionStrings, Has.Count.EqualTo(1));
            Assert.That(result.ConnectionStrings["String1"], Is.EqualTo(new ConnectionStringSettings("String1", "Data Source=String1.s3db;", "System.Data.SQLite")));
        }
Exemple #2
0
        public void When_loading_two_files_Then_works()
        {
            var result = FlexibleConfiguration.Load(false, "../../Configuration/External.config", "../../Configuration/External2.config");

            Assert.That(result.AppSettings, Has.Count.EqualTo(3));
            Assert.That(result.AppSettings["Setting1"], Is.EqualTo("Setting1Value"));
            Assert.That(result.AppSettings["Setting2"], Is.EqualTo("Setting2ValueExternal2"));
            Assert.That(result.AppSettings["Setting3"], Is.EqualTo("Setting3Value"));

            Assert.That(result.ConnectionStrings, Has.Count.EqualTo(2));
            Assert.That(result.ConnectionStrings["String1"], Is.EqualTo(new ConnectionStringSettings("String1", "Data Source=String1External2.s3db;", "System.Data.SQLite")));
            Assert.That(result.ConnectionStrings["String2"], Is.EqualTo(new ConnectionStringSettings("String2", "Data Source=String2.s3db;", "System.Data.SQLite")));
        }
Exemple #3
0
 public void When_loading_empty_file_Then_works()
 {
     FlexibleConfiguration.Load(false, "../../Configuration/External3.config");
 }