public void When_Index_Called_10_Items_Are_Returned_Integrated()
 {
     ClusterHelper.Initialize();
     var controller = new HomeController();
     dynamic viewResult = controller.Index();
     Assert.AreEqual(10, viewResult.Model.Count);
 }
        public void When_Edit_GET_Called_Beer_Poco_Is_Returned()
        {
            var beer = new Beer
            {
                Id = "beer1"
            };
            var bucket = new Mock<IBucket>();
            bucket.Setup(x => x.GetDocument<Beer>(It.IsAny<string>()))
                .Returns(() => new FakeDocumentResult<Beer>
                {
                    Status = ResponseStatus.Success,
                    Success = true,
                    Content = beer,
                    Document = new Document<Beer>
                    {
                        Content = beer,
                        Id = beer.Id
                    }
                });

            var beerDao = new BeerDao(bucket.Object);
            var controller = new HomeController(beerDao);
            dynamic viewResult = controller.Edit("beer1");
            Assert.AreEqual("beer1", viewResult.Model.Id);
        }
 public void When_Index_Called_10_Items_Are_Returned()
 {
     var bucket = new Mock<IBucket>();
     bucket.Setup(x => x.Query<Beer>(It.IsAny<IQueryRequest>()))
         .Returns(() => new FakeQueryResult<Beer>
         {
             Success = true,
             Rows = new List<Beer>
             {
                 new Beer(),
                 new Beer(),
                 new Beer(),
                 new Beer(),
                 new Beer(),
                 new Beer(),
                 new Beer(),
                 new Beer(),
                 new Beer(),
                 new Beer()
             }
         });
     var beerDao = new BeerDao(bucket.Object);
     var controller = new HomeController(beerDao);
     dynamic viewResult = controller.Index();
     Assert.AreEqual(10, viewResult.Model.Count);
 }
        public void When_Edit_GET_Called_Beer_Poco_Is_Returned_Integrated()
        {
            ClusterHelper.Initialize();
            var controller = new HomeController();
            dynamic viewResult = controller.Index();

            var beer = controller.Edit(viewResult.Model[0].Id);
            Assert.IsNotNull(beer);
        }