コード例 #1
0
 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));
 }
コード例 #2
0
        public void AddBootcampTest()
        {
            var beforeCount = repo.GetAllBootcamps().Count;

            repo.AddBootcamp(mock.mockBootcamp);
            var afterCount = repo.GetAllBootcamps().Count;

            Assert.AreEqual(beforeCount + 1, afterCount);
        }