public void execute_the_method_with_a_step_and_store_the_actual() { MethodInfo method = ReflectionHelper.GetMethod<ReflectionTarget>(x => x.GetNameAndAge("", 0)); var grammar = new ReflectionValueCheck(method, new ReflectionTarget()); Step step = new Step("a").With("name", "Jeremy").With("age", 34); grammar.Execute(step).Results.ActualDisplay<string>(method.GetReturnValueAlias()).ShouldEqual("Jeremy is 34"); }
public void marks_the_testdata_with_wrong_if_the_actual_is_wrong() { MethodInfo method = ReflectionHelper.GetMethod<ReflectionTarget>(x => x.GetNameAndAge("", 0)); var grammar = new ReflectionValueCheck(method, new ReflectionTarget()); Step step = new Step("a").With("name", "Jeremy").With("age", 34).With("theValue", "the wrong value"); var data = new TestContext(); grammar.Execute(step, data); data.Counts.Wrongs.ShouldEqual(1); }