示例#1
0
        public void When_Call_Index_Action_Should_Return_Valid_Model()
        {
            var expected = new Models.LoginModel()
            {
                Email    = "*****@*****.**",
                Password = "******",
                Source   = "Twitter"
            };
            var service          = new TwitterAuthentication();
            var tenantIdStrategy = new RequestParameterTenantIdentificationStrategy("tenant");
            var controller       = new TwitterController(service, tenantIdStrategy);
            var actionResult     = controller.Index();
            var viewResult       = actionResult as ViewResult;
            var actual           = viewResult.ViewData.Model as Models.LoginModel;

            Assert.AreEqual(expected.Email, actual.Email);
            Assert.AreEqual(expected.Password, actual.Password);
            Assert.AreEqual(expected.Source, actual.Source);
        }