protected override void beforeEach()
        {
            theCookieValue = CookieFlashProvider.ToBase64String("{\"Name\":\"Joel\"}");

            theOutputWriter = new RecordingOutputWriter();

            Services.Inject <IOutputWriter>(theOutputWriter);

            MockFor <ICookies>().Stub(x => x.Has(CookieFlashProvider.FlashKey)).Return(true);
            MockFor <ICookies>().Stub(x => x.GetValue(CookieFlashProvider.FlashKey)).Return(theCookieValue);

            theTarget = ClassUnderTest.Retrieve <FlashTarget>();
        }
Exemplo n.º 2
0
        protected override void beforeEach()
        {
            theOutputWriter = new RecordingOutputWriter();

            theFlashObject = Guid.NewGuid();
            theJson        = "test test test";

            Services.Inject <IOutputWriter>(theOutputWriter);
            Services.PartialMockTheClassUnderTest();

            ClassUnderTest.Stub(x => x.ToJson(theFlashObject)).Return(theJson);

            ClassUnderTest.Flash(theFlashObject);
        }