Пример #1
0
        public void should_be_not_successsfull_if_pipeline_throw_exception()
        {
            // Arrange
            using (new PipelinesHandler().ThrowInPipeline(PipelineNames.CreateIntegrationItem))
            {
                var synchContext = new SynchContext(new ItemMock().AsConfigurationItem());
                var action       = new CreateIntegrationItemAction(TestHelper.CreateSharepointItem(), synchContext, ProcessIntegrationItemsOptions.DefaultOptions);

                // Act
                action.Execute();

                // Assert
                action.IsSuccessful.Should().BeFalse();
            }
        }
Пример #2
0
        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);
            }
        }