Ejemplo n.º 1
0
        public void RemoveFromSessionDoesNotThrowForUnexistingKeys()
        {
            IStoryBoard board = new StoryBoardBase();

            board.StoreToSession(SessionId.Key1, "Caramel");

            Assert.DoesNotThrow(() => board.RemoveFromSession(SessionId.Key2));
        }
Ejemplo n.º 2
0
        public void RemoveFromSessionRemovesExistingKey()
        {
            IStoryBoard board = new StoryBoardBase();

            board.StoreToSession(SessionId.Key1, "Caramel");
            bool result = board.TryLoadFromSession(SessionId.Key1, out string value);

            Assert.IsTrue(result);
            Assert.AreEqual("Caramel", value);

            board.RemoveFromSession(SessionId.Key1);
            result = board.TryLoadFromSession(SessionId.Key1, out value);
            Assert.IsFalse(result);
        }