public void TestCreateAndReadDietaryRestriction() { RestaurantSeeder.SeedCountries(); var bo = new DietaryRestrictionBusinessObject(); var dr = new DietaryRestriction("Vegetarian"); var resCreate = bo.Create(dr); var resGet = bo.Read(dr.Id); Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null); }
public ActionResult <DietaryRestrictionViewModel> Get(Guid id) { var res = _bo.Read(id); if (res.Success) { if (res.Result == null) { return(NotFound()); } var vm = DietaryRestrictionViewModel.Parse(res.Result); return(vm); } else { return(InternalServerError()); } }
public ActionResult <DietaryRestrictionViewModel> Get(Guid id) { var res = _bo.Read(id); if (res.Success) { if (res.Result == null) { return(NotFound()); } //if(res.Result.UpdatedAt != DateTime.Now) return StatusCode((int)HttpStatusCode.InternalServerError); var drvm = DietaryRestrictionViewModel.Parse(res.Result); return(drvm); } else { return(StatusCode((int)HttpStatusCode.InternalServerError)); } }
public void TestCreateDietaryRestriction() { ContextSeeders.Seed(); var mbo = new DietaryRestrictionBusinessObject(); var dietaryRestriction = new DietaryRestriction("Vegan"); var resCreate = mbo.Create(dietaryRestriction); var resGet = mbo.Read(dietaryRestriction.Id); Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null); }