Created
July 7, 2011 16:27
-
-
Save DavidArno/1069907 to your computer and use it in GitHub Desktop.
Comparison of multiple assert per test versus single assert per test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public function initialiseSetsUpModelStateAndMap():void | |
{ | |
var model:Model = new Model(); | |
var state:State = new State(); | |
var map:Dictionary = new Dictionary(); | |
initialise(model, state, map); | |
assertThat(_model, strictlyEqualTo(model)); | |
assertThat(_state, strictlyEqualTo(state)); | |
assertThat(_pageMap, strictlyEqualTo(map)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var model:Model; | |
private var state:State; | |
private var map:Dictionary; | |
private function helper():void | |
{ | |
var model:Model = new Model(); | |
var state:State = new State(); | |
var map:Dictionary = new Dictionary(); | |
initialise(model, state, map); | |
} | |
public function initialiseSetsUpModel():void | |
{ | |
helper(); | |
assertThat(_model, strictlyEqualTo(model)); | |
} | |
public function initialiseSetsUpState():void | |
{ | |
helper(); | |
assertThat(_state, strictlyEqualTo(state)); | |
} | |
public function initialiseSetsUpMap():void | |
{ | |
helper(); | |
assertThat(_pageMap, strictlyEqualTo(map)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment