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