Ejemplo n.º 1
0
        public void HubsAreMockableViaDynamic()
        {
            Guid boardGuid   = new Guid("f990354c-f904-420c-a297-2cbb96d25a17");
            bool sendCalled  = false;
            var  hub         = new WeSketchSignalRHub();
            var  mockClients = new Mock <IHubCallerConnectionContext <dynamic> >();

            hub.Clients = mockClients.Object;
            dynamic all = new ExpandoObject();

            all.broadcastMessage = new Action <string, string>((name, message) => {
                sendCalled = true;
            });
            mockClients.Setup(m => m.All).Returns((ExpandoObject)all);
            hub.SendInvitation("TesterExists", boardGuid);
            Assert.True(sendCalled);
        }
Ejemplo n.º 2
0
 public void SetUpTests()
 {
     _hub = new WeSketchSignalRHub();
 }