コード例 #1
0
        public void BeforeEach()
        {
            originalWritter = Console.Out;
            stringWriter    = new StringWriter(CultureInfo.CurrentCulture);
            Console.SetOut(stringWriter);

            consoleFormatter = new DocumentionConsoleFormatter(new DefaultConsoleWritter());
            consoleFormatter.WriteInformation(Resources.TestReason);
        }
コード例 #2
0
        public void BeforeEach()
        {
            originalWritter = Console.Out;
            stringWriter = new StringWriter(CultureInfo.CurrentCulture);
            Console.SetOut(stringWriter);

            consoleFormatter = new DocumentionConsoleFormatter(new DefaultConsoleWritter());
            consoleFormatter.WriteInformation(Resources.TestReason);
        }
コード例 #3
0
        protected ExpressionResult ExecuteSpecification(Specification specification, string exampleText)
        {
            var result = runner.Execute(specification.BuildExpression(), exampleText);

            foreach (var exampleGroup in result.Examples)
            {
                formatter.WriteInformation(exampleGroup.Reason);

                foreach (var example in exampleGroup.Examples)
                {
                    if (example.Status == ResultStatus.Success)
                    {
                        formatter.WriteSuccess(example);
                    }
                    else
                    {
                        formatter.WriteError(example);
                    }
                }
            }

            return(result);
        }