Skip to content

Commit 94d3759

Browse files
committed
small test update.
1 parent fca7e0f commit 94d3759

File tree

5 files changed

+117
-4
lines changed

5 files changed

+117
-4
lines changed

test/suites/AllTestSuites.as

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package suites {
22
import suites.commandMap.CommandMapTests;
3+
import suites.commands.CommandsTests;
34
import suites.fatureGetProxy.FeatureGetProxyTests;
45
import suites.general.GeneralTests;
56
import suites.mediatorMap.MediatorMapTests;
67
import suites.mediators.MediatorTests;
78
import suites.messenger.MessengerTests;
89
import suites.modules.ModularTests;
10+
import suites.proxies.ProxyTests;
911
import suites.proxyMap.NamedInterfacedProxyMapTests;
1012
import suites.proxyMap.ProxyMapTests;
1113
import suites.utils.UtilsTests;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,41 @@
11
package suites.commands {
2+
import org.flexunit.Assert;
23

34
/**
45
* COMMENT
56
* @author
67
*/
78
public class CommandsTests {
9+
10+
[Before]
11+
12+
public function runBeforeEveryTest():void {
13+
14+
}
15+
16+
[After]
17+
18+
public function runAfterEveryTest():void {
19+
20+
}
21+
22+
[Test]
23+
[Ignore]
24+
public function mediator_instantiate():void {
25+
26+
}
27+
28+
[Test]
29+
[Ignore]
30+
public function mediator_send_message():void {
31+
32+
}
33+
34+
[Test]
35+
[Ignore]
36+
public function mediator_send_message_to_all():void {
37+
38+
}
839

940
}
1041
}

test/suites/mediators/MediatorTests.as

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class MediatorTests {
3939

4040
public function runAfterEveryTest():void {
4141
use namespace pureLegsCore;
42+
mediatorMap.unmediate(testView);
4243
messenger = null;
4344
proxyMap = null;
4445
mediatorMap = null;
@@ -49,10 +50,12 @@ public class MediatorTests {
4950

5051
public function mediator_constructor_fails():void {
5152
new MediatorSpriteMediator();
52-
}
53-
54-
53+
}
5554

55+
[Test]
56+
public function mediator_isReady():void {
57+
Assert.assertTrue("After view mediating mediator isReady must be true.", MediatorSpriteMediator.instance.getIsReady());
58+
}
5659

5760
[Test(expects="Error")]
5861

@@ -63,6 +66,28 @@ public class MediatorTests {
6366
throw Error("Debug mode is needed for this test.");
6467
}
6568
}
69+
70+
71+
//[Test]
72+
//[Ignore]
73+
//public function mediator_add_listener():void {
74+
//
75+
//}
76+
//
77+
//[Test]
78+
//[Ignore]
79+
//public function mediator_remove_listener():void {
80+
//
81+
//}
82+
//
83+
//[Test]
84+
//[Ignore]
85+
//public function mediator_remove_all_listeners():void {
86+
//
87+
//}
88+
89+
90+
6691

6792
[Test]
6893

@@ -100,6 +125,19 @@ public class MediatorTests {
100125
}
101126
}
102127

128+
//[Test]
129+
//[Ignore]
130+
//public function mediator_remove_handler():void {
131+
//
132+
//}
133+
//
134+
//
135+
//[Test]
136+
//[Ignore]
137+
//public function mediator_remove_all_handler():void {
138+
//
139+
//}
140+
103141

104142
}
105143
}

test/suites/proxies/ProxyTests.as

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
package suites.proxies {
2+
import org.flexunit.Assert;
23

34
/**
45
* COMMENT
56
* @author
67
*/
78
public class ProxyTests {
8-
9+
10+
[Before]
11+
12+
public function runBeforeEveryTest():void {
13+
14+
}
15+
16+
[After]
17+
18+
public function runAfterEveryTest():void {
19+
20+
}
21+
22+
[Test]
23+
[Ignore]
24+
public function proxy_is_ready():void {
25+
26+
}
27+
28+
[Test]
29+
[Ignore]
30+
public function proxy_send_message():void {
31+
32+
}
33+
34+
[Test]
35+
[Ignore]
36+
public function proxy_send_message_to_all():void {
37+
38+
}
939
}
1040
}

test/suites/testObjects/view/MediatorSpriteMediator.as

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import suites.TestViewEvent;
1111
*/
1212
public class MediatorSpriteMediator extends Mediator {
1313

14+
static public var instance:MediatorSpriteMediator;
15+
1416
[Inject]
1517
public var view:MediatorSprite;
1618

@@ -23,6 +25,12 @@ public class MediatorSpriteMediator extends Mediator {
2325
addHandler("test_handler_two_params_one_optional", handleTestWithTwoParamsOneOptional);
2426

2527
view.addEventListener(TestViewEvent.TRIGER_ADD_HANDLER, addTestHandler);
28+
29+
MediatorSpriteMediator.instance = this;
30+
}
31+
32+
override public function onRemove():void {
33+
MediatorSpriteMediator.instance = null;
2634
}
2735

2836
private function addTestHandler(event:Event):void {
@@ -52,6 +60,10 @@ public class MediatorSpriteMediator extends Mediator {
5260
public function handleTestWithTwoParamsOneOptional(params:Object, extraParam:String = null):void {
5361

5462
}
63+
64+
public function getIsReady():Boolean {
65+
return this.isReady;
66+
}
5567

5668
}
5769
}

0 commit comments

Comments
 (0)