PiggyBankTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
      CreepyTowers.Tests CreepyTowersGameForTests
        CreepyTowers.Tests.Avatars PiggyBankTests

Namespace: CreepyTowers.Tests.Avatars
Assembly: CreepyTowers.Tests (in CreepyTowers.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class PiggyBankTests : CreepyTowersGameForTests

The PiggyBankTests type exposes the following members.

Constructors

  NameDescription
Public methodPiggyBankTests
Initializes a new instance of the PiggyBankTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodDispose (Inherited from CreepyTowersGameForTests.)
Public methodInitialize (Inherited from CreepyTowersGameForTests.)
Public methodInitializeCreepyTowersMockContentLoader (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.)
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodPiggyBankPayDayBuffLasts5Seconds
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSetUp
Public methodSpawnCoinMinefield
Public methodTriggeringPiggyBankPayDayMakesCreepsDropMoreGold
Top
Fields

  NameDescription
Protected fieldgame (Inherited from CreepyTowersGameForTests.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void SpawnCoinMinefield()
{
    Assert.AreEqual(5, coins.Count);
    Assert.AreEqual(new Vector3D(0.5f, 1.5f, 0.0f), coins[0].Position);
    Assert.IsTrue(coins[0].IsActive);
}
[Test]
public void TriggeringPiggyBankPayDayMakesCreepsDropMoreGold()
{
    var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f));
    var gold = creep.GetStatValue("Gold");
    pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused);
    AdvanceTimeAndUpdateEntities(4.9f);
    Assert.AreEqual(1.5f, creep.GetStatValue("Gold") / gold);
}
[Test]
public void PiggyBankPayDayBuffLasts5Seconds()
{
    var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f));
    var gold = creep.GetStatValue("Gold");
    pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused);
    AdvanceTimeAndUpdateEntities(5.1f);
    Assert.GreaterOrEqual(creep.GetStatValue("Gold"), gold);
}
See Also