Example #1
0
        public async Task ShipAsync_Successfully_returns_a_V1LocationShip()
        {
            Mock <IWebClient> mockedWebClient = new Mock <IWebClient>();

            int            characterId = 8976562;
            LocationScopes scopes      = LocationScopes.esi_location_read_ship_type_v1;

            SsoToken inputToken = new SsoToken {
                AccessToken = "This is a old access token", RefreshToken = "This is a old refresh token", CharacterId = characterId, LocationScopesFlags = scopes
            };

            string json = "{\r\n  \"ship_item_id\": 1000000016991,\r\n  \"ship_name\": \"SPACESHIPS!!!\",\r\n  \"ship_type_id\": 1233\r\n}";

            mockedWebClient.Setup(x => x.GetAsync(It.IsAny <WebHeaderCollection>(), It.IsAny <string>(), It.IsAny <int>())).ReturnsAsync(new EsiModel {
                Model = json
            });

            InternalLatestLocation internalLatestLocation = new InternalLatestLocation(mockedWebClient.Object, string.Empty);

            V1LocationShip returnModel = await internalLatestLocation.ShipAsync(inputToken);

            Assert.Equal(1000000016991, returnModel.ShipItemId);
            Assert.Equal("SPACESHIPS!!!", returnModel.ShipName);
            Assert.Equal(1233, returnModel.ShipTypeId);
        }
Example #2
0
        public void Ship_Successfully_returns_a_V1LocationShip()
        {
            int            characterId = 8976562;
            LocationScopes scopes      = LocationScopes.esi_location_read_ship_type_v1;

            SsoToken inputToken = new SsoToken {
                AccessToken = "This is a old access token", RefreshToken = "This is a old refresh token", CharacterId = characterId, LocationScopesFlags = scopes
            };

            LatestLocationEndpoints internalLatestLocation = new LatestLocationEndpoints(string.Empty, true);

            V1LocationShip returnModel = internalLatestLocation.Ship(inputToken);

            Assert.Equal(1000000016991, returnModel.ShipItemId);
            Assert.Equal("SPACESHIPS!!!", returnModel.ShipName);
            Assert.Equal(1233, returnModel.ShipTypeId);
        }