Changed layout to match boost

This commit is contained in:
Mathieu Champlon 2015-03-04 06:23:30 +01:00
parent 7a8ba352c6
commit c950c24f52
122 changed files with 15469 additions and 15550 deletions

41
doc/motivation.qbk Normal file
View file

@ -0,0 +1,41 @@
[/
/ Copyright (c) 2014 Mathieu Champlon
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section Motivation]
[import example/motivation.cpp]
[import example/calculator.hpp]
[import example/mock_view.hpp]
[import example/view.hpp]
Consider a (very) simple calculator class :
[simple_calculator]
Obviously writing unit tests for such a class is trivial, one of them could be :
[simple_zero_plus_zero_is_zero]
What now if the calculator class looks more like this :
[view]
[calculator]
Writing unit tests becomes a bit more tedious and requires some boiler-plate code, for instance :
[my_view]
[zero_plus_zero_is_zero_without_mock_object]
Mock objects main purpose is to alleviate the user from the burden of writing all this boiler-plate code.
Here is how the last test can be rewritten using a mock object :
[mock_view]
[zero_plus_zero_is_zero_with_mock_object]
and all the checks are automatically handled by the library.
[endsect]