public void TestEditHasItem() { dynamic controller = new AccessionRecordsController(mock.Object); var viewResult = controller.Edit(id: 1) as ViewResult; var model = viewResult.Model as AccessionRecord; Assert.IsNotNull(model.Item); }
public void TestEditCallsUpdate() { AccessionRecordsController controller = new AccessionRecordsController(mock.Object); AccessionRecord arToAdd = new AccessionRecord() { Item = new Item() { Title = "Ignore this" }, AccessionRecordId = 1 }; mock.Setup(m => m.Update(It.IsAny <AccessionRecord>())); controller.Edit(arToAdd); mock.Verify(m => m.Update(It.IsAny <AccessionRecord>()), Times.Once); }