public void AfterClientSendingGetPopularServersRequest() { SendServer2Info(); SendServer3Info(); var match = Test.CreateGameMatchStats(); for (var i = 0; i < 5; i++) { client.SendRequest().PutMatchStats(match, Test.Server1Endpoint, Test.Timestamp1); } for (var i = 0; i < 3; i++) { client.SendRequest().PutMatchStats(match, Test.Server2Endpoint, Test.Timestamp1); } for (var i = 0; i < 2; i++) { client.SendRequest().PutMatchStats(match, Test.Server3Endpoint, Test.Timestamp1); } var response = client.GetPopularServers(3); server.ClearDatabaseAndCache(); var server1 = new GameServerStats(Test.Server1Endpoint, Test.Server1Name, 5); var server2 = new GameServerStats(Test.Server2Endpoint, Test.Server2Name, 3); var server3 = new GameServerStats(Test.Server3Endpoint, Test.Server3Name, 2); var servers = new[] { server1, server2, server3 }; var json = Extensions.SerializePopularServers(servers); var popularServers = JsonConvert.DeserializeObject <GameServerStats[]>(json); var result = JsonConvert.DeserializeObject <GameServerStats[]>(response.Message); result.ShouldBeEquivalentTo(popularServers); }