public void ReturnAllServers() { foreach (var serverInfo in TestData.Servers) { db.UpsertServerInfo(serverInfo); } var result = handler.GetGameServers(); result.Should().BeEquivalentTo(TestData.Servers.Select(s => s)); }
private Task <Response> GetServersAsync() { var task = new Task <Response>(() => { GameServer[] servers; try { servers = handler.GetGameServers(); } catch (Exception e) { logger.Error(e.Message); return(HttpStatusCode.InternalServerError); } return(Response.AsJson(servers)); }); task.Start(); return(task); }