public void ShouldHaveExtraPower() { var sut = new EnemyFactory(); var enemy = sut.Create(true); Assert.That(enemy, Has.Property("ExtraPower")); }
public void OnlyAllowKingOrQueenBossEnemies(EnemyFactory sut) { var ex = Assert.Throws <EnemyCreationException>(() => sut.Create("Zombie", true)); Assert.Equal("Zombie", ex.RequestedEnemyName); }
public void CreateBossEnemy_CastReturnedTypeExample(EnemyFactory sut) { var enemy = sut.Create("Zombie King", true); var boss = Assert.IsType <BossEnemy>(enemy); Assert.Equal("Zombie King", boss.Name); }
private static IEnumerator CoSpawnEnemy(Model.EnemyPlayer enemy, Vector2 pos) { var enemyPlayer = EnemyFactory.Create(enemy, pos); enemyPlayer.StartRun(); yield return(new WaitForSeconds(UnityEngine.Random.Range(0.0f, 0.2f))); }
void Update() { UpdateUI(); if (Input.GetKey("r")) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } _waveManager.ExecuteCurrentWave(); if (_waveManager.CurrentWave.Ended) { // handle wave powerUp if present if (_waveManager.CurrentWave.Definition.HasPowerUp) { var pos = ScreenHelper.GetRandomScreenPoint(y: EnemySpawnPoint.transform.position.y); var powerUpType = _waveManager.CurrentWave.Definition.PowerUp; _powerUpFactory.Create(powerUpType, pos); } _waveManager.MoveNext(); } if (_difficultyManager.CanCreateAsteroid()) { _difficultyManager.NotifyEnemyTypeSelected(EnemyType.Asteroid1); var pos = ScreenHelper.GetRandomScreenPoint(y: EnemySpawnPoint.transform.position.y); _enemyFactory.Create(EnemyType.Asteroid1, pos); } }
public void CreateNormalEnemyByDefault() { EnemyFactory sut = new EnemyFactory(); Enemy enemy = sut.Create("Zombi"); Assert.IsType <NormalEnemy>(enemy); }
public void CreateNormalEnemyByDefault_NotTypeExample() { EnemyFactory sut = new EnemyFactory(); Enemy enemy = sut.Create("Zombi"); Assert.IsNotType <DateTime>(enemy); }
public void NotAllowNullName() { EnemyFactory sut = new EnemyFactory(); //Assert.Throws<ArgumentNullException>( () => sut.Create(null)); Assert.Throws <ArgumentNullException>("name", () => sut.Create(null)); }
public void CreateBossEnemy() { EnemyFactory sut = new EnemyFactory(); Enemy enemy = sut.Create("Zombi King", true); Assert.IsType <BossEnemy>(enemy); }
public void ShouldCreateNormalEnemy() { var sut = new EnemyFactory(); var normalEnemy = sut.Create(false); Assert.That(normalEnemy, Is.TypeOf <NormalEnemy>()); }
public void NotAllowNullName() { //System Under Test EnemyFactory sut = new EnemyFactory(); Assert.ThrowsException <ArgumentNullException>(() => sut.Create(null)); }
public void ShouldCreateBossEnemy() { var sut = new EnemyFactory(); var bossEnemy = sut.Create(true); Assert.That(bossEnemy, Is.TypeOf <BossEnemy>()); }
public void ShouldBeOfBaseType() { var sut = new EnemyFactory(); var bossEnemy = sut.Create(true); Assert.That(bossEnemy, Is.InstanceOf <IEnemy>()); }
public void CreateBossEnemy_AssertAssignableTypes() { var sut = new EnemyFactory(); var enemy = sut.Create("Zombie King", true); Assert.IsAssignableFrom <Enemy>(enemy); }
public void CreateBossEnemy() { var enemy = new EnemyFactory(); var zombieBoss = enemy.Create("Zombie King", true); Assert.IsInstanceOfType(zombieBoss, typeof(BossEnemy)); }
public void CreateNormalEnemyByDefault_NotType() { var sut = new EnemyFactory(); var enemy = sut.Create("Zombie"); Assert.IsNotType <DateTime>(enemy); }
public void ShouldBeOfBaseType() { var sut = new EnemyFactory(); object enemy = sut.Create(true); Assert.That(enemy, Is.InstanceOf <Enemy>()); }
public void ShouldCreateNormalEnemy() { var sut = new EnemyFactory(); object enemy = sut.Create(false); Assert.That(enemy, Is.TypeOf<NormalEnemy>()); }
public void ShouldCreateNormalEnemy() { var sut = new EnemyFactory(); var enemy = sut.Create(false); var normalEnemy = Assert.IsType <NormalEnemy>(enemy); Assert.Equal(10, normalEnemy.ExtraPower); }
public void ShouldBeOfBaseType() { var sut = new EnemyFactory(); object enemy = sut.Create(true); Assert.That(enemy, Is.InstanceOf<Enemy>()); }
public void ShouldCreateBossEnemy() { var sut = new EnemyFactory(); object enemy = sut.Create(true); Assert.That(enemy, Is.TypeOf<BossEnemy>()); }
public void CreateBossEnemy_CastReturnedType() {EnemyFactory sut=new EnemyFactory(); Enemy enemy=sut.Create("Zombie King",true); BossEnemy boss= Assert.IsType<BossEnemy>(enemy); Assert.Equal("Zombie King",boss.Name); }
public void OnlyAllowKingOrQueenBossEnemies() { var sut = new EnemyFactory(); var e = Assert.Throws <EnemyCreationException>(() => sut.Create("Dudda G", true)); Assert.Equal("Dudda G", e.RequestedEnemyName); }
public void ShouldCreateNormalEnemy_Cast() { var test = new EnemyFactory(); object enemy = test.Create(false); NormalEnemy normalEnemy = Assert.IsType<NormalEnemy>(enemy); Assert.Equal(10, normalEnemy.Power); }
public void CreateBossEnemy() { EnemyFactory sut = new EnemyFactory(); Enemy intrygator = sut.Create("Kingorator", true); Assert.IsType <NormalEnemy>(intrygator); }
public void CreateBossEnemyWhenAsked() { var sut = new EnemyFactory(); var enemy = sut.Create("Zombie King", true); Assert.IsType <BossEnemy>(enemy); }
public void CreatNormalEnemyByDefault() { EnemyFactory ef = new EnemyFactory(); Enemy e = ef.Create("Zombie"); Assert.IsType <NormalEnemy>(e); }
public void CreateNormalnEnemyByDefaultver2() { EnemyFactory sut = new EnemyFactory(); Enemy enemy = sut.Create("Krwiopijca"); Assert.IsNotType <DateTime>(enemy); }
public void CreateNormalEnemyByDefault() { EnemyFactory sut = new EnemyFactory(); Enemy enemy = sut.Create("Zombie"); Assert.IsInstanceOfType(enemy, typeof(NormalEnemy)); }
public void CreateBossEnemy() { EnemyFactory sut = new EnemyFactory(); Enemy enemy = sut.Create("Zombie King", true); Assert.IsInstanceOfType(enemy, typeof(BossEnemy)); }
public void IsThathBossName() { EnemyFactory sut = new EnemyFactory(); EnemyCreationException ex = Assert.Throws <EnemyCreationException>(() => sut.Create("Zombie", true)); Assert.Equal("Zombie", ex.RequestedEnemyName); }
public void BeASameInstanceForTwoObjects() { EnemyFactory sut = new EnemyFactory(); Enemy enemy1 = sut.Create("Zombie"); Assert.Same(enemy1, enemy1); }
public void CreateBossEnemy() { var systemUnderTest = new EnemyFactory(); var enemy = systemUnderTest.Create("ZombieKing", true); Assert.IsInstanceOfType(enemy, typeof(BossEnemy)); }
public void CreateNormalEnemyByDefault() { var systemUnderTest = new EnemyFactory(); Enemy enemy = systemUnderTest.Create("Zombie"); Assert.IsInstanceOfType(enemy, typeof(NormalEnemy)); }
public void ShouldHaveExtraPower() { var sut = new EnemyFactory(); object enemy = sut.Create(true); Assert.That(enemy, Has.Property("ExtraPower")); //Assert.That(enemy, Has.Property("SomeOtherProperty")); }
public void Load(IRace selectedPlayerRace) { //TODO implement diff levels //-> pass as parameter in methed the level create sweatch for levels and set for mapPath diff map resourse var mapPath = AppSettings.MapLevel1; var frientFactory = new FriendFactory(); var enemyFactory = new EnemyFactory(); this.PlayerRace = selectedPlayerRace; var width = AppSettings.MapElementSize.Width; var height = AppSettings.MapElementSize.Height; try { using (var reader = new StreamReader(mapPath)) { for (var row = 0; row < AppSettings.MapElementsCountY; row++) { var top = (row*height)+AppSettings.MapPosition.Top; var line = reader.ReadLine(); for (var col = 0; col < AppSettings.MapElementsCountX; col++) { var left = col*width; var currentsymbol = line[col]; switch (currentsymbol) { case 'p': this.Player = new Player(this.PlayerRace) { Position = new Position (left, top), Size = new Size(width, height) }; break; case 'f': this.Friend = (Friend)frientFactory.Create(_friendRace); this.Friend.Position = new Position(left, top); this.Friend.Size = new Size(width, height); break; case 'e': var enemy = (Enemy)enemyFactory.Create(_enemyRace); enemy.Position = new Position (left, top); enemy.Size = new Size(width, height); this.Enemies.Add(enemy); break; case 'w': var mazeElement = new MazeItem() { Position = new Position(left, top), Size = new Size(width, height) }; this.Maze.Add(mazeElement); break; case 'b': var beer = new BeerItem() { Position = new Position(left, top), Size = new Size(width, height) }; this.ItemToCollect.Add(beer); break; case 'l': var itemLife = new LifeItem() { Position = new Position(left, top), Size = new Size(width, height) }; this.ItemToCollect.Add(itemLife); break; case 'h': var itemHealth = new LargeHealthItem() { Position = new Position(left, top), Size = new Size(width, height) }; this.ItemToCollect.Add(itemHealth); break; } } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "BB Game MapLoader"); } }
public void ShouldCreateNormalEnemy_Simple() { var test = new EnemyFactory(); object enemy = test.Create(true); Assert.IsType(typeof(BossEnemy), enemy); }