public void UpdateByIDTest() { // arrange int id = 1; testpaper tp = new testpaper { TestPaperName = "操作系统" }; ManageTestPaperRepository model = new ManageTestPaperRepository(); // act bool result = model.UpdateByID(id, tp); // assert Assert.IsTrue(result); }
// PUT api/<controller>/5 public bool Put(int id, [FromBody] testpaper tp) { return(repository.UpdateByID(id, tp)); }
public testpaper Add([FromBody] testpaper tp) { return(repository.Add(tp)); }