예제 #1
0
        public void HashOfCopyShouldNotChange1()
        {
            var gameCopy = new CopyService().CopyRoot(Game);

              var originalHash = Game.CalculateHash();
              var copyHash = gameCopy.CalculateHash();

              Assert.Equal(originalHash, copyHash);
        }
예제 #2
0
        public void HashOfCopyShouldNotChange1()
        {
            var gameCopy = new CopyService().CopyRoot(Game);

            var originalHash = Game.CalculateHash();
            var copyHash     = gameCopy.CalculateHash();


            Assert.Equal(originalHash, copyHash);
        }
예제 #3
0
        public void HashPerformance()
        {
            var count = 10000;

              // create a copy to remove proxies
              var game = new CopyService().CopyRoot(Game);

              var stopWatch = new Stopwatch();
              stopWatch.Start();

              for (var i = 0; i < count; i++)
              {
            game.CalculateHash();
              }

              stopWatch.Stop();
              Console.WriteLine("Hashing of {0} game objects took: {1} ms.", count, stopWatch.Elapsed.TotalMilliseconds);
        }
예제 #4
0
        public void HashPerformance()
        {
            var count = 10000;

            // create a copy to remove proxies
            var game = new CopyService().CopyRoot(Game);

            var stopWatch = new Stopwatch();

            stopWatch.Start();

            for (var i = 0; i < count; i++)
            {
                game.CalculateHash();
            }

            stopWatch.Stop();
            Console.WriteLine("Hashing of {0} game objects took: {1} ms.", count, stopWatch.Elapsed.TotalMilliseconds);
        }