PageRenderTime 27ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. using Bifrost.Events;
  2. using NUnit.Framework;
  3. namespace Bifrost.Tests.Events
  4. {
  5. [TestFixture]
  6. public class EventMethodBindingTests
  7. {
  8. public class MySubscriber : IEventSubscriber
  9. {
  10. }
  11. [Test]
  12. public void GenericForSubscriberShouldSetSubscriberTypeCorrectly()
  13. {
  14. var binding = new EventMethodBinding();
  15. binding.ForSubscriber<MySubscriber>();
  16. Assert.That(binding.Subscriber, Is.EqualTo(typeof(MySubscriber)));
  17. }
  18. [Test]
  19. public void ForSubscriberShouldSetSubscriberTypeCorrectly()
  20. {
  21. var binding = new EventMethodBinding();
  22. binding.ForSubscriber(typeof (MySubscriber));
  23. Assert.That(binding.Subscriber, Is.EqualTo(typeof(MySubscriber)));
  24. }
  25. }
  26. }