Exemplo n.º 1
0
    public void AttackTest()
    {
        VehicleUnit testAttacker = new VehicleUnit(100, 10, 10, float.MaxValue);
        VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue);
        testAttacker.AttackCost = 5;
        testAttacker.IsNotTesting = false;
        testAttacker.Attack(testDefender);

        int expected = 90;
        int actual = testDefender.Health;

        Assert.AreEqual(expected, actual);
    }
Exemplo n.º 2
0
    public void AttackIfAPIsGreaterThanAC()
    {
        VehicleUnit testAttacker = new VehicleUnit(100, 10, 10, float.MaxValue);
        VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue);
        testAttacker.AttackCost = 5;
        testAttacker.IsNotTesting = false;
        testAttacker.Attack(testDefender);

        int expectedAP = 5;
        int actualAP = testAttacker.ActionPoints;

        int expedtedHP = 90;
        int actualHP = testDefender.Health;

        Assert.AreEqual(expectedAP, actualAP);
        Assert.AreEqual(expedtedHP, actualHP);
    }
Exemplo n.º 3
0
    public void NoAttackIfACIsZero()
    {
        VehicleUnit testAttacker = new VehicleUnit(100, 10, 10, float.MaxValue);
        VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue);
        testAttacker.AttackCost = 0;
        testAttacker.IsNotTesting = false;
        testAttacker.Attack(testDefender);

        int expectedAP = 10;
        int actualAP = testAttacker.ActionPoints;

        int expedtedHP = 100;
        int actualHP = testDefender.Health;

        Assert.AreEqual(expectedAP, actualAP);
        Assert.AreEqual(expedtedHP, actualHP);
    }
Exemplo n.º 4
0
    public void NoDamageWhenLessThanZero()
    {
        VehicleUnit testAttacker = new VehicleUnit(100, -10, 10, float.MaxValue);
        VehicleUnit testDefender = new VehicleUnit(100, 10, 10, float.MaxValue);
        testAttacker.AttackCost = 5;
        testAttacker.IsNotTesting = false;
        testAttacker.Attack(testDefender);

        int expedtedHP = 100;
        int actualHP = testDefender.Health;

        Assert.AreEqual(expedtedHP, actualHP);
    }