public void AddToLibrariansChoiceValid() { var mockMediaDal = new MockMediaDal { ThrowError = false }; var controller = new BorrowController(new MockBorrowDal(), mockMediaDal, new MockMemberDal()); var result = (ViewResult)controller.AddToLibrariansChoice(1); Assert.AreEqual("Browse", result.ViewName); }
public void AddToLibrariansChoiceWithException() { var mockMediaDal = new MockMediaDal { ThrowError = true }; var controller = new BorrowController(new MockBorrowDal(), mockMediaDal, new MockMemberDal()); var result = (ViewResult)controller.AddToLibrariansChoice(1); Assert.AreEqual("Browse", result.ViewName); Assert.AreEqual("Uh-oh.. something went wrong", result.ViewData["Error"]); }