Ejemplo n.º 1
0
        public void TestDetailsNotNull()
        {
            // Arrange
            BeerController controller = new BeerController();

            // Act
            ActionResult result = controller.Details(5) as ActionResult;

            // Assert
            Assert.IsNotNull(result);
        }
Ejemplo n.º 2
0
        public void Details_Model_Is_Expected_Model()
        {
            var expectedId    = 2;
            var expectedModel = new Beer();

            repo.GetById(expectedId).Returns(expectedModel);

            var result = underTest.Details(expectedId);
            var model  = (Beer)result.Model;

            Assert.Equal(expectedModel, model);
        }
        public void Test_Get_Details()
        {
            const string id = "21st_amendment_brewery_cafe-bitter_american";

            using (var cluster = new Cluster())
            {
                using (var bucket = cluster.OpenBucket("beer-sample"))
                {
                    var controller = new BeerController(new BeerRepository(bucket));
                    var result     = (ViewResult)controller.Details(id);
                    var beer       = result.Model as Beer;
                    Assert.IsNotNull(beer);
                }
            }
        }