public void MonsterTickWithSwaps() { modelmock.Object.Monsters[0].CX = 194; OneMonster monster = modelmock.Object.Monsters[1]; OneMonster removedmonster = modelmock.Object.Monsters[0]; // ACT gameLogic.MonsterDied(modelmock.Object.Monsters); // ASSERT Assert.That(modelmock.Object.Monsters[0], Is.EqualTo(monster)); Assert.That(modelmock.Object.Monsters[1], Is.Not.EqualTo(monster)); Assert.That(modelmock.Object.Monsters, Does.Not.Contain(removedmonster)); }
/// <summary> /// MonsterDied method which is 'shifting' the monsters in the list. /// </summary> /// <param name="monsters">The parameter is a list.</param> public void MonsterDied(List <OneMonster> monsters) { monsters[0] = monsters[1]; this.ChestCreate(); if (this.model.BlockNumber % 10 == 0 && this.model.BlockNumber != 0) { monsters[1] = new OneMonster(this.model.GameDisplayWidth / 5 * 5, this.model.GameDisplayHeight / 4 * 4 - 100, Convert.ToInt32((this.model.BlockNumber / 10) * 5)); } else { monsters[1] = new OneMonster(this.model.GameDisplayWidth / 5 * 5, this.model.GameDisplayHeight / 4 * 4 - 200, Convert.ToInt32(Math.Ceiling(this.model.BlockNumber / 10) + 1)); } this.model.IsInFight = false; }