public void GetList_Parses_List_From_Setting() { var appSettings = new AppSettingsParser(new FakeAppSettings()); var value = appSettings.GetList("ListKey"); Assert.That(value, Has.Count.EqualTo(5)); Assert.That(value, Is.EqualTo(new List<string> {"A", "B", "C", "D", "E"})); }
public void GetList_Throws_Exception_On_Null_Key() { var appSettings = new AppSettingsParser(new FakeAppSettings()); try { appSettings.GetList("GarbageKey"); Assert.Fail("GetList did not throw a ConfigurationErrorsException"); } catch (ConfigurationErrorsException ex) { Assert.That(ex.Message.Contains("GarbageKey")); } }