Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,10 @@ public async Task FactTransactionsControllerController_GetMerchantsByLastDaleDat
await ClearStandingData();

// Last Hour
await helper.AddMerchant("Test Estate", "Merchant 1", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 2", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 3", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 4", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 1", todaysDateTime);
await helper.AddMerchant("Test Estate", "Merchant 2", todaysDateTime);
await helper.AddMerchant("Test Estate", "Merchant 3", todaysDateTime);
await helper.AddMerchant("Test Estate", "Merchant 4", todaysDateTime);

// Yesterday
await helper.AddMerchant("Test Estate", "Merchant 5", todaysDateTime.AddDays(-1));
Expand Down Expand Up @@ -736,10 +736,10 @@ public async Task FactTransactionsControllerController_GetMerchantsTransactionKp
await ClearStandingData();

// Last Hour
await helper.AddMerchant("Test Estate", "Merchant 1", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 2", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 3", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 4", todaysDateTime.AddMinutes(-10));
await helper.AddMerchant("Test Estate", "Merchant 1", todaysDateTime);
await helper.AddMerchant("Test Estate", "Merchant 2", todaysDateTime);
await helper.AddMerchant("Test Estate", "Merchant 3", todaysDateTime);
await helper.AddMerchant("Test Estate", "Merchant 4", todaysDateTime);

// Yesterday
await helper.AddMerchant("Test Estate", "Merchant 5", todaysDateTime.AddDays(-1));
Expand Down Expand Up @@ -1324,7 +1324,7 @@ public async Task FactTransactionsControllerController_TodaysFailedSales_SalesRe
foreach ((Guid productId, String productName, Decimal? productValue) product in productList) {
var transactionCount = transactionCounts.Single(m => m.Key == merchant.Name).Value;
for (int i = 0; i < transactionCount; i++) {
Transaction transaction = await helper1.BuildTransactionX(todaysDateTime.AddHours(-1), merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
Transaction transaction = await helper1.BuildTransactionX(todaysDateTime, merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
todaysTransactions.Add(transaction);
}
}
Expand All @@ -1340,7 +1340,7 @@ public async Task FactTransactionsControllerController_TodaysFailedSales_SalesRe
foreach ((Guid productId, String productName, Decimal? productValue) product in productList) {
var transactionCount = transactionCounts.Single(m => m.Key == merchant.Name).Value;
for (int i = 0; i < transactionCount; i++) {
Transaction transaction = await helper1.BuildTransactionX(comparisonDate.AddHours(-1), merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
Transaction transaction = await helper1.BuildTransactionX(comparisonDate, merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
comparisonDateTransactions.Add(transaction);
}
}
Expand Down Expand Up @@ -1870,4 +1870,4 @@ public async Task FactTransactionsController_TransactionSearch_SortingTest_Trans
searchResult[1].TransactionAmount.ShouldBe(200);
searchResult[2].TransactionAmount.ShouldBe(100);
}
}*/
}*/
16 changes: 5 additions & 11 deletions EstateReportingAPI.IntegrationTests/MerchantEndpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,19 @@ public async Task MerchantEndpoint_GetMerchantKpis_MerchantKpisReturned()
await this.helper.AddMerchant("Test Estate", $"Test Merchant 1",100, now, now,
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);
await this.helper.AddMerchant("Test Estate", $"Test Merchant 2", 200, now, now.AddMinutes(-10),
await this.helper.AddMerchant("Test Estate", $"Test Merchant 2", 200, now, now,
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);
await this.helper.AddMerchant("Test Estate", $"Test Merchant 3",300, now, now.AddHours(-2),
await this.helper.AddMerchant("Test Estate", $"Test Merchant 3",300, now, now.AddDays(-1),
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);
await this.helper.AddMerchant("Test Estate", $"Test Merchant 4",400, now, now.AddHours(-3),
await this.helper.AddMerchant("Test Estate", $"Test Merchant 4",400, now, now.AddDays(-2),
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);
await this.helper.AddMerchant("Test Estate", $"Test Merchant 5",500, now, now.AddDays(-2),
await this.helper.AddMerchant("Test Estate", $"Test Merchant 5",500, now, now.AddDays(-3),
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);
await this.helper.AddMerchant("Test Estate", $"Test Merchant 6",600, now, now.AddDays(-1),
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);
await this.helper.AddMerchant("Test Estate", $"Test Merchant 7",700, now, now.AddDays(-3),
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);
await this.helper.AddMerchant("Test Estate", $"Test Merchant 8",800, now, now.AddDays(-10),
await this.helper.AddMerchant("Test Estate", $"Test Merchant 6",600, now, now.AddDays(-10),
("Address Line 1", $"Test Town", $"TE57 1NG", $"Region"),
("Contact 1", "1@2.com", "123456"), devices: ["123456"]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public async Task TransactionsEndpoint_TodaysFailedSales_SalesReturned() {
var comparisonDateTransactions = new List<Transaction>();
//DatabaseHelper helper1 = new DatabaseHelper(context);
// TODO: make counts dynamic
DateTime todaysDateTime = DateTime.Now;
DateTime todaysDateTime = DateTime.Now.Date;
//todaysDateTime = todaysDateTime.AddHours(12).AddMinutes(30);

Dictionary<string, int> transactionCounts = new() { { "Test Merchant 1", 3 }, { "Test Merchant 2", 6 }, { "Test Merchant 3", 2 }, { "Test Merchant 4", 0 } };
Expand All @@ -293,7 +293,7 @@ public async Task TransactionsEndpoint_TodaysFailedSales_SalesReturned() {
foreach ((Guid productId, String productName, Decimal? productValue, Int32 contractProductReportingId) product in productList) {
var transactionCount = transactionCounts.Single(m => m.Key == merchant.Name).Value;
for (int i = 0; i < transactionCount; i++) {
Transaction transaction = await this.helper.BuildTransactionX(todaysDateTime.AddHours(-1), merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
Transaction transaction = await this.helper.BuildTransactionX(todaysDateTime, merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
todaysTransactions.Add(transaction);
}
}
Expand All @@ -309,7 +309,7 @@ public async Task TransactionsEndpoint_TodaysFailedSales_SalesReturned() {
foreach ((Guid productId, String productName, Decimal? productValue, Int32 contractProductReportingId) product in productList) {
var transactionCount = transactionCounts.Single(m => m.Key == merchant.Name).Value;
for (int i = 0; i < transactionCount; i++) {
Transaction transaction = await this.helper.BuildTransactionX(comparisonDate.AddHours(-1), merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
Transaction transaction = await this.helper.BuildTransactionX(comparisonDate, merchant.MerchantId, contract.operatorId, contract.contractId, product.productId, "1009", product.productValue);
comparisonDateTransactions.Add(transaction);
}
}
Expand Down
Loading