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