public void DoesNotNotifyWhenNoChanges()
        {
            string testDomain   = "domain";
            string testHostName = "hostname";

            MxEntityState state  = new MxEntityState(testDomain);
            HostMxRecord  record = new HostMxRecord(testHostName, 5, new List <string> {
                "192.168.0.1", "192.168.0.2"
            });

            state.HostMxRecords = new List <HostMxRecord> {
                new HostMxRecord(testHostName, 5, new List <string> {
                    "192.168.0.1"
                })
            };
            List <HostMxRecord> hostMxRecords = new List <HostMxRecord> {
                record
            };
            MxRecordsPolled mxRecordsPolled = new MxRecordsPolled(testDomain, hostMxRecords, TimeSpan.MinValue);

            _recordChangedNotifier.Handle(state, mxRecordsPolled);

            A.CallTo(() => _dispatcher.Dispatch(A <MxRecordAdded> ._, A <string> ._)).MustNotHaveHappened();
            A.CallTo(() => _dispatcher.Dispatch(A <MxRecordRemoved> ._, A <string> ._)).MustNotHaveHappened();
        }
예제 #2
0
        public void DoesNotNotifyWhenNoChanges()
        {
            Dictionary <string, List <string> > selectorsAndRecords1 = new Dictionary <string, List <string> >
            {
                { "selector1", new List <string> {
                      "record"
                  } }
            };
            Dictionary <string, List <string> > selectorsAndRecords2 = new Dictionary <string, List <string> >
            {
                { "selector1", new List <string> {
                      "record"
                  } }
            };

            DkimEntityState   state   = CreateDkimEntityState(selectorsAndRecords1);
            DkimRecordsPolled message = CreateDkimRecordsPolled(selectorsAndRecords2);

            _recordChangedNotifier.Handle(state, message);

            A.CallTo(() => _messageDispatcher.Dispatch(A <Common.Messaging.Abstractions.Message> .Ignored, A <string> .Ignored)).MustNotHaveHappened();
        }
        public void DoesNotNotifyWhenNoChanges()
        {
            _recordChangedNotifier.Handle(CreateEntityState("testRecord"), CreateTlsRptRecordsEvaluated("testRecord"));

            A.CallTo(() => _messageDispatcher.Dispatch(A <Message> .Ignored, A <string> .Ignored)).MustNotHaveHappened();
        }