Beispiel #1
0
        public virtual void Process([NotNull] ProcessIntegrationItemArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            Assert.IsNotNull(args.IntegrationItem, "args.IntegrationItem");
            Assert.IsNotNull(args.SourceSharepointItem, "args.SourceSharepointItem");
            Assert.IsNotNull(args.SynchContext, "args.SynchContext");

            IntegrationItemProvider.UpdateFields(args.IntegrationItem, args.SourceSharepointItem, args.SynchContext);
        }
        public void UpdateFields_should_update_guid_field()
        {
            // Arrange
            this.sourceSharepointItem.GUID.Returns("SomeGuid");
            Item targetIntegrationItem = new ItemMock().AsConfigurationItem();

            // Act
            IntegrationItemProvider.UpdateFields(
                targetIntegrationItem,
                this.sourceSharepointItem,
                new SynchContext(targetIntegrationItem));

            // Assert
            targetIntegrationItem.Fields[FieldNames.GUID].Value.Should().Be("SomeGuid");
        }
        public void UpdateFields_should_set_IsIntegration_if_guid_is_empty()
        {
            // Arrange
            Item targetIntegrationItem = new ItemMock().AsConfigurationItem();

            using (new EditContext(targetIntegrationItem))
            {
                new CheckboxField(targetIntegrationItem.Fields[FieldIDs.IsIntegrationItem]).Checked = false;
            }

            // Act
            IntegrationItemProvider.UpdateFields(
                targetIntegrationItem,
                this.sourceSharepointItem,
                new SynchContext(targetIntegrationItem));

            // Assert
            new CheckboxField(targetIntegrationItem.Fields[FieldIDs.IsIntegrationItem]).Checked.Should().BeTrue();
        }