Esempio n. 1
0
        public void SessionManagerExtensionsTests_GetHandlersForEvent()
        {
            var typeName = "tName";
            var sm       = new Mock <ISubscriptionsManager>();

            sm.Setup(s => s.GetEventKey(It.IsAny <Type>())).Returns(typeName);

            SubscriptionsManagerExtensions.GetHandlersForEvent <TestIntegrationEvent>(sm.Object);
            sm.Verify(s => s.GetHandlersForEvent(It.Is <string>(s1 => s1 == typeName)), Times.Once);
        }
Esempio n. 2
0
        public void SubscriptionManagerExtensions_GetEventKey()
        {
            var tName = "dadada";
            var sm    = new Mock <ISubscriptionsManager>();

            sm.Setup(s => s.GetEventKey(It.IsAny <Type>())).Returns(tName);
            var key = SubscriptionsManagerExtensions.GetEventKey <string>(sm.Object);

            key.ShouldBe(tName);
            sm.Verify(s => s.GetEventKey(It.Is <Type>(t => t == typeof(string))), Times.Once);
        }