public async Task ClonesAsync_successfully_returns_a_charactersClones() { Mock <IWebClient> mockedWebClient = new Mock <IWebClient>(); CloneScopes scopes = CloneScopes.esi_clones_read_clones_v1; SsoToken inputToken = new SsoToken { AccessToken = "This is a old access token", RefreshToken = "This is a old refresh token", CharacterId = 828658, CharacterName = "ThisIsACharacter", CloneScopesFlags = scopes }; string json = "{\"home_location\": {\"location_id\": 1021348135816,\"location_type\": \"structure\"},\"jump_clones\": [{\"implants\": [22118],\"jump_clone_id\": 12345,\"location_id\": 60003463,\"location_type\": \"station\"}]}"; mockedWebClient.Setup(x => x.GetAsync(It.IsAny <WebHeaderCollection>(), It.IsAny <string>(), It.IsAny <int>())).ReturnsAsync(new EsiModel { Model = json }); InternalLatestClones internalLatestClones = new InternalLatestClones(mockedWebClient.Object, string.Empty); V3ClonesClone getClonesClone = await internalLatestClones.ClonesAsync(inputToken); Assert.Equal(1021348135816, getClonesClone.HomeLocation.LocationId); Assert.Equal(V3ClonesLocationType.Structure, getClonesClone.HomeLocation.LocationType); Assert.Equal(22118, getClonesClone.JumpClones.First().Implants.First()); Assert.Equal(12345, getClonesClone.JumpClones.First().JumpCloneId); Assert.Equal(60003463, getClonesClone.JumpClones.First().LocationId); Assert.Equal(V3ClonesLocationType.Station, getClonesClone.JumpClones.First().LocationType); }
public async Task ClonesAsync_successfully_returns_a_charactersClones() { CloneScopes scopes = CloneScopes.esi_clones_read_clones_v1; SsoToken inputToken = new SsoToken { AccessToken = "This is a old access token", RefreshToken = "This is a old refresh token", CharacterId = 828658, CharacterName = "ThisIsACharacter", CloneScopesFlags = scopes }; LatestCloneEndpoints internalLatestClones = new LatestCloneEndpoints(string.Empty, true); V3ClonesClone getClonesClone = await internalLatestClones.ClonesAsync(inputToken); Assert.Equal(1021348135816, getClonesClone.HomeLocation.LocationId); Assert.Equal(V3ClonesLocationType.Structure, getClonesClone.HomeLocation.LocationType); Assert.Equal(22118, getClonesClone.JumpClones.First().Implants.First()); Assert.Equal(12345, getClonesClone.JumpClones.First().JumpCloneId); Assert.Equal(60003463, getClonesClone.JumpClones.First().LocationId); Assert.Equal(V3ClonesLocationType.Station, getClonesClone.JumpClones.First().LocationType); }