public void ReturnsStateXAsLastActiveStateWhenXWasSetBefore() { var stateContainer = new StateContainer <string, int>(); stateContainer.SetLastActiveStateFor("A", "Z"); stateContainer .GetLastActiveStateFor("A") .Should() .BeEquivalentTo(Optional <string> .Just("Z")); }
public void ReturnsNothingAsLastActiveStateWhenStateWasNeverSet() { var stateContainer = new StateContainer <string, int>(); stateContainer.SetLastActiveStateFor("A", "helloWorld"); stateContainer .GetLastActiveStateFor("B") .Should() .BeEquivalentTo(Optional <string> .Nothing()); }