Ejemplo n.º 1
0
        public void creates_grammar_structure()
        {
            var dooer = new Dooer();
            ActionMethodGrammar action = ActionMethodGrammar.Create(x => x.DoSomethingWith2(null, 34), dooer);
            MethodInfo          method = ReflectionHelper.GetMethod <Dooer>(x => x.DoSomethingWith2(null, 34));


            var sentence = action.ToStructure(new FixtureLibrary()).ShouldBeOfType <Sentence>();

            sentence.ShouldEqual(Sentence.For(method.GetTemplate(), Cell.For <string>("name"), Cell.For <int>("age")));
        }
Ejemplo n.º 2
0
        public void ignores_Testcontext_and_non_simple_types_when_building_a_grammar_structure()
        {
            var dooer = new Dooer();
            ActionMethodGrammar action = ActionMethodGrammar.Create(
                x => x.DoSomethingUsingContextAndAddress(null, null, null), dooer);
            MethodInfo method =
                ReflectionHelper.GetMethod <Dooer>(x => x.DoSomethingUsingContextAndAddress(null, null, null));

            var      sentence = action.ToStructure(new FixtureLibrary()).ShouldBeOfType <Sentence>();
            Sentence expected = Sentence.For(method.GetTemplate(), Cell.For <string>("name"));

            sentence.ShouldEqual(expected);
        }