Ejemplo n.º 1
0
        public void GivenDefaultConstructionShouldNotThrow()
        {
            CastleProxy <IQuestion> castleProxy = new CastleProxy <IQuestion>();

            Action action = () =>
            {
                IQuestion question = castleProxy.Interceptor(new Default());
                question.String(1);
            };

            action.ShouldNotThrow();
        }
Ejemplo n.º 2
0
        public void ShouldIntercept()
        {
            //arrange
            FakePerformanceMonitor  fakePerformanceMonitor = new FakePerformanceMonitor();
            CastleProxy <IQuestion> castleProxy            = new CastleProxy <IQuestion>(fakePerformanceMonitor);

            //act
            IQuestion question = castleProxy.Interceptor(new Default());

            question.String(1);

            //assert
            fakePerformanceMonitor.AssertInvoked();
        }
 public FizzBuzzCastleController(CastleProxy <IQuestion> castleProxy) :
     this(castleProxy.Interceptor(new FizzBuzz(castleProxy.Interceptor(new Buzz(castleProxy.Interceptor(new Fizz(castleProxy.Interceptor(new Default()))))))))
 {
 }