Example #1
0
        public void Conv_numarrayonethousandof1_string1returned()
        {
            Stopwatch stopWatch = new Stopwatch();

            // arrange
            int[]  x        = new int[1000];
            string expected = "1";

            for (int i = 0; i < 1000; i++)
            {
                x[i] = 1;
            }

            // act
            stopWatch.Start();
            string actual = Rep.Check(x);

            stopWatch.Stop();

            // assert
            Assert.AreEqual(expected, actual);
            TimeSpan ts          = stopWatch.Elapsed;
            string   elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                                 ts.Hours, ts.Minutes, ts.Seconds,
                                                 ts.Milliseconds / 10);

            Console.WriteLine("RunTime " + elapsedTime);
        }
Example #2
0
        public void Conv_numarray01and1and0001and00001_string1returned()
        {
            Stopwatch stopWatch = new Stopwatch();

            // arrange
            int[]  x        = { 01, 1, 0001, 00001 };
            string expected = "1";

            // act
            stopWatch.Start();
            string actual = Rep.Check(x);

            stopWatch.Stop();

            // assert
            Assert.AreEqual(expected, actual);
            TimeSpan ts          = stopWatch.Elapsed;
            string   elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                                 ts.Hours, ts.Minutes, ts.Seconds,
                                                 ts.Milliseconds / 10);

            Console.WriteLine("RunTime " + elapsedTime);
        }
Example #3
0
        public void Conv_numarrayfrom1and0to21_string1returned()
        {
            Stopwatch stopWatch = new Stopwatch();

            // arrange
            int[]  x        = { 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 };
            string expected = "1";

            // act
            stopWatch.Start();
            string actual = Rep.Check(x);

            stopWatch.Stop();

            // assert
            Assert.AreEqual(expected, actual);
            TimeSpan ts          = stopWatch.Elapsed;
            string   elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                                 ts.Hours, ts.Minutes, ts.Seconds,
                                                 ts.Milliseconds / 10);

            Console.WriteLine("RunTime " + elapsedTime);
        }