Exemplo n.º 1
0
        public void Echo1000Speed()
        {
            // We measure speed so we will not introduce code with communcation speed impact

            // Arrange
            Thread.Sleep(100);  // let the system or other process relax...

            //Act
            Stopwatch st = new Stopwatch();

            st.Reset();
            st.Start();


            for (int i = 0; i < 1000; i++)
            {
                NewPayLoad PL   = new NewPayLoad("SpeedTest", "Hello Server - " + i);
                NewPayLoad PLRC = mMyGingerClient.Send(PL);
                Assert.IsTrue(PLRC.IsOK(), " PLRC.IsOK()");
            }
            st.Stop();

            //Assert
            // on fast PC it take less than 500, on the build server it take ??? so keeping some buffer so UT will not fail
            Assert.IsTrue(st.ElapsedMilliseconds < 500, "st.ElapsedMilliseconds < 500");
        }
Exemplo n.º 2
0
        public void Echo1000Speed()
        {
            // We measure speed so we will not introduce code with communcation speed impact

            // Arrange
            Thread.Sleep(100);  // let the system or other process relax...

            //Act
            Stopwatch st = Stopwatch.StartNew();

            for (int i = 0; i < 1000; i++)
            {
                NewPayLoad PL   = new NewPayLoad("SpeedTest", "Hello Server - " + i);
                NewPayLoad PLRC = mMyGingerClient.Send(PL);

                //Assert
                Assert.IsTrue(PLRC.IsOK(), " PLRC.IsOK()");
            }
            st.Stop();
        }