public void ExportCompositePageTests(bool isContentPage, MicroServicesDataEventAction microServicesDataEventAction) { //Setup A.CallTo(() => fakeDataEventActions.GetEventAction(A <IDataEvent> ._)).Returns(microServicesDataEventAction); if (isContentPage) { A.CallTo(() => fakeCompositePageBuilder.GetContentPageTypeFromPageNode(A <Type> ._, A <Guid> ._, A <string> ._)).Returns(true); } else { A.CallTo(() => fakeCompositePageBuilder.GetContentPageTypeFromPageNode(A <Type> ._, A <Guid> ._, A <string> ._)).Returns(false); } //Act var dataEventHandler = new DataEventProcessor(fakeApplicationLogger, fakeCompositePageBuilder, fakeAsyncHelper, fakeDataEventActions, fakeDynamicContentConverter, fakeServiceBusMessageProcessor, fakeDynamicContentExtensions, fakeDynamicContentAction, fakeSitefinityManagerProxy); dataEventHandler.ExportCompositePage(fakeDataEvent); //Asserts if (isContentPage) { A.CallTo(() => fakeServiceBusMessageProcessor.SendContentPageMessage(A <MicroServicesPublishingPageData> ._, A <string> ._, A <string> ._)).MustHaveHappenedOnceExactly(); } else { A.CallTo(() => fakeServiceBusMessageProcessor.SendContentPageMessage(A <MicroServicesPublishingPageData> ._, A <string> ._, A <string> ._)).MustNotHaveHappened(); } }
private void GenerateServiceBusMessageForContentPages(MicroServicesPublishingPageData item, string contentType, string eventAction) { serviceBusMessageProcessor.SendContentPageMessage(item, contentType, eventAction); }