public void List_Load_should_throw_exception_for_empty_list_when_shouldAllowEmptyList_is_false() { AssertExceptionThrown .OfType <ConfigurationErrorsException>() .WithMessage("Error loading from the \"EmptyBars\" section of the .config file: Item count = zero.") .WhenExecuting(() => ConfigurationSectionListDeserializer.Load <Bar>("EmptyBars", shouldAllowEmptyList: false)); }
public void List_Load_should_throw_ConfigurationErrorsException_when_section_is_not_found_and_shouldThrowExceptionIfSectionNotFound_is_true() { AssertExceptionThrown .OfType <ConfigurationErrorsException>() .WithMessage("Error loading from the \"Barx\" section of the .config file:" + " Section not found.") .WhenExecuting(() => ConfigurationSectionListDeserializer.Load <Bar>("Barx", shouldThrowExceptionIfSectionNotFound: true)); }
public void List_Load_should_not_throw_ConfigurationErrorsException_when_section_is_not_found_and_shouldThrowExceptionIfSectionNotFound_is_false() { IList <Bar> bars = ConfigurationSectionListDeserializer.Load <Bar>( "Barx", shouldThrowExceptionIfSectionNotFound: false, shouldAllowEmptyList: true); Assert.IsNull(bars); }
public void DependencyProvider_method_should_work() { var provider = ConfigurationSectionListDeserializer.DependencyProvider <Bar>("Bars"); AssertBarList(provider.GetValue()); }
public void List_Load_should_not_throw_exception_for_empty_list_when_shouldAllowEmptyList_is_true() { IList <Bar> bars = ConfigurationSectionListDeserializer.Load <Bar>("EmptyBars", shouldAllowEmptyList: true); Assert.AreEqual(0, bars.Count); }
public void List_Load_should_work() { IList <Bar> bars = ConfigurationSectionListDeserializer.Load <Bar>("Bars"); AssertBarList(bars); }