/Source/Bifrost.Tests/Events/EventMethodBindingTests.cs
C# | 30 lines | 26 code | 4 blank | 0 comment | 0 complexity | 3a702fa582e88f7af69804ac4fdb8aca MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using Bifrost.Events;
- using NUnit.Framework;
-
- namespace Bifrost.Tests.Events
- {
- [TestFixture]
- public class EventMethodBindingTests
- {
- public class MySubscriber : IEventSubscriber
- {
-
- }
-
- [Test]
- public void GenericForSubscriberShouldSetSubscriberTypeCorrectly()
- {
- var binding = new EventMethodBinding();
- binding.ForSubscriber<MySubscriber>();
- Assert.That(binding.Subscriber, Is.EqualTo(typeof(MySubscriber)));
- }
-
- [Test]
- public void ForSubscriberShouldSetSubscriberTypeCorrectly()
- {
- var binding = new EventMethodBinding();
- binding.ForSubscriber(typeof (MySubscriber));
- Assert.That(binding.Subscriber, Is.EqualTo(typeof(MySubscriber)));
- }
- }
- }