Created
May 7, 2010 19:20
-
-
Save kkozmic/393894 to your computer and use it in GitHub Desktop.
Fluent API for current functionality of Windsor's EventWiringFacility
This file contains hidden or 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
[Test] | |
public void Single_publisher_single_subscriber_single_event() | |
{ | |
container.Register( | |
Component.For<SimplePublisher>() | |
.PublishEvent(p => p.Event += null) | |
.ToSubscribers( | |
EventSubscriber | |
.Named("foo") | |
.HandledBy<SimpleListener>(l => l.OnPublish(null, null))), | |
Component.For<SimpleListener>().Named("foo")); | |
var subscriber = container.Resolve<SimpleListener>("foo"); | |
var publisher = container.Resolve<SimplePublisher>(); | |
publisher.Trigger(); | |
Assert.IsTrue(subscriber.Listened); | |
Assert.AreSame(publisher, subscriber.Sender); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment