StoryTeller.Model.FixtureModel.FindGrammar C# (CSharp) Метод

FindGrammar() публичный Метод

public FindGrammar ( string key ) : GrammarModel
key string
Результат GrammarModel
        public GrammarModel FindGrammar(string key)
        {
            return grammars?.FirstOrDefault(x => x.key == key);
        }

Usage Example

        public void ValidateStepsWithinSection(Section section, FixtureModel fixture)
        {
            if (fixture.IsMissing)
            {
                AddError($"Fixture '{fixture.key}' is not implemented");
            }

            var i = 0;

            foreach (var step in section.Children.OfType <Step>())
            {
                i++;

                _locations.Push($"Step #{i}: {step.Key}");

                var grammar = fixture.FindGrammar(step.Key);
                if (grammar == null)
                {
                    AddError($"Unknown Grammar '{step.Key}'");
                }
                else
                {
                    if (grammar.IsMissing)
                    {
                        AddError($"Grammar '{step.Key}' is not implemented");
                    }

                    grammar.PostProcessAndValidate(this, step);
                }

                _locations.Pop();
            }
        }
All Usage Examples Of StoryTeller.Model.FixtureModel::FindGrammar