Exemple #1
0
        public void DependencyResolverTests_GetService_NotDisposing()
        {
            TestHub hub;

            using (var container = new StashboxContainer())
            {
                container.Register <ITest, Test>();
                container.AddSignalR(typeof(TestHub).Assembly);
                hub = (TestHub)container.Resolve <Microsoft.AspNet.SignalR.IDependencyResolver>().GetService(typeof(TestHub));
            }

            Assert.IsFalse(hub.Disposed);
        }
Exemple #2
0
        public void HubActivatorTests_Create()
        {
            TestHub hub;

            using (var container = new StashboxContainer())
            {
                container.Register <ITest, Test>();
                container.AddSignalR(typeof(TestHub).Assembly);
                hub = (TestHub)container.Resolve <IHubActivator>().Create(new HubDescriptor {
                    HubType = typeof(TestHub)
                });
            }

            Assert.IsFalse(hub.Disposed);
        }