コード例 #1
0
    protected override IEnumerator SetUp()
    {
        yield return(base.SetUp());

        UserProfileController.i.ClearProfilesCatalog();

        var ownProfile = UserProfile.GetOwnUserProfile();

        ownProfileModel        = new UserProfileModel();
        ownProfileModel.userId = "my-user-id";
        ownProfileModel.name   = "NO_USER";
        ownProfile.UpdateData(ownProfileModel, false);

        testProfileModel        = new UserProfileModel();
        testProfileModel.userId = "my-user-id-2";
        testProfileModel.name   = "TEST_USER";
        UserProfileController.i.AddUserProfileToCatalog(testProfileModel);

        //NOTE(Brian): This profile is added by the LoadProfile message in the normal flow.
        //             Adding this here because its used by the chat flow in ChatMessageToChatEntry.
        UserProfileController.i.AddUserProfileToCatalog(ownProfileModel);

        controller     = new WorldChatWindowHUDController();
        chatController = new ChatController_Mock();
        mouseCatcher   = new MouseCatcher_Mock();

        controller.Initialize(chatController, mouseCatcher);
        this.view = controller.view;

        Assert.IsTrue(view != null, "World chat hud view is null?");
        Assert.IsTrue(controller != null, "World chat hud controller is null?");
    }
コード例 #2
0
    protected override IEnumerator SetUp()
    {
        chatController = new ChatController_Mock();

        GameObject go = Object.Instantiate((GameObject)Resources.Load(UNREAD_NOTIFICATION_BADGE_RESOURCE_NAME));

        unreadWorldNotificationBadge = go.GetComponent <UnreadWorldNotificationBadge>();
        unreadWorldNotificationBadge.Initialize(chatController);

        Assert.AreEqual(0, unreadWorldNotificationBadge.currentUnreadMessages, "There shouldn't be any unread notification after initialization");
        Assert.AreEqual(false, unreadWorldNotificationBadge.notificationContainer.activeSelf, "Notificaton container should be deactivated");

        yield break;
    }