-
Notifications
You must be signed in to change notification settings - Fork 3
Introduction
BOREDOOM WARNING: The code has lots of examples, feel free to look at the code first :).
MavenThought Testing aims to facilitate writing tests to encourage and support a "Given, When, Then" way of thinking the test.
The way I use it is by writing first a base specification and then different scenarios that inherit the specification.
For example for the MovieLibrary class I would have the following:
- MovieLibrarySpecification
- When_movie_library_adds_a_movie
- When_movie_library_clears_contents
- When_movie_library_etc_etc_etc
I use the VSCommands add in for VS to group files together. That way you always have the specifications and under it all the scenarios.
##How to start##
If you are eager to start writing a test, choose one of the following categories and read the example, that's the quickest way.
-
I want to test a class without interface (concrete): You just have a class that you want to test, it doesn't implement any interfaces or you don't care about them. You want to make changes to the class and not interfaces or base classes.
-
I want to test a class with an interface (or contract): In this case you have a class and an interface that you want to modify while writing your tests. That means that every change you'll will be reflected in the interface.
-
I want to test a static class: In this case you have static methods to test, no instance.