public HttpResponseMessage Post(Bootcamp bootcamp) { if (base.ModelState.IsValid) { _bootcampRepo.AddBootcamp(bootcamp); return(new HttpResponseMessage(HttpStatusCode.OK)); } return(base.Request.CreateErrorResponse(HttpStatusCode.BadRequest, base.ModelState)); }
public void AddBootcampTest() { var beforeCount = repo.GetAllBootcamps().Count; repo.AddBootcamp(mock.mockBootcamp); var afterCount = repo.GetAllBootcamps().Count; Assert.AreEqual(beforeCount + 1, afterCount); }