public void UpdateContainer_IsItemCountCorrectAfterNewUpdateContainer() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> oldWeapons = CreateWeaponsList(5); container.UpdateContainer(oldWeapons); IEnumerable <Weapon> newWeapons = CreateWeaponsList(5); container.UpdateContainer(newWeapons); Assert.AreEqual(5, container.Items.Count()); }
public void UpdateContainer_AreOldItemsNotFoundAfterNewUpdateContainer() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> oldWeapons = CreateWeaponsList(5); container.UpdateContainer(oldWeapons); IEnumerable <Weapon> newWeapons = CreateWeaponsList(5); container.UpdateContainer(newWeapons); LogAssert.ignoreFailingMessages = true; container.GetItem(oldWeapons.First()); LogAssert.Expect(LogType.Error, new Regex(".*")); }
public IEnumerator UpdateContainer_AreOldItemsDestroyed() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> oldWeapons = CreateWeaponsList(5); container.UpdateContainer(oldWeapons); IEnumerable <Weapon> newWeapons = CreateWeaponsList(5); container.UpdateContainer(newWeapons); yield return(new WaitForEndOfFrame()); Assert.AreEqual(5, GameObject.FindObjectsOfType <DummyItem>().Length); }
public void UpdateContainer_AreGameObjectsCorrectlySpawned() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> weapons = CreateWeaponsList(5); container.UpdateContainer(weapons); Assert.AreEqual(5, GameObject.FindObjectsOfType <DummyItem>().Length); }
public void UpdateContainer_IsItemCountCorrect() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> weapons = CreateWeaponsList(5); container.UpdateContainer(weapons); Assert.AreEqual(container.Items.Count(), 5); }
public void Clear_IsItemsEmpty() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> weapons = CreateWeaponsList(5); container.UpdateContainer(weapons); container.Clear(); Assert.AreEqual(0, container.Items.Count()); }
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); }
public void CreateItem_IsItemsCountIncreased() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> weapons = CreateWeaponsList(5); container.UpdateContainer(weapons); Weapon weapon = new Weapon(); container.CreateItem(weapon); Assert.AreEqual(6, container.Items.Count()); }
public void GetItem_IsNewItemNotFound() { LogAssert.ignoreFailingMessages = true; DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> weapons = CreateWeaponsList(5); container.UpdateContainer(weapons); Weapon nonAddedWeapon = new Weapon(); container.GetItem(nonAddedWeapon); LogAssert.Expect(LogType.Error, new Regex(".*")); }
public void GetItem_IsItemSame() { DummyContainer container = CreateTestContainer(); IEnumerable <Weapon> weapons = CreateWeaponsList(5); container.UpdateContainer(weapons); Weapon weapon = new Weapon(); container.CreateItem(weapon); DummyItem item = container.GetItem(weapon); Assert.AreSame(weapon, item.Data); }
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()); }
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); }