Пример #1
0
            public void ShouldExecuteLogginOnCustomLoggerWithData()
            {
                //Arrange
                var fakeLogger = A.Fake<ILogger>();
                var notifier = new LogNotifier(fakeLogger);
                var violationData = TestDataFactory.CreateViolationData();

                //Act
                notifier.Notify(violationData);

                //Assert
                A.CallTo(() => fakeLogger.LogViolation(violationData)).MustHaveHappened();
            }
Пример #2
0
            public void ShouldExecuteLoggingOnCustomLoggerOnlyOnce()
            {
                //Arrange
                var fakeLogger = A.Fake<ILogger>();
                var notifier = new LogNotifier(fakeLogger);
                var violationData = TestDataFactory.CreateViolationData();

                //Act
                notifier.Notify(violationData);

                //Assert
                A.CallTo(() => fakeLogger.LogViolation(null)).WithAnyArguments().MustHaveHappened(Repeated.Exactly.Once);
            }
Пример #3
0
            public void ShouldExecuteLoggingOnCustomLoggerOnlyOnce()
            {
                //Arrange
                var fakeLogger    = A.Fake <ILogger>();
                var notifier      = new LogNotifier(fakeLogger);
                var violationData = TestDataFactory.CreateViolationData();


                //Act
                notifier.Notify(violationData);


                //Assert
                A.CallTo(() => fakeLogger.LogViolation(null)).WithAnyArguments().MustHaveHappened(Repeated.Exactly.Once);
            }
Пример #4
0
            public void ShouldExecuteLogginOnCustomLoggerWithData()
            {
                //Arrange
                var fakeLogger    = A.Fake <ILogger>();
                var notifier      = new LogNotifier(fakeLogger);
                var violationData = TestDataFactory.CreateViolationData();


                //Act
                notifier.Notify(violationData);


                //Assert
                A.CallTo(() => fakeLogger.LogViolation(violationData)).MustHaveHappened();
            }