Ejemplo n.º 1
0
    public void BePopulatedCorrectly()
    {
        FriendEntry.Model model = new FriendEntry.Model()
        {
            coords          = Vector2.one,
            avatarImage     = Texture2D.whiteTexture,
            realm           = "realm-test",
            realmServerName = "realm-test",
            realmLayerName  = "realm-layer-test",
            status          = PresenceStatus.ONLINE,
            userName        = "******"
        };

        entry.userId = "userId-1";
        entry.Populate(model);

        Assert.AreEqual(model.userName, entry.playerNameText.text);
        Assert.AreEqual(entry.playerImage.texture, Texture2D.whiteTexture);
    }
Ejemplo n.º 2
0
    public void BePopulatedCorrectly()
    {
        Sprite testSprite = Sprite.Create(Texture2D.whiteTexture, Rect.zero, Vector2.zero);

        FriendEntry.Model model = new FriendEntry.Model()
        {
            coords          = Vector2.one,
            avatarImage     = testSprite,
            realm           = "realm-test",
            realmServerName = "realm-test",
            realmLayerName  = "realm-layer-test",
            status          = PresenceStatus.ONLINE,
            userName        = "******"
        };

        entry.userId = "userId-1";
        entry.Populate(model);

        Assert.AreEqual(model.userName, entry.playerNameText.text);
        Assert.AreEqual(entry.playerImage.sprite, testSprite);

        Object.Destroy(testSprite);
    }