This step by step code work TDD workshop
The same task solved with test-after and test-before approaches.
The task is:
Check if the number is perfect number.
The number is perfect if sum of its factors (number itself not included) is equal to number
For example: 6 is perfect number 6 = 1 + 2 + 3