Example #1
0
        public ActionResult AddMenuItem(string placeId, MenuItem menuItem)
        {
            var place = _allPlaces.FindById(placeId);

            place.Menu.Items.Add(menuItem);
            _allPlaces.Save(place);
            return(RedirectToAction("place", "places", new { id = placeId }));
        }
Example #2
0
        public void ShouldDelegateFindByIdToTheWrapper()
        {
            var placeId       = "42";
            var expectedPlace = new Place();

            _mongoDB.Setup(it => it.FindById <Place>("places", placeId)).Returns(expectedPlace);
            var actualPlace = _allPlaces.FindById(placeId);

            Assert.That(actualPlace, Is.SameAs(expectedPlace));
        }
Example #3
0
        public ActionResult Place(string id)
        {
            var place = _allPlaces.FindById(id);

            return(View(place));
        }