public void marks_the_compiled_Sentence_as_a_fact() { var fact = new FactGrammar("This is so", c => true); var sentence = fact.Compile(new Fixture(), CellHandling.Basic()) .ShouldBeOfType <Sentence>(); sentence.fact.ShouldBeTrue(); }
public void run_with_a_test_context_func() { var context = new TestContext(); var service = new ServiceInContext() { Count = 2 }; context.Store(service); var fact = new FactGrammar(c => c.Retrieve <ServiceInContext>().Count == 2, "the count should be 2"); fact.Execute(new Step(), context); context.Counts.ShouldEqual(1, 0, 0, 0); service.Count = 3; context.Counts.Reset(); fact.Execute(new Step(), context); context.Counts.ShouldEqual(0, 1, 0, 0); }
public void SetUp() { returnsTrue = false; grammar = new FactGrammar(() => returnsTrue, theText); }