Beispiel #1
0
        public void ReturnsTypeRegistrationForLoggingHandlerData()
        {
            var handlerData = new LoggingExceptionHandlerData(
                handlerName111, handlerCategory111, 100, TraceEventType.Information, handlerMessage111,
                typeof(ExceptionFormatter), 101);

            var registration = handlerData.GetRegistrations("prefix").First();

            registration.AssertForServiceType(typeof(IExceptionHandler))
            .ForName("prefix." + handlerName111)
            .ForImplementationType(typeof(LoggingExceptionHandler));



            registration.AssertConstructor()
            .WithValueConstructorParameter(handlerCategory111)
            .WithValueConstructorParameter(100)
            .WithValueConstructorParameter(TraceEventType.Information)
            .WithValueConstructorParameter(handlerMessage111)
            .WithValueConstructorParameter(101)
            .WithValueConstructorParameter(typeof(ExceptionFormatter))
            .WithContainerResolvedParameter <LogWriter>(null)
            .VerifyConstructorParameters();
        }
 protected override void Act()
 {
     registrations = configuration.GetRegistrations("");
 }
        public void ReturnsTypeRegistrationForLoggingHandlerData()
        {
            var handlerData = new LoggingExceptionHandlerData(
                handlerName111, handlerCategory111, 100, TraceEventType.Information, handlerMessage111,
                typeof (ExceptionFormatter), 101);

            var registration = handlerData.GetRegistrations("prefix").First();

            registration.AssertForServiceType(typeof(IExceptionHandler))
                .ForName("prefix." + handlerName111)
                .ForImplementationType(typeof (LoggingExceptionHandler));



            registration.AssertConstructor()
                .WithValueConstructorParameter(handlerCategory111)
                .WithValueConstructorParameter(100)
                .WithValueConstructorParameter(TraceEventType.Information)
                .WithValueConstructorParameter(handlerMessage111)
                .WithValueConstructorParameter(101)
                .WithValueConstructorParameter(typeof(ExceptionFormatter))                
                .WithContainerResolvedParameter<LogWriter>(null)
                .VerifyConstructorParameters();
        }