public void ShouldProduceServiceMessages(string projectName)
        {
            // Given
            var testCommandLine = new CommandLine(
                @"dotnet",
                "test",
                projectName,
                "-l=teamcity",
                "-a=.",
#if DEBUG
                "-c=Debug"
#else
                "-c=Release"
#endif
                );

            // When
            testCommandLine.TryExecute(out CommandLineResult result).ShouldBe(true);

            // Then
            result.ExitCode.ShouldBe(1);
            result.StdError.Trim().ShouldBe(string.Empty);
            ServiceMessages.GetNumberServiceMessage(result.StdOut).ShouldBe(10);
            ServiceMessages.ResultShouldContainCorrectStructureAndSequence(result.StdOut);
        }
Пример #2
0
        public void ShouldProduceServiceMessages()
        {
            // Given

            // When

            // Then
            foreach (var testResult in GetTestResults())
            {
                foreach (var message in testResult.Messages)
                {
                    ServiceMessages.GetNumberOfServiceMessages(message.Item2).ShouldBe(message.Item1, testResult.ToString());
                    ServiceMessages.ResultShouldContainCorrectStructureAndSequence(testResult.ToString());
                }
            }
        }