public Cup GetCoffee() { Cup cup = _coffeeService.GetCoffee(); cup.ingredients.Add("Cream"); return(cup); }
protected override async void OnAppearing() { base.OnAppearing(); int.TryParse(CoffeeId, out var result); BindingContext = await coffeeService.GetCoffee(result); }
public void GetIngredients() { var cup = _coffeeService.GetCoffee(); foreach (string ingredient in cup.ingredients) { Console.WriteLine("- " + ingredient); } }
public void CoffeeService_GetCoffee_MustReturnTheCupWithTheIngredientsOfCoffeePowderAndHotWater() { // Initialize DI ICoffeeService coffeeService = _kernel.Get <CoffeeService>(); // Act Cup cup = coffeeService.GetCoffee(); // Assert Assert.That(cup.ingredients.Contains("Coffee Powder")); Assert.That(cup.ingredients.Contains("Hot Water")); }
async Task Refresh() { IsBusy = true; #if DEBUG await Task.Delay(500); #endif Coffee.Clear(); var coffees = await coffeeService.GetCoffee(); Coffee.AddRange(coffees); IsBusy = false; DependencyService.Get <IToast>()?.MakeToast("Refreshed!"); }