コード例 #1
0
        public void BeforeAll()
        {
            var notificationService = MockRepository.GenerateStub<AmazonSimpleNotificationService>();
            notificationService
                .Stub(s => s.Publish(Arg<PublishRequest>.Is.Anything))
                .WhenCalled(p => SentRequests.Add((PublishRequest) p.Arguments[0]));

            var appender = new AmazonSimpleNotificationServiceAppender()
                               {
                                   NotificationService = notificationService,
                                   Layout = new PatternLayout("%message")
                               };

            LogMessage = "Testing 123";
            var loggingEventData = new LoggingEventData {Message = this.LogMessage};
            var loggingEvent = new LoggingEvent(loggingEventData);

            appender.DoAppend(loggingEvent);
        }
コード例 #2
0
        public void BeforeAll()
        {
            var notificationService = MockRepository.GenerateStub <AmazonSimpleNotificationService>();

            notificationService
            .Stub(s => s.Publish(Arg <PublishRequest> .Is.Anything))
            .WhenCalled(p => SentRequests.Add((PublishRequest)p.Arguments[0]));

            var appender = new AmazonSimpleNotificationServiceAppender()
            {
                NotificationService = notificationService,
                Layout = new PatternLayout("%message")
            };

            LogMessage = "Testing 123";
            var loggingEventData = new LoggingEventData {
                Message = this.LogMessage
            };
            var loggingEvent = new LoggingEvent(loggingEventData);

            appender.DoAppend(loggingEvent);
        }