public void When_validating_sequences_and_file_is_empty_then_return_error()
        {
            var sequences = new List <TurtleAction[]> {
            };
            var results   = _sut.Validate(sequences);

            results.Errors.Count.Should().Be(1);
            results.Errors[0].ErrorMessage.Should().Be("At least one sequence should be informed on moves file.");
        }
Exemplo n.º 2
0
        private static void ValidateSequences(List <TurtleAction[]> sequences)
        {
            if (sequences == null)
            {
                throw new Exception("Sequences file is empty.");
            }

            var sequencesValidator = new SequencesValidator();
            var results            = sequencesValidator.Validate(sequences);

            if (!results.IsValid)
            {
                throw new Exception($"Sequences file is invalid:\n{results.BuildErrorMessage()}");
            }
        }