Пример #1
0
        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));
        }
Пример #2
0
        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);
        }