Esempio n. 1
0
 public void FailTest3()
 {
     Assert.That(() => TestSettingsLoader.GetSettingsLoader()
                 .Create <FileInfo>(nameof(SimpleSettings.Uri)),
                 Throws.Exception.TypeOf <SettingsException>()
                 .With.Message.EqualTo(string.Format(Resources.CreateErrorFormat, typeof(FileInfo), nameof(SimpleSettings.Uri))));
 }
Esempio n. 2
0
        public void ArrayTest()
        {
            var settingsLoader = TestSettingsLoader.GetSettingsLoader();

            // Important for test that current directory is the test project folder
            Directory.SetCurrentDirectory(TestProjectFolder);

            var settings = settingsLoader.CreateArray <DirectoryInfo>("DirectoryArray");

            // Defaults
            Assert.That(settings.Length, Is.EqualTo(3));
            Assert.That(settings[0].FullName, Is.EqualTo(Path.Combine(TestProjectFolder, "TestFolder")));
            Assert.That(settings[1].FullName, Is.EqualTo(Path.GetFullPath(Path.Combine(TestProjectFolder, ".."))));
            Assert.That(settings[2].FullName, Is.EqualTo("c:\\Windows"));
        }
Esempio n. 3
0
 public DirectoryInfoLoadTests()
     : base(TestSettingsLoader.GetSettingsLoader())
 {
 }
Esempio n. 4
0
 public LoadTests()
     : base(TestSettingsLoader
            .GetSettingsLoader()
            .AddProvider(new EnvironmentValueProvider()))
 {
 }
 public LoadFailTests()
     : base(TestSettingsLoader.GetSettingsLoader())
 {
 }
Esempio n. 6
0
 public FileInfoLoadTests()
     : base(TestSettingsLoader.GetSettingsLoader())
 {
 }