예제 #1
0
        public void Resolve_FindsManuallyRegistered()
        {
            string sectionName   = "ManualRegistration";
            var    manualSection = new MockFailureSection();

            FailureHandlerConfigurationSectionLocator.Register(sectionName, manualSection);

            Assert.Same(manualSection, FailureHandlerConfigurationSectionLocator.Resolve(sectionName));
        }
예제 #2
0
 public void Resolve_ThrowsOnMissingConfigurationSection()
 {
     Assert.Throws <ArgumentException>(() => FailureHandlerConfigurationSectionLocator.Resolve("NonExistantSection"));
 }
예제 #3
0
 public void Resolve_ReturnsNullOnNullConfigurationSectionName()
 {
     Assert.Null(FailureHandlerConfigurationSectionLocator.Resolve(null));
 }
예제 #4
0
 public void Register_PreventsDuplicateRegistrationsByName()
 {
     FailureHandlerConfigurationSectionLocator.Register("Duplicate", A.Fake <IFailureHandlerConfiguration>());
     Assert.Throws <ArgumentException>(() => FailureHandlerConfigurationSectionLocator.Register("Duplicate", A.Fake <IFailureHandlerConfiguration>()));
 }
예제 #5
0
 public void Register_ThrowsOnNullConfiguration()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           FailureHandlerConfigurationSectionLocator.Register("Test", null));
 }
예제 #6
0
 public void Register_ThrowsOnEmptyName()
 {
     Assert.Throws <ArgumentException>(() =>
                                       FailureHandlerConfigurationSectionLocator.Register(string.Empty, A.Fake <IFailureHandlerConfiguration>()));
 }
예제 #7
0
 public void Register_ThrowsOnNullName()
 {
     Assert.Throws <ArgumentNullException>(() =>
                                           FailureHandlerConfigurationSectionLocator.Register(null, A.Fake <IFailureHandlerConfiguration>()));
 }