Ejemplo n.º 1
0
        public void erase()
        {
            var now = DateTime.Today.AddHours(8).ToUniversalTime();

            time.Stub(x => x.UtcNow()).Return(now);

            theCookieValue.Erase();

            writer.LastCookie.ShouldNotBeNull();
            writer.LastCookie.Value.ShouldEqual("BLANK"); // has to do this to keep SelfHost from going wonky
            writer.LastCookie.Expires.ShouldEqual(new DateTimeOffset(now.AddYears(-1)));
        }
Ejemplo n.º 2
0
        protected override void beforeEach()
        {
            theSettings   = new CookieSettings();
            theSystemTime = MockRepository.GenerateStub <ISystemTime>();

            today = DateTime.Today;
            theSystemTime.Stub(x => x.UtcNow()).Return(today);

            Services.Inject(theSettings);
        }