示例#1
0
    public void DestroyItem_IsItemDestroyed()
    {
        DummyContainer       container = CreateTestContainer();
        IEnumerable <Weapon> weapons   = CreateWeaponsList(5);

        container.UpdateContainer(weapons);
        container.DestroyItem(weapons.First());

        Assert.AreEqual(container.Items.Count(), 4);
    }
示例#2
0
    public void DestroyItem_IsItemsEmpty()
    {
        DummyContainer container = CreateTestContainer();
        List <Weapon>  weapons   = CreateWeaponsList(5);

        container.UpdateContainer(weapons);

        for (int i = 0; i < 5; i++)
        {
            Weapon weaponToDelete = weapons.First();
            container.DestroyItem(weaponToDelete);
            weapons.Remove(weaponToDelete);
        }

        Assert.AreEqual(0, container.Items.Count());
    }
示例#3
0
    public IEnumerator DestroyItem_AreItemGameObjectsDestroyed()
    {
        DummyContainer container = CreateTestContainer();
        List <Weapon>  weapons   = CreateWeaponsList(5);

        container.UpdateContainer(weapons);

        for (int i = 0; i < 5; i++)
        {
            Weapon weaponToDelete = weapons.First();
            container.DestroyItem(weaponToDelete);
            weapons.Remove(weaponToDelete);
        }

        yield return(new WaitForEndOfFrame());

        Assert.AreEqual(0, GameObject.FindObjectsOfType <DummyItem>().Length);
    }