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)))); }
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")); }
public DirectoryInfoLoadTests() : base(TestSettingsLoader.GetSettingsLoader()) { }
public LoadTests() : base(TestSettingsLoader .GetSettingsLoader() .AddProvider(new EnvironmentValueProvider())) { }
public LoadFailTests() : base(TestSettingsLoader.GetSettingsLoader()) { }
public FileInfoLoadTests() : base(TestSettingsLoader.GetSettingsLoader()) { }