Exemple #1
0
    public void SetActiveFurnitureSetsCorrectFurnitureType_Test(FurnitureType expected)
    {
        // setup
        FurnitureInfo info = new FurnitureInfo(expected.ToString(), expected.ToString(), new KeyCode[] { });

        // perform
        FurnitureTriggerInfo.SetActiveFurniture(expected, info);

        // assert
        Assert.AreEqual(expected, FurnitureTriggerInfo.Type);
    }
Exemple #2
0
    public static Furniture LoadFurnitureByType(FurnitureType type, Transform parent)
    {
        GameObject obj = Resources.Load <GameObject>("Prefabs/Furnitures/" + type.ToString());
        Furniture  t   = JerryUtil.CloneGo <Furniture>(new JerryUtil.CloneGoData()
        {
            active = true,
            clean  = false,
            parant = parent,
            prefab = obj,
        });

        return(t);
    }
Exemple #3
0
    public void SetActiveFurnitureLoadsCorrectFurnitureNameIntoUI_Test(FurnitureType type)
    {
        // setup
        string        expected = type.ToString();
        FurnitureInfo info     = new FurnitureInfo(expected, expected, new KeyCode[] { });

        // perform
        FurnitureTriggerInfo.SetActiveFurniture(type, info);

        // get
        string actual = GameObject.Find("GUI/FurnitureInfo/Name").GetComponent <TextMeshProUGUI>().text;

        // assert
        Assert.AreEqual(expected, actual);
    }
Exemple #4
0
    public void SetActiveFurnitureLoadsCorrectKeyCodesIntoUIForTwoKeys_Test(FurnitureType type, KeyCode[] keys)
    {
        // setup
        string        expected = type.ToString();
        FurnitureInfo info     = new FurnitureInfo(expected, expected, keys);

        // perform
        FurnitureTriggerInfo.SetActiveFurniture(type, info);

        // get
        string actual0 = GameObject.Find("GUI/FurnitureInfo/Keys/1/KeyName").GetComponent <TextMeshProUGUI>().text;
        string actual1 = GameObject.Find("GUI/FurnitureInfo/Keys/2/KeyName").GetComponent <TextMeshProUGUI>().text;

        // assert
        Assert.AreEqual(keys[0].ToString(), actual0);
        Assert.AreEqual(keys[1].ToString(), actual1);
    }
Exemple #5
0
    public void SetActiveFurnitureLoadsCorrectKeyCodesIntoUIForZeroKeys_Test(FurnitureType type)
    {
        // setup
        string        expected = "";
        string        name     = type.ToString();
        FurnitureInfo info     = new FurnitureInfo(name, name, new KeyCode[] {  });

        // perform
        FurnitureTriggerInfo.SetActiveFurniture(FurnitureType.CArm, info);

        // get
        string actual0 = GameObject.Find("GUI/FurnitureInfo/Keys/1/KeyName").GetComponent <TextMeshProUGUI>().text;
        string actual1 = GameObject.Find("GUI/FurnitureInfo/Keys/2/KeyName").GetComponent <TextMeshProUGUI>().text;

        // assert
        Assert.AreEqual(expected, actual0);
        Assert.AreEqual(expected, actual1);
    }