GetHub() public method

public GetHub ( string hubName ) : HubDescriptor
hubName string
return HubDescriptor
コード例 #1
0
        public void GetInValidHub()
        {
            var resolver = new DefaultDependencyResolver();
            var hubManager = new DefaultHubManager(resolver);
            var hubDescriptor = hubManager.GetHub("__ELLO__");

            Assert.Null(hubDescriptor);
        }
コード例 #2
0
        public void GetValidHub()
        {
            var resolver = new DefaultDependencyResolver();
            var hubManager = new DefaultHubManager(resolver);
            var hubDescriptor = hubManager.GetHub("CoreTestHub");

            Assert.NotNull(hubDescriptor);
            Assert.False(hubDescriptor.NameSpecified);
        }
コード例 #3
0
        public void ShouldIgnoreCaseWhenDiscoveringHubsUsingManager()
        {
            var resolver = new DefaultDependencyResolver();
            var manager = new DefaultHubManager(resolver);
            var hub = manager.GetHub("hubwithoutattribute");

            Assert.NotNull(hub);
            Assert.Equal(hub.Name, "HubWithoutAttribute");
            Assert.Equal(hub.NameSpecified, false);
        }
コード例 #4
0
        public void EnsureHubSuccessfullyResolves()
        {
            var resolver = new DefaultDependencyResolver();
            var hubManager = new DefaultHubManager(resolver);
            var TestHubName = "CoreTestHubWithMethod";

            HubDescriptor hub = null,
                          actualDescriptor = hubManager.GetHub(TestHubName);

            Assert.DoesNotThrow(() =>
            {
                hub = hubManager.EnsureHub(TestHubName);
            });

            Assert.Equal(hub, actualDescriptor);
        }