public void HandlesExceptionForDefaultCase() { // Arrange var patternMatching = new PatternMatching(); // Act | Assert Assert.Throws <ArgumentNullException>("machine", () => patternMatching.MatchingMachineProduct(null)); }
public void MatchesPizzaPatternInSwitch() { // Arrange var patternMatching = new PatternMatching(); IMachine pizza = new PizzaMachine(); // Act var result = patternMatching.MatchingMachineProduct(pizza); // Assert Assert.Equal("Pizza", result); }
public void MatchesNotInCasePatternInSwitch() { // Arrange var patternMatching = new PatternMatching(); IMachine notInCase = new NotInCaseMachine(); // Act var result = patternMatching.MatchingMachineProduct(notInCase); // Assert Assert.Equal(null, result); }
public void MatchesFishAndChipsPatternInSwitch() { // Arrange var patternMatching = new PatternMatching(); IMachine fishAndChips = new FishAndChipsMachine(); // Act var result = patternMatching.MatchingMachineProduct(fishAndChips); // Assert Assert.Equal("Fish and chips", result); }