public async void TestCrocktailList_ShouldFindNone_Async() { //Arrange var httpClient = new HttpClient(); var client = new CocktailClient(httpClient); var controller = new BoozeController(client); //Act var actionResult = await controller.GetIngredientSearch("Lime J"); //Assert Assert.IsType <OkObjectResult>(actionResult); var okResult = actionResult as OkObjectResult; var cocktailList = okResult.Value as CocktailList; Assert.Equal(0, cocktailList.meta.count); }
public async void TestCrocktailList_ShouldFind_Async() { //Arrange var httpClient = new HttpClient(); var client = new CocktailClient(httpClient); var controller = new BoozeController(client); //Act var actionResult = await controller.GetIngredientSearch("Lime Juice"); //Assert Assert.IsType <OkObjectResult>(actionResult); var okResult = actionResult as OkObjectResult; var cocktailList = okResult.Value as CocktailList; Assert.Equal(25, cocktailList.meta.count); Assert.Equal(4, cocktailList.meta.medianIngredientCount); Assert.Equal(11007, cocktailList.meta.firstId); Assert.Equal(178317, cocktailList.meta.lastId); }