public void AddHandler_SingleName_AddsDifferentNames() { _ = TestHelper.GetBilgeAndClearDown(); Bilge.AddHandler(new MockMessageHandler("arfle"), HandlerAddOptions.SingleName); Bilge.AddHandler(new MockMessageHandler("barfle"), HandlerAddOptions.SingleName); var ct = Bilge.GetHandlers().Count(); Assert.Equal(2, ct); }
public void AddHandler_SingleName_DoesNotAddSecondName() { _ = TestHelper.GetBilgeAndClearDown(); Bilge.AddHandler(new MockMessageHandler("arfle"), HandlerAddOptions.SingleName); Bilge.AddHandler(new MockMessageHandler("arfle"), HandlerAddOptions.SingleName); var ct = Bilge.GetHandlers().Count(); Assert.Equal(1, ct); }
public void AddHandler_SingleType_AddsDifferentTypes() { _ = TestHelper.GetBilgeAndClearDown(); Bilge.AddHandler(new MockMessageHandler(), HandlerAddOptions.SingleType); Bilge.AddHandler(new InMemoryHandler(), HandlerAddOptions.SingleType); var ct = Bilge.GetHandlers().Count(); Assert.Equal(2, ct); }
public void AddHandler_DoesAddHandler() { _ = TestHelper.GetBilgeAndClearDown(); bool worked = Bilge.AddHandler(new MockMessageHandler()); var count = Bilge.GetHandlers().Count(); Assert.True(worked); Assert.Equal(1, count); }
public void GetHandlers_FilterReturnsNamed() { _ = TestHelper.GetBilgeAndClearDown(); Bilge.AddHandler(new MockMessageHandler("arfle")); Bilge.AddHandler(new MockMessageHandler("barfle")); var count = Bilge.GetHandlers("arf*").Count(); Assert.Equal(1, count); }
public void GetHandlers_DefaultReturnsAll() { _ = TestHelper.GetBilgeAndClearDown(); Bilge.AddHandler(new MockMessageHandler()); Bilge.AddHandler(new MockMessageHandler()); Bilge.AddHandler(new MockMessageHandler()); Bilge.AddHandler(new MockMessageHandler()); Assert.Equal(4, Bilge.GetHandlers().Count()); }
public void AddHandler_DuplicateByNameFailsOnSecond() { _ = TestHelper.GetBilgeAndClearDown(); Bilge.AddHandler(new MockMessageHandler()); Bilge.AddHandler(new MockMessageHandler()); var ct = Bilge.GetHandlers().Count(); Assert.Equal(2, Bilge.GetHandlers().Count()); }
public void AddHandler_DuplicateAddsTwoHandlers() { _ = TestHelper.GetBilgeAndClearDown(); bool worked = Bilge.AddHandler(new MockMessageHandler()); worked &= Bilge.AddHandler(new MockMessageHandler()); Assert.True(worked); var ct = Bilge.GetHandlers().Count(); Assert.Equal(2, ct); }