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(); }
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); }
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); }
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(); }