public void Should_save_nothing_if_the_session_is_null() { var response = new Response(); cookieStore.Save(null, response); response.Cookies.Count.ShouldEqual(0); }
public void Should_call_the_formatter_on_save() { var response = new Response(); var session = new Session(new Dictionary <string, object>()); session["key1"] = "value1"; var fakeFormatter = A.Fake <ISessionObjectFormatter>(); var store = new Nancy.Session.CookieBasedSessions(this.encryptionProvider, this.hmacProvider, "the passphrase", "the salt", "hmac passphrase", fakeFormatter); store.Save(session, response); A.CallTo(() => fakeFormatter.Serialize("value1")).MustHaveHappened(Repeated.Exactly.Once); }
public void Should_call_the_formatter_on_save() { var response = new Response(); var session = new Session(new Dictionary<string, object>()); session["key1"] = "value1"; var fakeFormatter = A.Fake<ISessionObjectFormatter>(); var store = new Nancy.Session.CookieBasedSessions(this.encryptionProvider, "the passphrase", "the salt", fakeFormatter); store.Save(session, response); A.CallTo(() => fakeFormatter.Serialize("value1")).MustHaveHappened(Repeated.Exactly.Once); }