public void should_call_pipeline() { // Arrange using (var pipelines = new PipelinesHandler()) { var updateItem = new ItemMock(); var item = new ItemMock().AsConfigurationItem() .WithChild(updateItem); var synchContext = new SynchContext(item); var sharepointItem = TestHelper.CreateSharepointItem(); var options = new ProcessIntegrationItemsOptions(); var action = new UpdateIntegrationItemAction(new IntegrationItem(updateItem), sharepointItem, synchContext, options); // Act action.Execute(); action.IsSuccessful.Should().BeTrue(); // Assert pipelines.ShouldReceiveCall <ProcessIntegrationItemArgs>( PipelineNames.UpdateIntegrationItem, x => x.IntegrationItemID == updateItem.ID && x.SourceSharepointItem == sharepointItem && x.SynchContext == synchContext && x.Options == options); } }
public void should_run_sync_pipeline() { // Arrange using (var pipelines = new PipelinesHandler()) { var synchContext = new SynchContext(new ItemMock().AsConfigurationItem()); // Act IntegrationPipelinesRunner.SynchronizeTree(ProcessIntegrationItemsOptions.DefaultOptions, synchContext); // Assert pipelines.ShouldReceiveCall <SynchronizeTreeArgs>(PipelineNames.SynchronizeTree, x => x.Context == synchContext); } }
public void should_process_tree_via_pipeline() { // Arrange using (var pipelines = new PipelinesHandler()) { var options = ProcessIntegrationItemsOptions.DefaultOptions; options.Force = true; Item item = new ItemMock().AsConfigurationItem(); // Act SharepointProvider.ProcessTree(item, options); // Assert pipelines.ShouldReceiveCall <SynchronizeTreeArgs>(PipelineNames.SynchronizeTree, x => true); } }
public void should_call_pipeline() { // Arrange using (var pipelines = new PipelinesHandler()) { var synchContext = new SynchContext(new ItemMock().AsConfigurationItem()); var sharepointItem = TestHelper.CreateSharepointItem(); var action = new CreateIntegrationItemAction(sharepointItem, synchContext, ProcessIntegrationItemsOptions.DefaultOptions); // Act action.Execute(); action.IsSuccessful.Should().BeTrue(); // Assert pipelines.ShouldReceiveCall <ProcessIntegrationItemArgs>( PipelineNames.CreateIntegrationItem, x => x.SourceSharepointItem == sharepointItem && x.SynchContext == synchContext); } }
public void should_call_pipeline() { // Arrange using (var pipelines = new PipelinesHandler()) { var synchContext = new SynchContext(new ItemMock().AsConfigurationItem()); Item sourceItem = new ItemMock().AsIntegrationItem(); var action = new CreateSharepointItemAction(new IntegrationItem(sourceItem), synchContext); // Act action.Execute(); action.IsSuccessful.Should().BeTrue(); // Assert pipelines.ShouldReceiveCall <ProcessSharepointItemArgs>( PipelineNames.CreateSharepointItem, x => x.SourceIntegrationItem == sourceItem && x.SourceIntegrationItemTemplateID == sourceItem.TemplateID && x.SynchContext == synchContext); } }
public void should_call_pipeline() { // Arrange using (var pipelines = new PipelinesHandler()) { var deletedItem = new ItemMock(); Item item = new ItemMock().AsConfigurationItem().WithChild(deletedItem); var synchContext = new SynchContext(item); var action = new DeleteIntegrationItemAction(new IntegrationItem(deletedItem), synchContext); // Act action.Execute(); action.IsSuccessful.Should().BeTrue(); // Assert pipelines.ShouldReceiveCall <ProcessIntegrationItemArgs>( PipelineNames.DeleteIntegrationItem, x => x.IntegrationItemID == deletedItem.ID && x.SynchContext == synchContext); } }