public void WhenSettingAnItem_CanAccessTheValueAfterwards() { var testObj = new Login {Value = "SomeLogin"}; var sut = new NancySession(new Session()) { ["SomeKey"] = testObj }; var actual = sut["SomeKey"]; Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(testObj)); }
public void WhenAbandoningTheSession_TheItemsHaveBeenCleared() { var testObj = new Login {Value = "SomeLogin"}; var sut = new NancySession(new Session()) { ["SomeKey"] = testObj }; sut.Abandon(); var actual = sut["SomeKey"]; Assert.That(actual, Is.Null); }