Approval testing from basic to advanced
- 4. 1) Numbers
// verify names
assert(5, names.length)
assert(“Llew”, names[0])
assert(“Woody”, names[1])
assert(“Jim”, names[2])
assert(“Jason”, names[3])
assert(“Dan”, names[4])
Can get
complicated
I have to
change my
Scenarios
to make it work
- 6. 2) Strings
// verify names
Assert(
“[Llew, Woody, Jim, Jason, Dan]”,
names.toString())
More expressive
Objects, Tests & Logs
Can use
your
normal
Scenarios
- 7. 2) Strings You’ll start to want
more…
// verify names
Assert(
“[Llew, Woody, Jim, Jason, Dan]”,
names.toString())
- 10. 4) Files
// verify companies as xml
assertFileContains(
“expected.companylist.xml”,
report.toString())
Less Clutter
Can use
your
normal
Scenarios
- 11. 4) Files
// verify companies as xml
assertFileContains(
“expected.companylist.xml”,
report.toString())
Lots of filenames
Creating
The files
- 12. 5)
// verify companies as xml
Verify(report)
Convention over
configuration
Code
starts to
become
trivial
Automatic
names
- 15. See the forest
& the trees
Files not
limited to
text
6) Diff Tools
Can render
html, svg, etc…
(on failure)
- 17. Testing gets
easier & easier7)
Custom Test
Methods
MapReduce.verify(…)
Wpf.verify(…)
Xml.verify(…)
Routing.verify(…)
Tests give
high Return on
Investment
- 18. 1. Numb3rs
2. “Strings”
3. “VeryrnLongrnStrings”
4. Files.txt
5. AutomaticNames()
6. DIFF TOOLS DIFF T00LS
7. Test.CustomVerify()