Exemplo n.º 1
0
        public async void GetBeerByIdTest(string id, bool beerIsExists)
        {
            // act
            var result = await _beerManager.GetBeerById(id);

            // assert
            Assert.Equal(result.Data != null, beerIsExists);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Beer([Required] string id)
        {
            var result = await _beerManager.GetBeerById(id);

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

            return(BadRequest(result.ErrorMessage));
        }