public IHttpActionResult Post(string WorkOutTitle, string WorkOutNote, int CaloriesBurnPerMin, int CategoryId) { try { WorkOut model = new WorkOut() { CaloriesBurnPerMin = CaloriesBurnPerMin, CategoryId = CategoryId, Created = DateTime.Now, WorkOutNote = WorkOutNote, WorkOutTitle = WorkOutTitle }; if (dao.Add(model)) { return(Ok("Record Created Successfully")); } else { return(BadRequest("Error Occurred")); } } catch (Exception ex) { return(BadRequest("Error Occurred")); } }
public void AddWorkOut_Tracker() { WorkOutDb obj = new WorkOutDb(); bool result = obj.Add( new WorkOut { Created = DateTime.Now }); Assert.AreEqual(true, result); }