Exemple #1
0
        public void FindErrors(string filename)
        {
            var code = IncorrectTestDataDir.GetFiles(filename).Single().ContentAsUtf8();
            var binaryExpressionSyntaxsCount = CSharpSyntaxTree.ParseText(code).GetRoot().DescendantNodes().OfType <BinaryExpressionSyntax>().Count();
            var errors = validator.FindErrors(code);

            errors.Should().NotBeNullOrEmpty();
            errors.Count.Should().Be(binaryExpressionSyntaxsCount);
        }
        public void FindErrors(string filename)
        {
            var code          = IncorrectTestDataDir.GetFiles(filename).Single().ContentAsUtf8();
            var errors        = new ExcessLinesValidator().FindErrors(code);
            var errorMessages = errors.Select(e => e.GetMessageWithPositions());

            using (ApprovalResults.ForScenario(filename))
            {
                Approvals.Verify(string.Join("\n", errorMessages));
            }
        }