Пример #1
0
        public async void GetAllBeersTest()
        {
            // act
            var result = await _beerManager.GetBeers();

            // assert
            Assert.Null(result.ErrorMessage);
            Assert.True(result.Data.Any());
        }
Пример #2
0
        public async Task <IActionResult> Beers(string query, int?styleId)
        {
            var result = await _beerManager.GetBeers(query, styleId);

            if (result.StatusCode == HttpStatusCode.OK)
            {
                return(Ok(result.Data));
            }

            return(BadRequest(result.ErrorMessage));
        }