Esempio n. 1
0
        public void ReturnsStateXAsLastActiveStateWhenXWasSetBefore()
        {
            var stateContainer = new StateContainer <string, int>();

            stateContainer.SetLastActiveStateFor("A", "Z");

            stateContainer
            .GetLastActiveStateFor("A")
            .Should()
            .BeEquivalentTo(Optional <string> .Just("Z"));
        }
Esempio n. 2
0
        public void ReturnsNothingAsLastActiveStateWhenStateWasNeverSet()
        {
            var stateContainer = new StateContainer <string, int>();

            stateContainer.SetLastActiveStateFor("A", "helloWorld");

            stateContainer
            .GetLastActiveStateFor("B")
            .Should()
            .BeEquivalentTo(Optional <string> .Nothing());
        }