mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
- Some more tests around parameter order in event handler dispatch.
--HG-- branch : dev
This commit is contained in:
@@ -60,6 +60,16 @@ namespace Orchard.Tests.Events {
|
||||
Assert.That(_eventHandler.Result, Is.EqualTo(2600));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EventParametersArePassedInCorrectOrderToEventHandlers() {
|
||||
Assert.That(_eventHandler.Result, Is.EqualTo(0));
|
||||
Dictionary<string, object> arguments = new Dictionary<string, object>();
|
||||
arguments["a"] = 2600;
|
||||
arguments["b"] = 5200;
|
||||
_eventBus.Notify("ITestEventHandler.Substract", arguments);
|
||||
Assert.That(_eventHandler.Result, Is.EqualTo(-2600));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EventBusThrowsIfMessageNameIsNotCorrectlyFormatted() {
|
||||
Assert.Throws<ArgumentException>(() => _eventBus.Notify("StubEventHandlerIncrement", new Dictionary<string, object>()));
|
||||
|
Reference in New Issue
Block a user