Esempio n. 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();
        }
Esempio n. 2
0
        protected override void beforeEach()
        {
            theCache = new StubOutputCache(MockFor <IRecordedOutput>())
            {
                CacheHits = true
            };
            Services.Inject <IOutputCache>(theCache);

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

            ClassUnderTest.Invoke();
        }
Esempio n. 3
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();
        }
Esempio n. 4
0
        protected override void beforeEach()
        {
            theCache = new StubOutputCache(MockFor <IRecordedOutput>())
            {
                CacheHits = true
            };
            Services.Inject <IOutputCache>(theCache);

            MockFor <IResourceHash>().Stub(x => x.CreateHash())
            .Return(theResource);

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


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

            ClassUnderTest.Inner = MockFor <IActionBehavior>();

            ClassUnderTest.Invoke();
        }