public void TestGetAllService() { var pokedexService = new PokedexService(); var response = pokedexService.GetAll(); Assert.IsTrue(response.Count > 0, "should have at least 1 pokemon"); }
public async Task LoadPokedex() { IsLoading = true; Pokedex = await PokedexService.GetPokemon(); PokemonList = new ObservableCollection <Pokemon>(Pokedex); IsLoading = false; }
public async Task LoadIceDarkPokedex() { IsLoading = true; Pokedex = await PokedexService.GetPokemon(); IcePokemonList = new ObservableCollection <Pokemon>(Pokedex.Where(x => x.Types.Contains("Ice"))); DarkPokemonList = new ObservableCollection <Pokemon>(Pokedex.Where(x => x.Types.Contains("Dark"))); IsLoading = false; }
/// <summary> /// /// </summary> /// <remarks>RWM: DO NOT call this constructor at runtime!</remarks> public MainPageViewModel() { if (DesignMode.DesignModeEnabled) { Value = "Designtime value"; if (PokedexService == null) { PokedexService = new PokedexService(new PokemonGoApiClient()); } PokedexService.PokedexInventory.Add(new PokemonData("Abra")); PokedexService.PokedexInventory.Add(new PokemonData("Pikachu")); PokedexService.PokemonInventory.Add(new PokemonData("Abra")); } }
/// <summary> /// /// </summary> /// <remarks>RWM: DO NOT call this constructor at runtime!</remarks> public MainPageViewModel() { if (DesignMode.DesignModeEnabled) { Value = "Designtime value"; if (PokedexService == null) { PokedexService = new PokedexService(new PokemonGoApiClient(null, null, null)); } PokedexService.PokedexInventory.Add(new PokemonData { PokemonId = PokemonId.Abra }); PokedexService.PokedexInventory.Add(new PokemonData { PokemonId = PokemonId.Charmander }); PokedexService.PokedexInventory.Add(new PokemonData { PokemonId = PokemonId.Pikachu }); } }
/// <summary> /// /// </summary> /// <param name="pokedexService"></param> /// <remarks>RWM: This is the constructor you call at runtime.</remarks> public MainPageViewModel(PokedexService pokedexService) : this() { PokedexService = pokedexService; }