public void GenerarQRTest() { bool sendCalled = false; var hub = new MoneyPointsHub(); var mockClients = new Mock<IHubCallerConnectionContext<dynamic>>(); hub.Clients = mockClients.Object; dynamic all = new ExpandoObject(); all.acceptQR = new Action<string>((message) => { sendCalled = true; }); mockClients.Setup(m => m.All).Returns((ExpandoObject)all); hub.GenerarQR("1128268719", 20000); Assert.IsTrue(sendCalled); }