private SniperInfo map(Result result) { SniperInfo sniperInfo = new SniperInfo(); PokemonId pokemonId = PokemonParser.parsePokemon(result.name); if (!pokemonIdsToFind.Contains(pokemonId)) { return(null); } sniperInfo.Id = pokemonId; GeoCoordinates geoCoordinates = GeoCoordinatesParser.parseGeoCoordinates(result.coords); if (geoCoordinates == null) { return(null); } else { sniperInfo.Latitude = geoCoordinates.latitude; sniperInfo.Longitude = geoCoordinates.longitude; } sniperInfo.ExpirationTimestamp = Convert.ToDateTime(result.until); return(sniperInfo); }
private void testPokemonParsing(String text, PokemonId expectedPokemonId) { Assert.AreEqual(expectedPokemonId, PokemonParser.parsePokemon(text)); }