Beispiel #1
0
        public void FindErrors(string filename)
        {
            var code          = IncorrectTestDataDir.GetFiles(filename).Single().ContentAsUtf8();
            var errors        = new RefArgumentsValidator().FindErrors(code);
            var errorMessages = errors.Select(e => e.GetMessageWithPositions());

            using (ApprovalResults.ForScenario(filename))
            {
                Approvals.Verify(string.Join("\n", errorMessages));
            }
        }
Beispiel #2
0
        public void NotFindErrors(string filename)
        {
            var code   = CorrectTestDataDir.GetFiles(filename).Single().ContentAsUtf8();
            var errors = new RefArgumentsValidator().FindErrors(code);

            if (errors != null)
            {
                Console.WriteLine(errors);
            }
            errors.Should().BeNullOrEmpty();
        }