public void HashOfCopyShouldNotChange1() { var gameCopy = new CopyService().CopyRoot(Game); var originalHash = Game.CalculateHash(); var copyHash = gameCopy.CalculateHash(); Assert.Equal(originalHash, copyHash); }
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); }