Ejemplo n.º 1
0
        public InvalidFixture(Type innerType, Exception ex)
        {
            Key = innerType.Name.Replace("Fixture", "");

            var message = "Fixture {0} could not be loaded".ToFormat(innerType.FullName);
            _error = new GrammarError {error = ex.ToString(), message = message};
        }
Ejemplo n.º 2
0
        public Sentence(string template, IEnumerable <Cell> cells)
        {
            _cells = new List <Cell>(cells);
            try
            {
                new DisplayParser(this).Parse(template, new Step(), cells);

                IEnumerable <Cell> resultCells = cells.Where(c => c.IsBooleanResult());
                if (resultCells.Count() == 1)
                {
                    _resultCell = resultCells.First();
                    _isFact     = !_parts.Select(x => x as TextInput).Any(x => x != null && x.Cell == _resultCell);
                }
            }
            catch (Exception e)
            {
                var error = new GrammarError
                {
                    Message = e.Message,
                    Node    = this
                };
                logError(error);
            }

            _template = template;
            Name      = _template.Replace("{", "").Replace("}", "");
        }
Ejemplo n.º 3
0
        public Sentence(string template, IEnumerable<Cell> cells)
        {
            _cells = new List<Cell>(cells);
            try
            {
                new DisplayParser(this).Parse(template, new Step(), cells);

                IEnumerable<Cell> resultCells = cells.Where(c => c.IsBooleanResult());
                if (resultCells.Count() == 1)
                {
                    _resultCell = resultCells.First();
                    _isFact = !_parts.Select(x => x as TextInput).Any(x => x != null && x.Cell == _resultCell);
                }
            }
            catch (Exception e)
            {
                var error = new GrammarError
                {
                    Message = e.Message,
                    Node = this
                };
                logError(error);
            }

            _template = template;
            Name = _template.Replace("{", "").Replace("}", "");
        }
        public InvalidFixture(Type innerType, Exception ex)
        {
            Key = innerType.Name.Replace("Fixture", "");

            var message = "Fixture {0} could not be loaded".ToFormat(innerType.FullName);

            _error = new GrammarError {
                error = ex.ToString(), message = message
            };
        }
Ejemplo n.º 5
0
        public void LogError(Exception exception)
        {
            var error = new GrammarError
            {
                ErrorText = exception.ToString(),
                Message   = "Fixture '{0}' could not be loaded".ToFormat(_name),
                Node      = this
            };

            _errors.Add(error);
        }
Ejemplo n.º 6
0
        public GrammarErrorItem(GrammarError error)
            : this()
        {
            label.Content = error.Message;

            if (error.ErrorText.IsEmpty())
            {
                errorText.Hide();
            }

            errorText.Text = error.ErrorText;
        }
Ejemplo n.º 7
0
 public void LogError(GrammarError error)
 {
     _errors.Add(error);
 }
Ejemplo n.º 8
0
 protected void logError(GrammarError error)
 {
     _errors.Add(error);
 }
Ejemplo n.º 9
0
 public void SetUp()
 {
     fixture = new BadGrammarFixture();
     error = fixture.Errors.First();
 }
Ejemplo n.º 10
0
 public void LogError(GrammarError error)
 {
     _errors.Add(error);
 }
Ejemplo n.º 11
0
        public void LogError(Exception exception)
        {
            var error = new GrammarError
            {
                ErrorText = exception.ToString(),
                Message = "Fixture '{0}' could not be loaded".ToFormat(_name),
                Node = this
            };

            _errors.Add(error);
        }
Ejemplo n.º 12
0
 protected void logError(GrammarError error)
 {
     _errors.Add(error);
 }