Example #1
0
        protected override void beforeEach()
        {
            theCache = new StubOutputCache(MockFor <IRecordedOutput>())
            {
                CacheHits = false
            };
            Services.Inject <IOutputCache>(theCache);


            theDescription = new Dictionary <string, string>();
            MockFor <IResourceHash>().Stub(x => x.Describe()).Return(theDescription);
            MockFor <IResourceHash>().Stub(x => x.CreateHash())
            .Return(theResource);


            theLogger = MockFor <ILogger>();
            Services.Inject <ILogger>(new InteractionContextLogger(theLogger));

            Services.PartialMockTheClassUnderTest();
            theGeneratedOutput = new RecordedOutput(null);



            ClassUnderTest.Expect(x => x.CreateOutput(theResource, null)).Constraints(Is.Same(theResource), Is.Anything())
            .Return(theGeneratedOutput);



            ClassUnderTest.Inner = MockFor <IActionBehavior>();
            ClassUnderTest.Invoke();
        }
Example #2
0
 public void Replay(IRecordedOutput output)
 {
     // We're routing the replay thru IOutputWriter to
     // make unit testing easier, I think it gives a cleaner
     // dependency graph, and it makes request tracing work.
     output.Replay(Writer);
 }
Example #3
0
 public void Replay(IRecordedOutput output)
 {
     // We're routing the replay thru IOutputWriter to
     // make unit testing easier, I think it gives a cleaner
     // dependency graph, and it makes request tracing work.
     output.Replay(Writer);
 }
Example #4
0
        public void Replay(IRecordedOutput output)
        {
            _logger.DebugMessage(() => new ReplayRecordedOutput(output));

            // We're routing the replay thru IOutputWriter to
            // make unit testing easier, I think it gives a cleaner
            // dependency graph, and it makes request tracing work.
            output.Replay(Writer);
        }
Example #5
0
        public void Replay(IRecordedOutput output)
        {
            _logger.DebugMessage(() => new ReplayRecordedOutput(output));

            // We're routing the replay thru IOutputWriter to 
            // make unit testing easier, I think it gives a cleaner
            // dependency graph, and it makes request tracing work.
            output.Replay(Response);
        }
Example #6
0
        protected override void beforeEach()
        {
            theWriter = new StubOutputWriter();
            Services.Inject <IOutputWriter>(theWriter);

            theWriter.Output.AppendHeader(HttpResponseHeaders.ETag, "12345");

            theResultingOutput = ClassUnderTest.CreateOuput(theResource, x => x.Invoke());
        }
Example #7
0
        protected override void beforeEach()
        {
            theWriter = new StubOutputWriter();
            Services.Inject <IOutputWriter>(theWriter);

            theWriter.Output.AppendHeader(HttpResponseHeaders.ETag, "12345");
            theWriter.Output.AppendHeader("a", "1");

            theHeaders = new HeadersCache();
            Services.Inject <IHeadersCache>(theHeaders);

            theResultingOutput = ClassUnderTest.CreateOutput(theResource, () => MockFor <IActionBehavior>().Invoke());
        }
Example #8
0
        protected override void beforeEach()
        {
            theCache = new StubOutputCache(MockFor <IRecordedOutput>())
            {
                CacheHits = false
            };
            Services.Inject <IOutputCache>(theCache);

            MockFor <ICurrentChain>().Stub(x => x.ResourceHash())
            .Return(theResource);

            Services.PartialMockTheClassUnderTest();
            theGeneratedOutput = new RecordedOutput(null);
            ClassUnderTest.Expect(x => x.CreateOuput(theResource, ClassUnderTest.Invoker))
            .Return(theGeneratedOutput);

            ClassUnderTest.Invoke();
        }
 public void Replay(IRecordedOutput output)
 {
     throw new NotImplementedException();
 }
Example #10
0
 public StubOutputCache(IRecordedOutput output)
 {
     _output = output;
 }
Example #11
0
 public void Replay(IRecordedOutput output)
 {
     throw new NotImplementedException();
 }
Example #12
0
 public ReplayRecordedOutput(IRecordedOutput output)
 {
     _output = output;
 }
 public ReplayRecordedOutput(IRecordedOutput output)
 {
     _output = output;
 }