public void ShouldSwitchAccordinglyToTargetValue() { var switcher = new Switcher<string, long>(); Assert.AreEqual( 3, switcher .When("the answer to life, universe, everything").Do(() => 42) .When("round(pi)").Do(() => 3) .Default().Do(() => 0) .ConsiderThisCase("round(pi)")); }
public void ShouldGoForTheDefaultCase() { var switcher = new Switcher<string, long>(); Assert.AreEqual( 550, switcher .When("the answer to life, universe, everything").Do(() => 42) .When("round(pi)").Do(() => 3) .Default().Do(() => 550) .ConsiderThisCase("ansdasd")); }