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
4 changes: 4 additions & 0 deletions TransactionProcessor.IntegrationTests/Common/EstateDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ public static EstateDetails Create(Guid estateId,
/// <returns></returns>
public Contract GetContract(String contractName)
{
if (this.Contracts.Any() == false)
{
return null;
}
return this.Contracts.Single(c => c.Description == contractName);
}

Expand Down
13 changes: 10 additions & 3 deletions TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,15 @@ public async Task WhenIPerformTheFollowingTransactions(Table table)
String contractDescription = SpecflowTableHelper.GetStringRowValue(tableRow, "ContractDescription");
String productName = SpecflowTableHelper.GetStringRowValue(tableRow, "ProductName");

Guid contractId = Guid.Empty;
Guid productId = Guid.Empty;
var contract = estateDetails.GetContract(contractDescription);
var product = contract.GetProduct(productName);
if (contract != null)
{
contractId = contract.ContractId;
var product = contract.GetProduct(productName);
productId = product.ProductId;
}

transactionResponse = await this.PerformSaleTransaction(estateDetails.EstateId,
merchantId,
Expand All @@ -275,8 +282,8 @@ public async Task WhenIPerformTheFollowingTransactions(Table table)
transactionAmount,
customerAccountNumber,
customerEmailAddress,
contract.ContractId,
product.ProductId,
contractId,
productId,
CancellationToken.None);
break;

Expand Down