示例#1
0
        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);
        }
示例#2
0
        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"]);
        }