public Modification_Of_Multiple_Transactions(ITestOutputHelper testOutputHelper) { _testOutputHelper = testOutputHelper; _testOutputHelper.WriteLine($"Preparing test transaction {DateTime.Now:dd.MM.yyyy HH:mm:ss.ffffff}"); _testOutputHelper.WriteLine($"-> {numberOfCoreChanges} transactions with modification of CORE data"); _testOutputHelper.WriteLine($"-> {numberOfPersonsChanges} transactions with modification of DISPOSERS data"); _testOutputHelper.WriteLine($"-> {numberOfAmlChanges} transactions with modification of AML related data"); _testOutputHelper.WriteLine($"-> {numberOfStirChanges} transactions with modification of STIR related data"); // prepare test transactions referencePrefix = $"{DateTime.Now:yyyy-MM-dd hh:mm:ss.ffff}"; List <Transaction> transactions = new List <Transaction>(); for (int i = 0; i < numberOfCoreChanges; i++) { var referenceCore = $"{referencePrefix} Core {Guid.NewGuid()}".Substring(0, 40); var transaction = generator.CreateTransactionWithCoreData(referenceCore, AmlExportStatusEnum.Sent, StirExportStatusEnum.Sent, new int[] { 4, 1, 2, 3 }, "xxxx"); transactions.Add(transaction); } for (int i = 0; i < numberOfPersonsChanges; i++) { var referencePersons = $"{referencePrefix} Persons {Guid.NewGuid()}".Substring(0, 40); var transaction = generator.CreateTransactionWithPersonsData(referencePersons, AmlExportStatusEnum.Sent, StirExportStatusEnum.Sent); transactions.Add(transaction); } for (int i = 0; i < numberOfAmlChanges; i++) { var referenceAml = $"{referencePrefix} Aml {Guid.NewGuid()}".Substring(0, 40); var transaction = generator.CreateTransactionWithAmlData(referenceAml, AmlExportStatusEnum.Sent, StirExportStatusEnum.Sent, new int[] { 4, 1, 3 }, "xxxx"); transactions.Add(transaction); } for (int i = 0; i < numberOfStirChanges; i++) { var referenceStir = $"{referencePrefix} Stir {Guid.NewGuid()}".Substring(0, 40); var transaction = generator.CreateTransactionWithStirData(referenceStir, AmlExportStatusEnum.Sent, StirExportStatusEnum.Sent, new int[] { 4, 1, 3 }, "xxxx"); transactions.Add(transaction); } _testOutputHelper.WriteLine($"Saving test transaction [= START =] {DateTime.Now:dd.MM.yyyy HH:mm:ss.ffffff}"); using (var context = new FirContext()) { context.AddRange(transactions); context.SaveChanges(); } _testOutputHelper.WriteLine($"Saving test transaction [== END ==] {DateTime.Now:dd.MM.yyyy HH:mm:ss.ffffff}"); }
internal void PrepareTransactionWithCoreData(string reference, AmlExportStatusEnum amlExportStatus, StirExportStatusEnum stirExportStatus, int[] personsIds, string paymentDetails1) { _dbContext.Transactions.Add(CreateTransactionWithCoreData(reference, amlExportStatus, stirExportStatus, personsIds, paymentDetails1)); _dbContext.SaveChanges(); }