Skip to content

Commit 4855964

Browse files
Merge pull request #90 from StuartFerguson/task/#84_addptoductdetailstosalerequest
Fix nightly build issues
2 parents 2d59959 + a265344 commit 4855964

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

TransactionProcessor.IntegrationTests/Common/EstateDetails.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ public static EstateDetails Create(Guid estateId,
238238
/// <returns></returns>
239239
public Contract GetContract(String contractName)
240240
{
241+
if (this.Contracts.Any() == false)
242+
{
243+
return null;
244+
}
241245
return this.Contracts.Single(c => c.Description == contractName);
242246
}
243247

TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,15 @@ public async Task WhenIPerformTheFollowingTransactions(Table table)
262262
String contractDescription = SpecflowTableHelper.GetStringRowValue(tableRow, "ContractDescription");
263263
String productName = SpecflowTableHelper.GetStringRowValue(tableRow, "ProductName");
264264

265+
Guid contractId = Guid.Empty;
266+
Guid productId = Guid.Empty;
265267
var contract = estateDetails.GetContract(contractDescription);
266-
var product = contract.GetProduct(productName);
268+
if (contract != null)
269+
{
270+
contractId = contract.ContractId;
271+
var product = contract.GetProduct(productName);
272+
productId = product.ProductId;
273+
}
267274

268275
transactionResponse = await this.PerformSaleTransaction(estateDetails.EstateId,
269276
merchantId,
@@ -275,8 +282,8 @@ public async Task WhenIPerformTheFollowingTransactions(Table table)
275282
transactionAmount,
276283
customerAccountNumber,
277284
customerEmailAddress,
278-
contract.ContractId,
279-
product.ProductId,
285+
contractId,
286+
productId,
280287
CancellationToken.None);
281288
break;
282289

0 commit comments

Comments
 (0)