Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Writing black-box tests

For the purpose of writing our black-box tests, we will start by examining the public interface of the retail package. A quick browse of the retail.go file reveals a NewPriceCalculator function that receives the URLs to the price and vat services as arguments and returns a PriceCalculator instance. The calculator instance can be used to obtain an item's VAT-inclusive price by invoking the PriceForItem method and passing the item's UUID as an argument. On the other hand, if we are interested in obtaining a VAT-inclusive item price for a particular date in the past, we can invoke the PriceForItemAtDate method, which also accepts a time period argument.

The black-box tests will live in a separate package with the name ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content