Esempio n. 1
0
 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)"));
 }
Esempio n. 2
0
 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"));
 }