public void GivenListNumberSearchParams_WhenDinstict_ThenRecordShouldBeDistincted() { List <BulkNumberSearchParamTableTypeV1Row> input = new List <BulkNumberSearchParamTableTypeV1Row>() { new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 1, 1, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 0, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 0, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 1, 0), new BulkNumberSearchParamTableTypeV1Row(0, 0, null, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, null, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 1, null), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 1, 1, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 0, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 0, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 1, 0), new BulkNumberSearchParamTableTypeV1Row(0, 0, null, 1, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, null, 1), new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 1, null), }; Assert.Equal(8, NumberSearchParamsTableBulkCopyDataGenerator.Distinct(input).Count()); }
public static DataTable GenerateNumberSearchParamsTable(int count, long startSurrogatedId, short resoureType, string resourceId = null) { NumberSearchParamsTableBulkCopyDataGenerator generator = new NumberSearchParamsTableBulkCopyDataGenerator(); DataTable result = generator.GenerateDataTable(); for (int i = 0; i < count; ++i) { NumberSearchParamsTableBulkCopyDataGenerator.FillDataTable(result, resoureType, startSurrogatedId + i, new BulkNumberSearchParamTableTypeV1Row(0, 0, 1, 1, 1)); } return(result); }
public SqlResourceBulkImporter( ISqlImportOperation sqlImportOperation, ISqlBulkCopyDataWrapperFactory sqlBulkCopyDataWrapperFactory, IImportErrorSerializer importErrorSerializer, CompartmentAssignmentTableBulkCopyDataGenerator compartmentAssignmentTableBulkCopyDataGenerator, ResourceWriteClaimTableBulkCopyDataGenerator resourceWriteClaimTableBulkCopyDataGenerator, DateTimeSearchParamsTableBulkCopyDataGenerator dateTimeSearchParamsTableBulkCopyDataGenerator, NumberSearchParamsTableBulkCopyDataGenerator numberSearchParamsTableBulkCopyDataGenerator, QuantitySearchParamsTableBulkCopyDataGenerator quantitySearchParamsTableBulkCopyDataGenerator, ReferenceSearchParamsTableBulkCopyDataGenerator referenceSearchParamsTableBulkCopyDataGenerator, ReferenceTokenCompositeSearchParamsTableBulkCopyDataGenerator referenceTokenCompositeSearchParamsTableBulkCopyDataGenerator, StringSearchParamsTableBulkCopyDataGenerator stringSearchParamsTableBulkCopyDataGenerator, TokenDateTimeCompositeSearchParamsTableBulkCopyDataGenerator tokenDateTimeCompositeSearchParamsTableBulkCopyDataGenerator, TokenNumberNumberCompositeSearchParamsTableBulkCopyDataGenerator tokenNumberNumberCompositeSearchParamsTableBulkCopyDataGenerator, TokenQuantityCompositeSearchParamsTableBulkCopyDataGenerator tokenQuantityCompositeSearchParamsTableBulkCopyDataGenerator, TokenSearchParamsTableBulkCopyDataGenerator tokenSearchParamsTableBulkCopyDataGenerator, TokenStringCompositeSearchParamsTableBulkCopyDataGenerator tokenStringCompositeSearchParamsTableBulkCopyDataGenerator, TokenTextSearchParamsTableBulkCopyDataGenerator tokenTextSearchParamsTableBulkCopyDataGenerator, TokenTokenCompositeSearchParamsTableBulkCopyDataGenerator tokenTokenCompositeSearchParamsTableBulkCopyDataGenerator, UriSearchParamsTableBulkCopyDataGenerator uriSearchParamsTableBulkCopyDataGenerator, IOptions <OperationsConfiguration> operationsConfig, ILogger <SqlResourceBulkImporter> logger) { EnsureArg.IsNotNull(sqlImportOperation, nameof(sqlImportOperation)); EnsureArg.IsNotNull(sqlBulkCopyDataWrapperFactory, nameof(sqlBulkCopyDataWrapperFactory)); EnsureArg.IsNotNull(importErrorSerializer, nameof(importErrorSerializer)); EnsureArg.IsNotNull(compartmentAssignmentTableBulkCopyDataGenerator, nameof(compartmentAssignmentTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(resourceWriteClaimTableBulkCopyDataGenerator, nameof(resourceWriteClaimTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(dateTimeSearchParamsTableBulkCopyDataGenerator, nameof(dateTimeSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(numberSearchParamsTableBulkCopyDataGenerator, nameof(numberSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(quantitySearchParamsTableBulkCopyDataGenerator, nameof(quantitySearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(referenceSearchParamsTableBulkCopyDataGenerator, nameof(referenceSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(referenceTokenCompositeSearchParamsTableBulkCopyDataGenerator, nameof(referenceTokenCompositeSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(stringSearchParamsTableBulkCopyDataGenerator, nameof(stringSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(tokenDateTimeCompositeSearchParamsTableBulkCopyDataGenerator, nameof(tokenDateTimeCompositeSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(tokenNumberNumberCompositeSearchParamsTableBulkCopyDataGenerator, nameof(tokenNumberNumberCompositeSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(tokenQuantityCompositeSearchParamsTableBulkCopyDataGenerator, nameof(tokenQuantityCompositeSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(tokenSearchParamsTableBulkCopyDataGenerator, nameof(tokenSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(tokenStringCompositeSearchParamsTableBulkCopyDataGenerator, nameof(tokenStringCompositeSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(tokenTextSearchParamsTableBulkCopyDataGenerator, nameof(tokenTextSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(tokenTokenCompositeSearchParamsTableBulkCopyDataGenerator, nameof(tokenTokenCompositeSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(uriSearchParamsTableBulkCopyDataGenerator, nameof(uriSearchParamsTableBulkCopyDataGenerator)); EnsureArg.IsNotNull(operationsConfig, nameof(operationsConfig)); EnsureArg.IsNotNull(logger, nameof(logger)); _sqlImportOperation = sqlImportOperation; _sqlBulkCopyDataWrapperFactory = sqlBulkCopyDataWrapperFactory; _importErrorSerializer = importErrorSerializer; _generators.Add(compartmentAssignmentTableBulkCopyDataGenerator); _generators.Add(resourceWriteClaimTableBulkCopyDataGenerator); _generators.Add(dateTimeSearchParamsTableBulkCopyDataGenerator); _generators.Add(numberSearchParamsTableBulkCopyDataGenerator); _generators.Add(quantitySearchParamsTableBulkCopyDataGenerator); _generators.Add(referenceSearchParamsTableBulkCopyDataGenerator); _generators.Add(referenceTokenCompositeSearchParamsTableBulkCopyDataGenerator); _generators.Add(stringSearchParamsTableBulkCopyDataGenerator); _generators.Add(tokenDateTimeCompositeSearchParamsTableBulkCopyDataGenerator); _generators.Add(tokenNumberNumberCompositeSearchParamsTableBulkCopyDataGenerator); _generators.Add(tokenQuantityCompositeSearchParamsTableBulkCopyDataGenerator); _generators.Add(tokenSearchParamsTableBulkCopyDataGenerator); _generators.Add(tokenStringCompositeSearchParamsTableBulkCopyDataGenerator); _generators.Add(tokenTextSearchParamsTableBulkCopyDataGenerator); _generators.Add(tokenTokenCompositeSearchParamsTableBulkCopyDataGenerator); _generators.Add(uriSearchParamsTableBulkCopyDataGenerator); _importTaskConfiguration = operationsConfig.Value.Import; _logger = logger; }