Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare 0.21.1 #80

Merged
merged 1 commit into from
May 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions test/hex/control/trigger/CommandTriggerAnnotationReplaceTest.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package hex.control.trigger;
import hex.control.trigger.mock.MockAnnotationReplaceController;
import hex.control.trigger.mock.MockModule;
import hex.di.IDependencyInjector;
import hex.di.Injector;
import hex.module.IModule;
import hex.unittest.assertion.Assert;

/**
* ...
* @author
*/
class CommandTriggerAnnotationReplaceTest
{

public function new()
{
}

@Test("Test command trigger and annotation replace in one class")
public function commandTriggerAnnotationReplaceTest()
{
var injector = new Injector();
var module = new MockModule();
injector.mapToValue( IDependencyInjector, injector );
injector.mapToValue( IModule, module );

var injectee = new MockInjectee();
injector.mapToValue(MockInjectee, injectee, "name");

var controller = injector.instantiateUnmapped(MockAnnotationReplaceController);

Assert.isNotNull(controller.mockInjection);
Assert.equals(injectee, controller.mockInjection);

MockCommandClassWithoutParameters.callCount = 0;
controller.print();
Assert.equals( 1, MockCommandClassWithoutParameters.callCount);

controller.printFQCN();
Assert.equals( 2, MockCommandClassWithoutParameters.callCount);

}

}
3 changes: 2 additions & 1 deletion test/hex/control/trigger/MVCTriggerSuite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class MVCTriggerSuite
[
CommandTriggerTest,
CommandTriggerUserCaseTest,
MacroCommandTest
MacroCommandTest,
CommandTriggerAnnotationReplaceTest
];
}
35 changes: 35 additions & 0 deletions test/hex/control/trigger/mock/MockAnnotationReplaceController.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package hex.control.trigger.mock;
import hex.annotation.IAnnotationReplace;
import hex.control.async.Expect;
import hex.control.async.Nothing;
import hex.control.trigger.ICommandTrigger;
import hex.control.trigger.MockCommandClassWithoutParameters;

/**
* ...
* @author
*/
class MockAnnotationReplaceController implements ICommandTrigger implements IAnnotationReplace
{

static var NAME = "name";

public function new()
{
}

@Inject(NAME)
public var mockInjection:MockInjectee;

@Map( hex.control.trigger.MockCommandClassWithoutParameters )
public function printFQCN() : Expect<Nothing>;

@Map( MockCommandClassWithoutParameters )
public function print() : Expect<Nothing>;

}

class MockInjectee
{
public function new(){}
}