public async Task CorporationLeaderboardAsync_successfully_returns_a_V1FwCorporationLeaderboard() { Mock <IWebClient> mockedWebClient = new Mock <IWebClient>(); string json = "{\r\n \"kills\": {\r\n \"active_total\": [\r\n {\r\n \"amount\": 81692,\r\n \"corporation_id\": 1000180\r\n },\r\n {\r\n \"amount\": 76793,\r\n \"corporation_id\": 1000182\r\n }\r\n ],\r\n \"last_week\": [\r\n {\r\n \"amount\": 290,\r\n \"corporation_id\": 1000180\r\n },\r\n {\r\n \"amount\": 169,\r\n \"corporation_id\": 1000182\r\n }\r\n ],\r\n \"yesterday\": [\r\n {\r\n \"amount\": 51,\r\n \"corporation_id\": 1000180\r\n },\r\n {\r\n \"amount\": 39,\r\n \"corporation_id\": 1000182\r\n }\r\n ]\r\n },\r\n \"victory_points\": {\r\n \"active_total\": [\r\n {\r\n \"amount\": 18640927,\r\n \"corporation_id\": 1000180\r\n },\r\n {\r\n \"amount\": 18078265,\r\n \"corporation_id\": 1000181\r\n }\r\n ],\r\n \"last_week\": [\r\n {\r\n \"amount\": 91980,\r\n \"corporation_id\": 1000180\r\n },\r\n {\r\n \"amount\": 58920,\r\n \"corporation_id\": 1000181\r\n }\r\n ],\r\n \"yesterday\": [\r\n {\r\n \"amount\": 12600,\r\n \"corporation_id\": 1000180\r\n },\r\n {\r\n \"amount\": 8240,\r\n \"corporation_id\": 1000181\r\n }\r\n ]\r\n }\r\n}"; mockedWebClient.Setup(x => x.GetAsync(It.IsAny <WebHeaderCollection>(), It.IsAny <string>(), It.IsAny <int>())).ReturnsAsync(new EsiModel { Model = json }); InternalLatestFactionWarfare internalLatestFactionWarfare = new InternalLatestFactionWarfare(mockedWebClient.Object, string.Empty); V1FwCorporationLeaderboard result = await internalLatestFactionWarfare.CorporationLeaderboardAsync(); Assert.Equal(2, result.Kills.ActiveTotal.Count); Assert.Equal(81692, result.Kills.ActiveTotal[0].Amount); Assert.Equal(1000180, result.Kills.ActiveTotal[0].CorporationId); Assert.Equal(76793, result.Kills.ActiveTotal[1].Amount); Assert.Equal(1000182, result.Kills.ActiveTotal[1].CorporationId); Assert.Equal(2, result.Kills.LastWeek.Count); Assert.Equal(290, result.Kills.LastWeek[0].Amount); Assert.Equal(1000180, result.Kills.LastWeek[0].CorporationId); Assert.Equal(169, result.Kills.LastWeek[1].Amount); Assert.Equal(1000182, result.Kills.LastWeek[1].CorporationId); Assert.Equal(2, result.Kills.Yesterday.Count); Assert.Equal(51, result.Kills.Yesterday[0].Amount); Assert.Equal(1000180, result.Kills.Yesterday[0].CorporationId); Assert.Equal(39, result.Kills.Yesterday[1].Amount); Assert.Equal(1000182, result.Kills.Yesterday[1].CorporationId); Assert.Equal(2, result.VictoryPoints.ActiveTotal.Count); Assert.Equal(18640927, result.VictoryPoints.ActiveTotal[0].Amount); Assert.Equal(1000180, result.VictoryPoints.ActiveTotal[0].CorporationId); Assert.Equal(18078265, result.VictoryPoints.ActiveTotal[1].Amount); Assert.Equal(1000181, result.VictoryPoints.ActiveTotal[1].CorporationId); Assert.Equal(2, result.VictoryPoints.LastWeek.Count); Assert.Equal(91980, result.VictoryPoints.LastWeek[0].Amount); Assert.Equal(1000180, result.VictoryPoints.LastWeek[0].CorporationId); Assert.Equal(58920, result.VictoryPoints.LastWeek[1].Amount); Assert.Equal(1000181, result.VictoryPoints.LastWeek[1].CorporationId); Assert.Equal(2, result.VictoryPoints.Yesterday.Count); Assert.Equal(12600, result.VictoryPoints.Yesterday[0].Amount); Assert.Equal(1000180, result.VictoryPoints.Yesterday[0].CorporationId); Assert.Equal(8240, result.VictoryPoints.Yesterday[1].Amount); Assert.Equal(1000181, result.VictoryPoints.Yesterday[1].CorporationId); }
public async Task CorporationLeaderboardAsync_successfully_returns_a_V1FwCorporationLeaderboard() { LatestFactionWarfareEndpoints internalLatestFactionWarfare = new LatestFactionWarfareEndpoints(string.Empty, true); V1FwCorporationLeaderboard result = await internalLatestFactionWarfare.CorporationLeaderboardAsync(); Assert.Equal(2, result.Kills.ActiveTotal.Count); Assert.Equal(81692, result.Kills.ActiveTotal[0].Amount); Assert.Equal(1000180, result.Kills.ActiveTotal[0].CorporationId); Assert.Equal(76793, result.Kills.ActiveTotal[1].Amount); Assert.Equal(1000182, result.Kills.ActiveTotal[1].CorporationId); Assert.Equal(2, result.Kills.LastWeek.Count); Assert.Equal(290, result.Kills.LastWeek[0].Amount); Assert.Equal(1000180, result.Kills.LastWeek[0].CorporationId); Assert.Equal(169, result.Kills.LastWeek[1].Amount); Assert.Equal(1000182, result.Kills.LastWeek[1].CorporationId); Assert.Equal(2, result.Kills.Yesterday.Count); Assert.Equal(51, result.Kills.Yesterday[0].Amount); Assert.Equal(1000180, result.Kills.Yesterday[0].CorporationId); Assert.Equal(39, result.Kills.Yesterday[1].Amount); Assert.Equal(1000182, result.Kills.Yesterday[1].CorporationId); Assert.Equal(2, result.VictoryPoints.ActiveTotal.Count); Assert.Equal(18640927, result.VictoryPoints.ActiveTotal[0].Amount); Assert.Equal(1000180, result.VictoryPoints.ActiveTotal[0].CorporationId); Assert.Equal(18078265, result.VictoryPoints.ActiveTotal[1].Amount); Assert.Equal(1000181, result.VictoryPoints.ActiveTotal[1].CorporationId); Assert.Equal(2, result.VictoryPoints.LastWeek.Count); Assert.Equal(91980, result.VictoryPoints.LastWeek[0].Amount); Assert.Equal(1000180, result.VictoryPoints.LastWeek[0].CorporationId); Assert.Equal(58920, result.VictoryPoints.LastWeek[1].Amount); Assert.Equal(1000181, result.VictoryPoints.LastWeek[1].CorporationId); Assert.Equal(2, result.VictoryPoints.Yesterday.Count); Assert.Equal(12600, result.VictoryPoints.Yesterday[0].Amount); Assert.Equal(1000180, result.VictoryPoints.Yesterday[0].CorporationId); Assert.Equal(8240, result.VictoryPoints.Yesterday[1].Amount); Assert.Equal(1000181, result.VictoryPoints.Yesterday[1].CorporationId); }