Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jakzal/contract-test-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contract Test Examples

This repository contains examples of Contract Tests in various programming languages.

Examples

Trading

This example is loosely based on the TradeOrderRepository found in the "Domain-Driven Design: Tackling Complexity in the Heart of Software" book by Eric Evans.

Implement the TradeOrderRepository with a database storage. The repository should have two methods:

  • forTrackingId(String): TradeOrder - takes the tracking ID and returns a TradeOrder. forTrackingId

  • outstandingForBrokerageAccountId(String): List<TradeOrder> - takes the brokerage account ID and returns a list of TradeOrders outstandingForBrokerageAccountId

The expected behaviour of TradeOrderRepository methods:

  • forTrackingId
    • returns the TradeOrder if it exists for the given tracking ID
    • returns null if the TradeOrder is not found for the given tracking ID (alternatively, expect an exception)
  • outstandingForBrokerageAccountId
    • returns all outstanding TradeOrders for the given account ID
    • returns an empty list if no TradeOrder was found for the given account ID

Solutions

About

Examples of contract tests in various programming languages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages