示例#1
0
        public void GetNonExistentBeerNotFound()
        {
            // Arrange
            var controller = new HomeBrewed.Controllers.BeerController(null);

            // Act
            ActionResult <Beer> result = controller.GetById(5);

            // Assert
            Assert.Null(result.Value);
            Assert.Equal((int)HttpStatusCode.NotFound, ((NotFoundResult)result.Result).StatusCode);
        }
示例#2
0
        public void GetAmericanLagerFirst()
        {
            // Arrange
            var controller = new HomeBrewed.Controllers.BeerController(null);

            // Act
            ActionResult <Beer> result = controller.GetById(0);

            // Assert
            Assert.NotNull(result.Value);
            Assert.Equal("American Lager", result.Value.Name);
        }