Example #1
0
        public void UsersByProjectTaskLoggedUserTest()
        {
            ModelsMocks.CleanUpBeforeTest();
            // Arrange
            AccountController controller = ControllersMocks.CreateAccountControllerAs(ControllersMocks.LoggedUser, true);

            ModelsMocks.AddTestProject(true);
            ModelsMocks.AddTestTask(true, ModelsMocks.ProjectModelFirst);
            ModelsMocks.AssignUserToProjectTask(ModelsMocks.FirstUser, ModelsMocks.TaskModelFirst);

            // Act
            JsonResult action = controller.UsersByProjectTask(ModelsMocks.ProjectModelFirst.ID, ModelsMocks.TaskModelFirst.ID) as JsonResult;
            int        count  = ((UsersViewModel)action.Data).Users.Count();

            // Assert
            Assert.AreEqual(2, count);
        }