public void SearchUserCorrectly() { UsersSearchPromptController controller = new UsersSearchPromptController(promptView); controller.Show(); promptView.searchInputField.OnSubmit("Temp"); controller.usersSearchPromise.Resolve(new [] { new UserProfileModel() { userId = "Temp" }, new UserProfileModel() { userId = "ta" }, new UserProfileModel() { userId = "tion" }, }); Assert.AreEqual(3, promptView.friendListParent.childCount); Assert.IsTrue(controller.userViewsHandler.userElementViews["Temp"].gameObject.activeSelf); Assert.IsTrue(controller.userViewsHandler.userElementViews["ta"].gameObject.activeSelf); Assert.IsTrue(controller.userViewsHandler.userElementViews["tion"].gameObject.activeSelf); controller.Dispose(); }
public SectionSceneAdminsSettingsController(SectionSceneAdminsSettingsView view, IFriendsController friendsController) { this.view = view; friendsSearchPromptController = new FriendsSearchPromptController(view.GetAdminsSearchPromptView(), friendsController); usersSearchPromptController = new UsersSearchPromptController(view.GetBlockedSearchPromptView()); view.OnSearchFriendButtonPressed += () => friendsSearchPromptController.Show(); view.OnSearchUserButtonPressed += () => usersSearchPromptController.Show(); friendsSearchPromptController.OnAddUser += OnAddAdminPressed; friendsSearchPromptController.OnRemoveUser += OnRemoveAdminPressed; usersSearchPromptController.OnAddUser += OnAddBannedUserPressed; usersSearchPromptController.OnRemoveUser += OnRemoveBannedUserPressed; }