public void TestNameLookup() { var messageType = MessageHierarchy.GetTypeByName("Message"); Assert.Equal(typeof(Message), messageType); var childMessageType = MessageHierarchy.GetTypeByName("Event"); Assert.Equal(typeof(Event), childMessageType); }
public void can_dynamicly_add_types_without_clearing_handlers() { var bus = InMemoryBus.CreateTest(); var fired = false; bus.Subscribe(new AdHocHandler <TestMsg>(m => fired = true)); bus.Publish(new TestMsg()); Assert.True(fired); AppDomain.CurrentDomain.Load(GetDynamicAssembly().GetName()); var messageType = MessageHierarchy.GetTypeByName("DynamicMessage"); Assert.Equal("DynamicMessage", messageType[0].Name); Assert.True(messageType.Count == 1); fired = false; bus.Publish(new TestMsg()); AssertEx.IsOrBecomesTrue(() => fired); }