コード例 #1
0
        public void UsersByProjectLoggedUserTest()
        {
            ModelsMocks.CleanUpBeforeTest();
            // Arrange
            AccountController controller = ControllersMocks.CreateAccountControllerAs(ControllersMocks.LoggedUser, true);

            ModelsMocks.AddTestProject(true);
            ModelsMocks.AssignUserToProject(ModelsMocks.FirstUser, ModelsMocks.ProjectModelFirst);

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

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