Пример #1
0
        public void DoesNotWriteSuccesses()
        {
            var input = new List <TestResult>
            {
                new(true, "myfile.sql", null)
            };

            var wrapper = new OutputWrapper();
            var writer  = new GitHubErrorWriter(wrapper);

            writer.WriteErrors(input);

            Assert.That(wrapper.Lines, Is.Empty);
        }
Пример #2
0
        public void WritesErrors()
        {
            var input = new List <TestResult>
            {
                new(false, "myfile.sql", new TestError("Something went wrong", 42))
            };

            var wrapper = new OutputWrapper();
            var writer  = new GitHubErrorWriter(wrapper);

            writer.WriteErrors(input);

            Assert.That(wrapper.Lines, Is.EquivalentTo(new List <string>
            {
                "::error file=myfile.sql,line=42::Something went wrong"
            }));
        }