BuffTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
      CreepyTowers.Tests CreepyTowersGameForTests
        CreepyTowers.Tests.Stats BuffTests

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

public class BuffTests : CreepyTowersGameForTests

The BuffTests type exposes the following members.

Constructors

  NameDescription
Public methodBuffTests
Initializes a new instance of the BuffTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodConstructor
Public methodDispose (Inherited from CreepyTowersGameForTests.)
Public methodInitialize (Inherited from CreepyTowersGameForTests.)
Public methodInitializeCreepyTowersMockContentLoader (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.)
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodIsExpiredWhenElapsedIsAboveDuration
Public methodIsNotExpiredWhenDurationIsZero
Public methodIsNotExpiredWhenElapsedIsBelowDuration
Public methodProperties
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Fields

  NameDescription
Protected fieldgame (Inherited from CreepyTowersGameForTests.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void Constructor()
{
    var stat = new Stat(100.0f);
    var effect = new BuffEffect("TestGoldBuff");
    var buff = new Buff(stat, effect);
    Assert.AreEqual(stat, buff.Stat);
    Assert.AreEqual(effect, buff.Effect);
    Assert.AreEqual(0, buff.Elapsed);
}
[Test]
public void Properties()
{
    var stat = new Stat(100.0f);
    const float Elapsed = 4.0f;
    var effect = new BuffEffect("TestGoldBuff");
    var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff"))
    {
        Stat = stat,
        Effect = effect,
        Elapsed = Elapsed
    };
    Assert.AreEqual(stat, buff.Stat);
    Assert.AreEqual(effect, buff.Effect);
    Assert.AreEqual(Elapsed, buff.Elapsed);
}
[Test]
public void IsNotExpiredWhenDurationIsZero()
{
    var buff = new Buff(new Stat(0.0f), new BuffEffect("DragonRangeMultiplier")) { Elapsed = 10 };
    Assert.IsFalse(buff.IsExpired);
}
[Test]
public void IsNotExpiredWhenElapsedIsBelowDuration()
{
    var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff")) { Elapsed = 4};
    Assert.IsFalse(buff.IsExpired);
}
[Test]
public void IsExpiredWhenElapsedIsAboveDuration()
{
    var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff")) { Elapsed = 10 };
    Assert.IsTrue(buff.IsExpired);
}
See Also