public void create_a_grammar_structure() { var grammar = new TestServiceAssertionGrammar(); var sentence = grammar.ToStructure(new FixtureLibrary()).ShouldBeOfType <Sentence>(); sentence.ShouldEqual(Sentence.For("The Color should be {Color}", Cell.For <string>("Color"))); }
public void GetCells() { IList <Cell> cells = new TestServiceAssertionGrammar().GetCells(); cells.Count.ShouldEqual(1); cells[0].ShouldEqual(new Cell("Color", typeof(string))); cells[0].IsResult.ShouldBeTrue(); }
public void execute_records_the_actual() { var context = new TestContext(); var target = new ServiceTarget { Color = "Red" }; context.Store(target); var step = new Step(); var grammar = new TestServiceAssertionGrammar(); grammar.Execute(step, context); context.Counts.SyntaxErrors.ShouldEqual(1); context.ResultsFor(step).GetActual("Color").ShouldEqual("Red"); }