Пример #1
0
        public IEnumerator DisplayCorrectly()
        {
            controller.SetVisibility(true);
            Assert.IsTrue(controller.view.gameObject.activeSelf);

            SimulateFriendsUpdate();
            SimulateHotSceneUpdate();
            SimulateMinimapUpdate();

            yield return(null);

            var activeCells = GetActiveCells();

            Assert.AreEqual(activeCells.Count, 3);

            Assert.AreEqual(GetFriendsCount(activeCells[BASECOORD_FIRST_CELL]), 0);
            Assert.AreEqual(GetFriendsCount(activeCells[BASECOORD_SECOND_CELL]), 0);
            Assert.AreEqual(GetFriendsCount(activeCells[BASECOORD_TEMPTATION]), 1);

            friendsController.RaiseUpdateUserStatus("userOnline",
                                                    new FriendsController.UserStatus()
            {
                position = BASECOORD_FIRST_CELL,
                presence = PresenceStatus.ONLINE,
                realm    = new FriendsController.UserStatus.Realm()
                {
                    layer = "layer", serverName = "server"
                }
            });

            Assert.AreEqual(GetFriendsCount(activeCells[BASECOORD_FIRST_CELL]), 1);
            Assert.AreEqual(GetFriendsCount(activeCells[BASECOORD_TEMPTATION]), 0);

            friendsController.RaiseUpdateUserStatus("userOnline",
                                                    new FriendsController.UserStatus()
            {
                position = BASECOORD_FIRST_CELL,
                presence = PresenceStatus.OFFLINE,
                realm    = new FriendsController.UserStatus.Realm()
                {
                    layer = "layer", serverName = "server"
                }
            });

            Assert.AreEqual(GetFriendsCount(activeCells[BASECOORD_FIRST_CELL]), 0);
        }
Пример #2
0
    public void FriendChangesHisPosition()
    {
        Vector2 newTestCoords = new Vector2(10, 20);

        friendsController.RaiseUpdateUserStatus(TEST_USER_ID, new FriendsController.UserStatus
        {
            userId           = TEST_USER_ID,
            friendshipStatus = FriendshipStatus.FRIEND,
            position         = newTestCoords,
            presence         = PresenceStatus.ONLINE,
            realm            = new FriendsController.UserStatus.Realm
            {
                serverName = TEST_SERVER_NAME,
                layer      = TEST_LAYER_NAME
            }
        });

        Assert.AreEqual(newTestCoords, jumpInButton.currentCoords, "Position coords should match with [newTestCoords]");
        Assert.AreEqual(PresenceStatus.ONLINE, jumpInButton.currentPresenceStatus, "Presence status should be ONLINE");
        Assert.AreEqual(TEST_SERVER_NAME, jumpInButton.currentRealmServerName, "Server name should match with [TEST_SERVER_NAME]");
        Assert.AreEqual(TEST_LAYER_NAME, jumpInButton.currentRealmLayerName, "Server layer should match with [TEST_LAYER_NAME]");
        Assert.AreEqual(true, jumpInButton.gameObject.activeSelf, "JumpInButton game object should be actived");
    }