public void TestAssignTaskToUserWithGivenUsername() { UserController userController = new UserController(); TaskController taskController = new TaskController(); taskController.ProcessNewAdData(newAdForm); user = userController.ReturnUserWithGivenUsername(user.Username); if (user.Ads.Length <= 1) { Assert.Fail(); } else { int mockTaskID = user.Ads[1]; taskController.AssignTaskToUserWithGivenUsername(mockTaskID, mockTasker.Username); mockTasker = userController.ReturnUserWithGivenUsername(mockTasker.Username); Models.Task mockTask = taskController.ReturnTaskWithGivenTaskId(mockTaskID); Assert.AreEqual(true, mockTask.IsAssignedToSomeone); Assert.AreEqual(mockTasker.Username, mockTask.AssignedToUserWithThisUsername); } }