コード例 #1
0
        public void should_format_results()
        {
            var results = new DiagnosticResults(new ScannedSource[0], new Type[0], new Type[0], new SkippedAutomappingType[0], new Type[0], new AutomappingType[0]);
            var formatter = Mock<IDiagnosticResultsFormatter>.Create();
            var listener = new StringLambdaOutputListener(x => { });
            listener.SetFormatter(formatter);
            listener.Receive(results);

            formatter.AssertWasCalled(x => x.Format(results));
        }
コード例 #2
0
        public void should_format_results()
        {
            var results = new DiagnosticResults(new ScannedSource[0], new Type[0], new Type[0], new SkippedAutomappingType[0], new Type[0], new AutomappingType[0]);
            var formatter = A.Fake<IDiagnosticResultsFormatter>();
            var listener = new StringLambdaOutputListener(x => { });
            listener.SetFormatter(formatter);
            listener.Receive(results);

            A.CallTo(() => formatter.Format(results)).MustHaveHappened();
        }
コード例 #3
0
        public void should_raise_formatted_results()
        {
            var results = new DiagnosticResults(new ScannedSource[0], new Type[0], new Type[0], new SkippedAutomappingType[0], new Type[0], new AutomappingType[0]);
            var output = "formatted output";
            var receivedOutput = "";
            var formatter = A.Fake<IDiagnosticResultsFormatter>();
            A.CallTo(() => formatter.Format(results)).Returns(output);
            var listener = new StringLambdaOutputListener(x => { receivedOutput = x; });
            listener.SetFormatter(formatter);
            listener.Receive(results);

            receivedOutput.ShouldEqual(output);
        }
コード例 #4
0
        public void should_raise_formatted_results()
        {
            var results = new DiagnosticResults(new ScannedSource[0], new Type[0], new Type[0], new SkippedAutomappingType[0], new Type[0], new AutomappingType[0]);
            var output = "formatted output";
            var receivedOutput = "";
            var formatter = Stub<IDiagnosticResultsFormatter>.Create(sb =>
                sb.Stub(x => x.Format(results))
                    .Return(output));
            var listener = new StringLambdaOutputListener(x => { receivedOutput = x; });
            listener.SetFormatter(formatter);
            listener.Receive(results);

            receivedOutput.ShouldEqual(output);
        }