예제 #1
0
        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 Setup()
        {
            _logFake = new LogFake();

            UnityInterception.PerformanceMonitor performanceMonitor = new UnityInterception.PerformanceMonitor(_logFake);

            IQuestion defaultQuestion  = Intercept.ThroughProxy <IQuestion>(new Default(), new InterfaceInterceptor(), new IInterceptionBehavior[] { performanceMonitor });
            IQuestion fizzQuestion     = Intercept.ThroughProxy <IQuestion>(new Fizz(defaultQuestion), new InterfaceInterceptor(), new IInterceptionBehavior[] { performanceMonitor });
            IQuestion buzzQuestion     = Intercept.ThroughProxy <IQuestion>(new Buzz(fizzQuestion), new InterfaceInterceptor(), new IInterceptionBehavior[] { performanceMonitor });
            IQuestion fizzBuzzQuestion = Intercept.ThroughProxy <IQuestion>(new Questions.FizzBuzz(buzzQuestion), new InterfaceInterceptor(), new IInterceptionBehavior[] { performanceMonitor });

            _fizzBuzzController = Intercept.ThroughProxy <IFizzBuzzController>(
                new FizzBuzzUnityController(fizzBuzzQuestion),
                new InterfaceInterceptor(),
                new IInterceptionBehavior[]
            {
                new UnityInterception.PerformanceMonitor(_logFake)
            });
        }
예제 #3
0
 public void Setup()
 {
     _logFake = new LogFake();
     _logger  = new Logger(_logFake);
 }
        public void Setup()
        {
            _logFake = new LogFake();

            _fizzBuzzController = new FizzBuzzCastleController(new CastleProxy <IQuestion>(_logFake));
        }