Example #1
0
        public void should_be_not_successsfull_if_pipeline_throw_exception()
        {
            // Arrange
            using (new PipelinesHandler().ThrowInPipeline(PipelineNames.UpdateSharepointItem))
            {
                var synchContext = new SynchContext(new ItemMock().AsConfigurationItem());
                var action       = new UpdateSharepointItemAction(TestHelper.CreateSharepointItem(), new IntegrationItem(new ItemMock().AsIntegrationItem()), synchContext);

                // Act
                action.Execute();

                // Assert
                action.IsSuccessful.Should().BeFalse();
            }
        }
Example #2
0
        public void should_call_pipeline()
        {
            // Arrange
            using (var pipelines = new PipelinesHandler())
            {
                var  updateItem     = new ItemMock();
                Item item           = new ItemMock().AsConfigurationItem().WithChild(updateItem);
                var  synchContext   = new SynchContext(item);
                var  sharepointItem = TestHelper.CreateSharepointItem();

                var action = new UpdateSharepointItemAction(sharepointItem, new IntegrationItem(updateItem), synchContext);

                // Act
                action.Execute();
                action.IsSuccessful.Should().BeTrue();

                // Assert
                pipelines.ShouldReceiveCall <ProcessSharepointItemArgs>(
                    PipelineNames.UpdateSharepointItem,
                    x => x.SharepointItem == sharepointItem && x.SourceIntegrationItem == (Item)updateItem &&
                    x.SynchContext == synchContext);
            }
        }