public void should_be_not_successsfull_if_pipeline_throw_exception() { // Arrange using (new PipelinesHandler().ThrowInPipeline(PipelineNames.CreateSharepointItem)) { var synchContext = new SynchContext(new ItemMock().AsConfigurationItem()); Item sourceItem = new ItemMock().AsIntegrationItem(); var action = new CreateSharepointItemAction(new IntegrationItem(sourceItem), synchContext); // Act action.Execute(); // Assert action.IsSuccessful.Should().BeFalse(); } }
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); } }