File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
TransactionProcessor.IntegrationTests Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments