Exemple #1
0
        public void ConvertEntities()
        {
            var entityName = "account";
            var guidList   = new List <Guid>();
            var entitylist = new List <CrmEntityStore>();

            for (int i = 0; i < 5; i++)
            {
                var id = Guid.NewGuid();
                guidList.Add(id);
                entitylist.Add(new CrmEntityStore(new Entity(entityName, id)));
            }

            var actual = EntityConverterHelper.ConvertEntities(entitylist);

            actual.Count.Should().Be(entitylist.Count);

            for (int i = 0; i < 5; i++)
            {
                var           id   = guidList[i];
                EntityWrapper item = null;
                FluentActions.Invoking(() => item = actual.First(a => a.Id.ToString() == id.ToString()))
                .Should()
                .NotThrow();

                item.LogicalName.Should().Be(entityName);
            }
        }
Exemple #2
0
        public List <EntityWrapper> ReadBatchDataFromStore()
        {
            currentBatchNo++;

            logger.LogVerbose($"DataFileStoreReader ReadBatchDataFromStore started, batchNo:{currentBatchNo}");

            try
            {
                var dataStore = ReadCrmExportedDataStore(currentBatchNo);

                if (dataStore != null)
                {
                    return(EntityConverterHelper.ConvertEntities(dataStore.ExportedEntities));
                }

                return(new List <EntityWrapper>());
            }
            finally
            {
                logger.LogVerbose($"DataFileStoreReader ReadBatchDataFromStore finsihed, batchNo:{currentBatchNo}");
            }
        }