コード例 #1
0
        public void SaveBatchDataToStoreUpdate()
        {
            var           accountName      = "account";
            int           savePageSize     = 3;
            List <string> noUpsertEntities = null;
            List <string> noUpdateEntities = null;

            var testAccount = new EntityWrapper(new Entity(accountName, Guid.NewGuid()));

            testAccount.OriginalEntity.Attributes["ownerid"] = Guid.NewGuid();
            testAccount.OperationType = OperationType.Update;

            var entityList = new List <EntityWrapper>
            {
                new EntityWrapper(new Entity(accountName, Guid.NewGuid())),
                new EntityWrapper(new Entity(accountName, Guid.NewGuid())),
                testAccount
            };

            systemUnderTest = new DataCrmStoreWriter(MockLogger.Object, MockEntityRepo.Object, savePageSize, noUpsertEntities, noUpdateEntities);

            FluentActions.Invoking(() => systemUnderTest.SaveBatchDataToStore(entityList))
            .Should()
            .NotThrow();
        }
コード例 #2
0
        public void SaveBatchDataToStoreOperationTypeFailed()
        {
            var accountName  = "account";
            int savePageSize = 1;

            var testManyToMany = new EntityWrapper(new Entity("accountcontact", Guid.NewGuid()), true)
            {
                OperationType   = OperationType.Failed,
                OperationResult = "Failed"
            };

            var testAccount = new EntityWrapper(new Entity(accountName, Guid.NewGuid()), true)
            {
                OperationType   = OperationType.Failed,
                OperationResult = "Failed"
            };

            var entityList = new List <EntityWrapper>
            {
                testAccount,
                testManyToMany
            };

            var noUpsertEntities = new List <string>();
            var noUpdateEntities = new List <string>();

            systemUnderTest = new DataCrmStoreWriter(MockLogger.Object, MockEntityRepo.Object, savePageSize, noUpsertEntities, noUpdateEntities);

            FluentActions.Invoking(() => systemUnderTest.SaveBatchDataToStore(entityList))
            .Should()
            .NotThrow();
        }
コード例 #3
0
        public void SaveBatchDataToStore()
        {
            var orgService = ConnectionHelper.GetOrganizationalServiceTarget();
            var entRepo    = new EntityRepository(orgService, retryExecutor);

            DataCrmStoreWriter crmStore = new DataCrmStoreWriter(new ConsoleLogger(), entRepo);

            List <EntityWrapper> toCreate = EntityMockHelper.EntitiesToCreate.Select(p => new EntityWrapper(p)).ToList();

            FluentActions.Invoking(() => crmStore.SaveBatchDataToStore(toCreate))
            .Should()
            .NotThrow();
        }