Exemplo n.º 1
0
        public void SendServerMessageA()
        {
            ClientProxy.ClientMethodA();
            Client.WaitForMethodCall();

            Assert.IsTrue(Client.MethodCalls.Any());
            Assert.AreEqual(Client.MethodCalls[0].MethodName, nameof(ClientMock.ClientMethodA));
        }
Exemplo n.º 2
0
        public void PerformanceTest()
        {
            int count = 100;
            var sw    = Stopwatch.StartNew();

            for (int i = 0; i < count; i++)
            {
                ClientProxy.ClientMethodA();
            }
            sw.Stop();
            for (int i = 0; i < 5000; i++) // 5 sec
            {
                Thread.Sleep(1);
                if (Client.MethodCalls.Count == count)
                {
                    break;
                }
            }
            Assert.AreEqual(Client.MethodCalls.Count, count);
            Console.WriteLine(sw.Elapsed);
        }