public void EducationRepository_Update_Exception1() { Guid g = Guid.NewGuid(); IEducationEntity newEE = null; // bad! var mockXml = new Mock <IEducationXMLService>(); mockXml.Setup(T => T.Update(g, newEE)).Throws(new ArgumentNullException()); var repos = new EducationRepository(mockXml.Object); repos.Update(g, newEE); }
public ActionResult UpdateEducation(Education e) { Education ed = repository.Find(c => c.ID == e.ID); ed.Title = e.Title; ed.SubTitle1 = e.SubTitle1; ed.SubTitle2 = e.SubTitle2; ed.GNO = e.GNO; repository.Update(ed); return(RedirectToAction("Index")); }
public void EducationRepository_Update_Works() { Guid g = Guid.NewGuid(); IEducationEntity newEE = new EducationEntity { Credential = "new", Institution = "new" }; var mockXml = new Mock <IEducationXMLService>(); mockXml.Setup(T => T.Update(g, newEE)); var repos = new EducationRepository(mockXml.Object); repos.Update(g, newEE); Assert.IsTrue(true); }