public void DataCrmStoreWriterConstructorWithCancellationToken()
        {
            MockCrmStoreWriterConfig.SetupProperty(a => a.SaveBatchSize, 12);
            MockCrmStoreWriterConfig.SetupGet(a => a.NoUpsertEntities).Returns(new List <string>());
            MockCrmStoreWriterConfig.SetupGet(a => a.NoUpdateEntities).Returns(new List <string>());

            FluentActions.Invoking(() => new DataCrmStoreWriter(MockLogger.Object, MockEntityRepo.Object, MockCrmStoreWriterConfig.Object))
            .Should()
            .NotThrow();
        }
        public void DataCrmStoreWriterMultiThreadedSecondConstructorSaveBatchSizeEqualZero()
        {
            MockCrmStoreWriterConfig.SetupGet(a => a.SaveBatchSize).Returns(0);
            MockCrmStoreWriterConfig.SetupGet(a => a.NoUpsertEntities).Returns(new List <string>());
            MockCrmStoreWriterConfig.SetupGet(a => a.NoUpdateEntities).Returns(new List <string>());

            FluentActions.Invoking(() => new DataCrmStoreWriterMultiThreaded(MockLogger.Object, new List <Core.IEntityRepository> {
                MockEntityRepo.Object
            }, null))
            .Should()
            .Throw <ArgumentOutOfRangeException>();
        }
        public void DataCrmStoreWriterMultiThreadedSecondConstructor()
        {
            MockCrmStoreWriterConfig.SetupGet(a => a.SaveBatchSize).Returns(12);
            MockCrmStoreWriterConfig.SetupGet(a => a.NoUpsertEntities).Returns(new List <string>());
            MockCrmStoreWriterConfig.SetupGet(a => a.NoUpdateEntities).Returns(new List <string>());

            FluentActions.Invoking(() => new DataCrmStoreWriterMultiThreaded(MockLogger.Object, new List <Core.IEntityRepository> {
                MockEntityRepo.Object
            }, MockCrmStoreWriterConfig.Object))
            .Should()
            .NotThrow();

            MockCrmStoreWriterConfig.VerifyAll();
        }
        public void CrmDirectMigratorTest2()
        {
            MockCrmStoreReaderConfig.SetupGet(a => a.PageSize).Returns(500);
            MockCrmStoreReaderConfig.SetupGet(a => a.BatchSize).Returns(500);
            MockCrmStoreReaderConfig.SetupGet(a => a.TopCount).Returns(1000);
            MockCrmStoreReaderConfig.SetupGet(a => a.OneEntityPerBatch).Returns(true);
            MockCrmStoreReaderConfig.Setup(a => a.GetFetchXMLQueries()).Returns(new List <string>());

            MockCrmStoreWriterConfig.SetupGet(a => a.SaveBatchSize).Returns(10);

            FluentActions.Invoking(() => new CrmDirectMigrator(MockLogger.Object, MockEntityRepo.Object, MockCrmStoreReaderConfig.Object, MockCrmStoreWriterConfig.Object, MockCrmGenericImporterConfig.Object, CancellationToken.None))
            .Should()
            .NotThrow();
        }