public void should_flush_messages_to_dispatcher()
        {
            var dispatcher = A.Fake <IDiagnosticMessageDispatcher>();
            var logger     = new DefaultDiagnosticLogger(dispatcher);

            logger.FluentMappingDiscovered(typeof(SomeClassMap));
            logger.Flush();

            A.CallTo(() => dispatcher.Publish(A <DiagnosticResults> ._)).MustHaveHappened();
        }
        public void should_flush_messages_to_despatcher()
        {
            var despatcher = Mock <IDiagnosticMessageDespatcher> .Create();

            var logger = new DefaultDiagnosticLogger(despatcher);

            logger.FluentMappingDiscovered(typeof(SomeClassMap));
            logger.Flush();

            despatcher.AssertWasCalled(x => x.Publish(Arg <DiagnosticResults> .Is.Anything));
        }
        public void should_add_class_maps_to_result()
        {
            var dispatcher = A.Fake <IDiagnosticMessageDispatcher>();
            var logger     = new DefaultDiagnosticLogger(dispatcher);

            DiagnosticResults result = null;

            A.CallTo(() => dispatcher.Publish(A <DiagnosticResults> ._))
            .Invokes(a => { result = (DiagnosticResults)a.Arguments.First(); });

            logger.FluentMappingDiscovered(typeof(SomeClassMap));
            logger.Flush();

            result.FluentMappings.ShouldContain(typeof(SomeClassMap));
        }
        public void should_add_class_maps_to_result()
        {
            var despatcher = Mock <IDiagnosticMessageDespatcher> .Create();

            var logger = new DefaultDiagnosticLogger(despatcher);

            logger.FluentMappingDiscovered(typeof(SomeClassMap));
            logger.Flush();

            DiagnosticResults result = null;

            despatcher.AssertWasCalled(x => x.Publish(Arg <DiagnosticResults> .Is.Anything),
                                       c => c.Callback <DiagnosticResults>(x =>
            {
                result = x;
                return(true);
            }));

            result.FluentMappings.ShouldContain(typeof(SomeClassMap));
        }