예제 #1
0
        public void SetUp()
        {
            // Leave this here!
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            LocalizationManager.Stub();

            theGrammar = new EnterGrammarFixture()["EnterDirection"] as LineGrammar;
        }
예제 #2
0
        protected SingleLineGrammar()
        {
            var types = new List<Type>
            {
                typeof (object),
                typeof (SingleLineGrammar)
            };

            foreach (MethodInfo method in GetType().GetMethods())
            {
                if (types.Contains(method.DeclaringType))
                {
                    continue;
                }

                _inner = GrammarBuilder.BuildGrammar(method, this).As<LineGrammar>();
                break;
            }

            if (_inner == null)
            {
                throw new ApplicationException("There is no suitable public method for this Grammar");
            }
        }
예제 #3
0
        protected SingleLineGrammar()
        {
            var types = new List <Type>
            {
                typeof(object),
                typeof(SingleLineGrammar)
            };

            foreach (MethodInfo method in GetType().GetMethods())
            {
                if (types.Contains(method.DeclaringType))
                {
                    continue;
                }

                _inner = GrammarBuilder.BuildGrammar(method, this).As <LineGrammar>();
                break;
            }

            if (_inner == null)
            {
                throw new ApplicationException("There is no suitable public method for this Grammar");
            }
        }
예제 #4
0
        public void SetUp()
        {
            step = new Step();

            step.LeafFor("record")
                .WithStep("a:1,b:2")
                .WithStep("a:3,b:4")
                .WithStep("a:5,b:6");

            inner = MockRepository.GenerateMock<LineGrammar>();
            grammar = new TableGrammar(inner, "record");

            grammar.LabelName = "some label";
        }