Skip to content

Latest commit

 

History

History

print-date

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Goal

Be able to test printCurrentDate function without changing the method signature.

  1. Test the code with doubles using a library.
  2. Test the code with doubles created by you.

Code to test

func (printDate PrintDate) PrintCurrentDate() {
    today := printDate.calendar.today()
    printDate.printer.printLine(today.String())
}

Learnings

How to use TBD to generate the doubles.

How to build a Mock and Stub manually.

Tools

Example of spy

TBD

Example of stub

TBD

Authors

Luis Rovirosa @luisrovirosa

Jordi Anguela @jordianguela