-
-
Save neilmanuell/1002629 to your computer and use it in GitHub Desktop.
I don't understand why one assert per test is superior
This file contains 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
// the code | |
class eg | |
{ | |
public var width:int; | |
public var height:int; | |
public function eg(width:int, height:int) | |
{ | |
this.width = width; | |
this.height = height; | |
} | |
public function clone():eg | |
{ | |
return new eg(width, height); | |
} | |
} | |
// the test | |
[Test] | |
public function a_clone_is_the_same_width_as_its_parent():void | |
{ | |
a = new eg(123, 321); | |
b = a.clone(); | |
assertEquals(a.width, b.width); | |
} | |
[Test] | |
public function a_clone_is_the_same_height_as_its_parent():void | |
{ | |
a = new eg(123, 321); | |
b = a.clone(); | |
assertEquals(a.height, b.height); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
now if one fails, the tests name will tell you which one with out having to write fail messages.