예제 #1
0
        public void SendServerMessageA()
        {
            var result = ServerProxy.ServerMethodA();

            Assert.AreEqual(10, result);
            Assert.IsTrue(Server.MethodCalls.Any());
            Assert.AreEqual(Server.MethodCalls[0].MethodName, nameof(ServerMock.ServerMethodA));
        }
예제 #2
0
        public void PerformanceTest()
        {
            int count = 100;
            var sw    = Stopwatch.StartNew();

            for (int i = 0; i < count; i++)
            {
                ServerProxy.ServerMethodA();
            }
            sw.Stop();

            Assert.AreEqual(Server.MethodCalls.Count, count);
            Console.WriteLine(sw.Elapsed);
        }