Exemple #1
0
        public async Task HomeIndexTest()
        {
            applicationUser = await applicationManager.FindAsync("Admin", "123456");
            HomeController controller = new HomeController(profileRepository, apartmentRepository, applicationUser);
            IndexHomeViewResult result = (IndexHomeViewResult)((ViewResult)controller.Index()).Model;
            Assert.AreEqual(result.MyApartments.Count, 0);
            Assert.AreEqual(result.Profile.ProfileId, 1);

            applicationUser = await applicationManager.FindAsync("User", "123456");
            controller = new HomeController(profileRepository, apartmentRepository, applicationUser);
            result = (IndexHomeViewResult)((ViewResult)controller.Index()).Model;
            Assert.AreEqual(result.MyApartments.Count, 0);
            Assert.AreEqual(result.Profile.ProfileId, 2);
        }