Ejemplo n.º 1
0
        public void RendersDataForTheSubmittedUserFromDB()
        {
            User newUser = Stubs.GetFullUser();

            _controller.ControllerContext = Stubs.GetControllerContext();
            _dataManager.Setup(x => x.GetLastEntry()).Returns(newUser);

            ViewResult result = _controller.Index() as ViewResult;
            User       model  = result.ViewData.Model as User;

            Assert.AreEqual("Index", result.ViewName);
            Assert.AreEqual("TestFirstName", model.FirstName);
            Assert.AreEqual("TestLastName", model.LastName);
            Assert.AreEqual(true, model.Eligibility.isEligible);
            Assert.AreEqual("Barclays Card", model.Eligibility.Card.Name);
        }
Ejemplo n.º 2
0
        public void ItemPageView()
        {
            ResultController ItemPage = new ResultController();
            var results = ItemPage.Index() as ViewResult;

            Assert.AreEqual("", results.ViewName);
        }
Ejemplo n.º 3
0
        public void IsReturnFinishedUsers()
        {
            var test = new Mock <IUserStore <User> >();
            UserManager <User> userManager = new UserManager <User>(test.Object, null, null, null, null, null, null, null, null);

            //Arrange

            var controller = new ResultController(userManager);

            //Act
            controller.Index();
            var result = (ActionResult)controller.Index();

            // Assert
            //Assert.IsInstanceOfType(result, typeof(ViewResult));
        }