public async Task GetServerStatistics_ReturnsCorrectStatistics() { var endpoint = "PutServerInfo_SavesInfo"; var expected = new ServerStatisticsEntry { TotalMatchesPlayed = 2, MaximumMatchesPerDay = 1, AverageMatchesPerDay = 2 / 6.0, MaximumPopulation = 4, AveragePopulation = 3, Top5GameModes = new List <StringEntry> { new StringEntry { String = "TM" }, new StringEntry { String = "TDM" } }, Top5Maps = new List <StringEntry> { new StringEntry { String = "DM-HelloWorld" }, new StringEntry { String = "NewMap" } } }; var result = await statistics.GetServerStatistics(endpoint); result.ShouldBeEquivalentTo(expected, o => { o.Excluding(x => x.Top5GameModes); o.Excluding(x => x.Top5Maps); o.Excluding(x => x.SelectedMemberPath.EndsWith("Id")); return(o); }); }
public async Task <ServerStatistics> GetServerStatisctics(string endpoint) { return(await statistics.GetServerStatistics(endpoint)); }