public void Setup() { mockBoot = new Mock<IBootstrapper>(); hub = new GameHub(mockBoot.Object, Mock.Of<IThreadSleeper>()); var mockContext = new Mock<IHubCallerConnectionContext<dynamic>>(); hub.Clients = mockContext.Object; clients = new Mock<IGameClientContract>(); mockContext.Setup(x => x.All).Returns(clients.Object); clients.Setup(x => x.DisplayError(It.IsAny<string>())).Verifiable(); clients.Setup(x => x.DisplayResults(It.IsAny<GameBase>())).Verifiable(); }
/// <summary> /// Disposes the disposable resources used by the NinjectFactory instance. /// </summary> /// <param name="disposing"> /// If true, the disposable resources of the NinjectFactory instance will be disposed. /// </param> protected virtual void Dispose(bool disposing) { if (disposing) { if (hub != null) { hub.Dispose(); hub = null; } } }