forked from patternpark/asunit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed CallbackBridge because it was no different than a Result. Ren…
…amed CallbackBridge to ResultObserverTest. May merge with the older-style ResultTest later.
- Loading branch information
Robert Penner
committed
Nov 7, 2010
1 parent
4d3708c
commit cc9371b
Showing
6 changed files
with
61 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package asunit.framework { | ||
|
||
import asunit.asserts.*; | ||
import asunit.support.FakeObserver; | ||
import asunit.framework.Result; | ||
|
||
public class ResultObserverTest { | ||
|
||
private var result:Result; | ||
|
||
private var observer:FakeObserver; | ||
|
||
[Before] | ||
public function createObserver():void { | ||
observer = new FakeObserver(); | ||
result = new Result(); | ||
result.addListener(observer); | ||
} | ||
|
||
[After] | ||
public function destroyObserver():void { | ||
observer = null; | ||
} | ||
|
||
[Test] | ||
public function canInstantiate():void { | ||
assertTrue("instance is Result", result is Result); | ||
} | ||
|
||
[Test] | ||
public function addedListenerReceivesOnRunStarted():void { | ||
result.onRunStarted(); | ||
assertTrue(observer.onRunStartedCalled); | ||
} | ||
|
||
[Test] | ||
public function addedListenerReceivesOnTestStarted():void { | ||
result.onTestStarted(null); | ||
assertTrue(observer.onTestStartedCalled); | ||
} | ||
|
||
[Test] | ||
public function shouldHaveDefaultRunCount():void | ||
{ | ||
assertEquals(0, result.runCount); | ||
} | ||
|
||
[Test] | ||
public function shouldHaveCumulativeRunCount():void | ||
{ | ||
result.onTestStarted(null); | ||
result.onTestSuccess(null); | ||
result.onTestCompleted(null); | ||
result.onTestStarted(null); | ||
result.onTestSuccess(null); | ||
result.onTestCompleted(null); | ||
assertEquals(2, result.runCount); | ||
} | ||
|
||
} | ||
} |
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