예제 #1
0
        public void TestingBuilderStringConcatenation_TakesLessThan10Miliseconds()
        {
            var stopWatch = new Stopwatch();

            stopWatch.Start();

            StringConcatenation.ConcatenatingUsingStringBuilder();

            stopWatch.Stop();

            Assert.IsTrue(stopWatch.Elapsed.Milliseconds < 10, $"Elapsed: {stopWatch.Elapsed.Milliseconds}");
        }
예제 #2
0
        public void TestingStringConcatenation_TakesMoreThan100Miliseconds()
        {
            var stopWatch = new Stopwatch();

            stopWatch.Start();

            StringConcatenation.ConcatenatingUsingString();

            stopWatch.Stop();

            Assert.IsTrue(stopWatch.Elapsed.Milliseconds > 100, $"Elapsed: {stopWatch.Elapsed.Milliseconds}");
        }