Пример #1
0
        public void GetString_Returns_Value()
        {
            var appSettings = new AppSettingsParser(new FakeAppSettings());
            var value = appSettings.GetString("RealKey");

            Assert.That(value, Is.EqualTo("This is a real value"));
        }
Пример #2
0
 public void GetString_Throws_Exception_On_Nonexistent_Key()
 {
     var appSettings = new AppSettingsParser(new FakeAppSettings());
     try
     {
         appSettings.GetString("GarbageKey");
         Assert.Fail("GetString did not throw a ConfigurationErrorsException");
     }
     catch (ConfigurationErrorsException ex)
     {
         Assert.That(ex.Message.Contains("GarbageKey"));
     }
 }