public void build_out_the_grammar_model() { var grammar = new ActionGrammar("do something", c => { }); var model = grammar.Compile(new Fixture(), CellHandling.Basic()).ShouldBeOfType <Sentence>(); model.errors.Any().ShouldBe(false); model.format.ShouldBe("do something"); model.cells.Any().ShouldBe(false); }
public void execute_delegates() { var action = Substitute.For <System.Action <ISpecContext> >(); var grammar = new ActionGrammar("do something", action); var context = SpecContext.ForTesting(); grammar.Execute(new StepValues("foo"), context).ToArray(); action.Received().Invoke(context); }
public void execute_delegates() { var action = MockRepository.GenerateMock <System.Action <ISpecContext> >(); var grammar = new ActionGrammar("do something", action); var context = SpecContext.ForTesting(); grammar.Execute(new StepValues("foo"), context).ToArray(); action.AssertWasCalled(x => x.Invoke(context)); }
public void SetUp() { stepHistory.Clear(); var simple = new ActionGrammar("Inner", () => stepHistory.Add("INNER")); grammar = new DecoratedLineGrammar(simple) { Before = (s, c) => stepHistory.Add("Before"), After = (s, c) => stepHistory.Add("After"), Prefix = "Pre ", Suffix = " Post" }; }
public void SetUp() { wasExecuted = false; grammar = new ActionGrammar("Some Text", () => wasExecuted = true); }