PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Bifrost.Tests/Events/EventMethodBindingTests.cs

#
C# | 30 lines | 26 code | 4 blank | 0 comment | 0 complexity | 3a702fa582e88f7af69804ac4fdb8aca MD5 | raw file
 1using Bifrost.Events;
 2using NUnit.Framework;
 3
 4namespace Bifrost.Tests.Events
 5{
 6	[TestFixture]
 7	public class EventMethodBindingTests
 8	{
 9		public class MySubscriber : IEventSubscriber
10		{
11			
12		}
13
14		[Test]
15		public void GenericForSubscriberShouldSetSubscriberTypeCorrectly()
16		{
17			var binding = new EventMethodBinding();
18			binding.ForSubscriber<MySubscriber>();
19			Assert.That(binding.Subscriber, Is.EqualTo(typeof(MySubscriber)));
20		}
21
22		[Test]
23		public void ForSubscriberShouldSetSubscriberTypeCorrectly()
24		{
25			var binding = new EventMethodBinding();
26			binding.ForSubscriber(typeof (MySubscriber));
27			Assert.That(binding.Subscriber, Is.EqualTo(typeof(MySubscriber)));
28		}
29	}
30}