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 bool Equals(UpdateIntegrationItemAction other) { if (other == null) { return(false); } if (other.SharepointItem == null) { return(this.SharepointItem == null); } return(other.SharepointItem.GUID == this.SharepointItem.GUID); }
public void should_be_not_successsfull_if_pipeline_throw_exception() { // Arrange using (new PipelinesHandler().ThrowInPipeline(PipelineNames.UpdateIntegrationItem)) { var synchContext = new SynchContext(new ItemMock().AsConfigurationItem()); var action = new UpdateIntegrationItemAction(new IntegrationItem(new ItemMock().AsIntegrationItem()), TestHelper.CreateSharepointItem(), synchContext, new ProcessIntegrationItemsOptions()); // Act action.Execute(); // Assert action.IsSuccessful.Should().BeFalse(); } }