public void Resolve_FindsManuallyRegistered() { string sectionName = "ManualRegistration"; var manualSection = new MockFailureSection(); FailureHandlerConfigurationSectionLocator.Register(sectionName, manualSection); Assert.Same(manualSection, FailureHandlerConfigurationSectionLocator.Resolve(sectionName)); }
public void Resolve_ThrowsOnMissingConfigurationSection() { Assert.Throws <ArgumentException>(() => FailureHandlerConfigurationSectionLocator.Resolve("NonExistantSection")); }
public void Resolve_ReturnsNullOnNullConfigurationSectionName() { Assert.Null(FailureHandlerConfigurationSectionLocator.Resolve(null)); }
public void Register_PreventsDuplicateRegistrationsByName() { FailureHandlerConfigurationSectionLocator.Register("Duplicate", A.Fake <IFailureHandlerConfiguration>()); Assert.Throws <ArgumentException>(() => FailureHandlerConfigurationSectionLocator.Register("Duplicate", A.Fake <IFailureHandlerConfiguration>())); }
public void Register_ThrowsOnNullConfiguration() { Assert.Throws <ArgumentNullException>(() => FailureHandlerConfigurationSectionLocator.Register("Test", null)); }
public void Register_ThrowsOnEmptyName() { Assert.Throws <ArgumentException>(() => FailureHandlerConfigurationSectionLocator.Register(string.Empty, A.Fake <IFailureHandlerConfiguration>())); }
public void Register_ThrowsOnNullName() { Assert.Throws <ArgumentNullException>(() => FailureHandlerConfigurationSectionLocator.Register(null, A.Fake <IFailureHandlerConfiguration>())); }