public void ExceptionThrownIfMethodNotFound() { ScenarioWrapper scenarioWrapper = new ScenarioWrapper(typeof(MethodSearchTestsClass)); Action action = () => { scenarioWrapper.Given("NonExistingGivenMethod"); }; action.ShouldThrow <TestMethodNotFoundException>(); action = () => { scenarioWrapper.When("NonExistingWhenMethod"); }; action.ShouldThrow <TestMethodNotFoundException>(); action = () => { scenarioWrapper.Then("NonExistingThenMethod"); }; action.ShouldThrow <TestMethodNotFoundException>(); }
public void ExceptionThrownWhenAmbiguousWhenMethodFound() { ScenarioWrapper scenarioWrapper = new ScenarioWrapper(typeof(MethodSearchTestsClass)); Action action = () => { scenarioWrapper.When("WhenStaticMethodSearchTestsClassDuplicate"); }; action.ShouldThrow <AmbiguousTestMethodFoundException>(); }
public void WhenMethodFoundForRegExPattern() { ScenarioWrapper scenarioWrapper = new ScenarioWrapper(typeof(MethodSearchTestsClass)); Action action = () => { scenarioWrapper.When("WhenStaticMethodSearchTestsClass"); }; action.ShouldNotThrow(); }