private FizzBuzzUnityController(UnityProxy <IQuestion> unityProxy) : this(unityProxy.Intercept( new FizzBuzz(unityProxy.Intercept( new Buzz(unityProxy.Intercept( new Fizz(unityProxy.Intercept( new Default()) ))))))) { }
public void GivenRealPerformanceMonitorShouldInterceptAndLogEntry() { LogFake logFake = new LogFake(); UnityProxy <IQuestion> unityProxy = new UnityProxy <IQuestion>(new PerformanceMonitor(logFake)); IQuestion question = unityProxy.Intercept(new AopUnityFizzBuzzSpike.Questions.FizzBuzz()); question.String(1); logFake.LogEntries.Count.Should().Be(1); }
public void GivenRealPerformanceMonitorShouldNotThrow() { UnityProxy <IQuestion> unityProxy = new UnityProxy <IQuestion>(); Action action = () => { IQuestion question = unityProxy.Intercept(new AopUnityFizzBuzzSpike.Questions.FizzBuzz()); question.String(1); }; action.ShouldNotThrow(); }
public void GivenRealPerformanceMonitorWithApplicationInsightsLogShouldInterceptAndNotThrow() { UnityProxy <IQuestion> unityProxy = new UnityProxy <IQuestion>(new PerformanceMonitor(new ApplicationInsightsLog())); Action action = () => { IQuestion question = unityProxy.Intercept(new AopUnityFizzBuzzSpike.Questions.FizzBuzz()); question.String(1); }; action.ShouldNotThrow(); }
public void ShouldIntercept() { //arrange FakePerformanceMonitor fakePerformanceMonitor = new FakePerformanceMonitor(); UnityProxy <IQuestion> unityProxy = new UnityProxy <IQuestion>(fakePerformanceMonitor); //act IQuestion question = unityProxy.Intercept(new AopUnityFizzBuzzSpike.Questions.FizzBuzz()); question.String(1); //assert fakePerformanceMonitor.AssertInvoked(); }