//Event Damage One
    public void EVENT_Damage_One()
    {
        int damage = 1;

        model.TakeDamage(damage);
        view.Refresh();
    }
Beispiel #2
0
 public void ButtonAction1()
 {
     sm.TakeDamage(1);
     //view.TakingDamage ();
     print(sm.GetStrength());
     view.UpdatingViewForStrength(sm.GetStrength(), sm.IsRepairable());
 }
Beispiel #3
0
    public void TestAfterEightDamageTenReturnFalse()
    {
        //Arrange
        ShieldModel sm             = new ShieldModel();
        int         damageQuantity = 10;
        int         expectedResult = 20;

        //Act
        bool damageSuccess1 = sm.TakeDamage(damageQuantity);
        bool damageSuccess2 = sm.TakeDamage(damageQuantity);
        bool damageSuccess3 = sm.TakeDamage(damageQuantity);
        bool damageSuccess4 = sm.TakeDamage(damageQuantity);
        bool damageSuccess5 = sm.TakeDamage(damageQuantity);
        bool damageSuccess6 = sm.TakeDamage(damageQuantity);
        bool damageSuccess7 = sm.TakeDamage(damageQuantity);
        bool damageSuccess8 = sm.TakeDamage(damageQuantity);

        bool damageSuccess = sm.TakeDamage(damageQuantity);

        int result = sm.GetStrength();

        //Assert
        Assert.False(sm.TakeDamage(damageQuantity));
        Assert.AreEqual(expectedResult, result);
    }
Beispiel #4
0
 public void Button1Damage()
 {
     shieldModel.TakeDamage(1);
     shieldView.UpdateStrText(shieldModel.GetStrength());
     shieldView.UpdateIsRepairable(shieldModel.IsRepairable());
     Debug.Log(shieldModel.GetStrength());
 }
    public void EVENT_Damage()
    {
        int quantityOfDamage = GetDamageImage();

        model.TakeDamage(quantityOfDamage);
        view.Refresh();
    }
Beispiel #6
0
    public void TestAfterOneDamageOneTickReturnTrue()
    {
        //Arrange
        ShieldModel sm             = new ShieldModel();
        int         damageQuantity = 11;
        int         expectedResult = 99;

        //Act
        bool damageSuccess1 = sm.TakeDamage(damageQuantity);

        int result = sm.GetStrength();

        //Assert
        Assert.True(sm.TakeDamage(damageQuantity));
        Assert.AreEqual(expectedResult, result);
    }
Beispiel #7
0
    public void TestAfterOneDamageNinetyReturnFalse()
    {
        //Arrange
        ShieldModel sm             = new ShieldModel();
        int         damageQuantity = 90;
        int         expectedResult = 20;

        //Act
        bool damageSuccess1 = sm.TakeDamage(damageQuantity);

        int result = sm.GetStrength();

        //Assert
        Assert.False(sm.TakeDamage(damageQuantity));
        Assert.AreEqual(expectedResult, result);
    }
    public void CheckingAfter_10_DamageStrengthIs90()
    {
        ShieldModel sh = new ShieldModel();

        sh.TakeDamage(10);

        Assert.AreEqual(sh.GetStrength(), 90);
    }
    public void CheckingAfter_10_DamageIsRepairableTrue()
    {
        ShieldModel sh = new ShieldModel();

        sh.TakeDamage(10);

        Assert.AreEqual(sh.IsRepairable(), true);
    }
    public void CheckingAfter_90_DamageIsRepairable_False()
    {
        ShieldModel sh = new ShieldModel();

        sh.TakeDamage(90);

        Assert.AreEqual(sh.IsRepairable(), false);
    }
    public void IsStrengh90After10Damage()
    {
        ShieldModel model = new ShieldModel();

        model.TakeDamage(10);

        Assert.AreEqual(model.GetStrength(), 90);
    }
    public void OneDamageOfNinetyActionTest()
    {
        ShieldModel sm = new ShieldModel();

        sm.TakeDamage(90);
        Assert.AreEqual(10, sm.GetStrength());
        Assert.IsFalse(sm.IsRepairable());
    }
    public void IsRepairableReturnsTrueAfter10Damage()
    {
        ShieldModel model = new ShieldModel();

        model.TakeDamage(10);

        Assert.AreEqual(model.IsRepairable(), true);
    }
    public void TestIfAfter1dmgOf1IsRepairableIsTrueAndStrenghtIs99()
    {
        ShieldModel shieldModel2 = new ShieldModel();

        shieldModel2.TakeDamage(1);
        Assert.AreEqual(shieldModel2.IsRepairable(), true);
        Assert.AreEqual(shieldModel2.GetStrength(), 99);
    }
    public void TestIfAfter1dmgOf11and1tickStrenghtIs99()
    {
        ShieldModel shieldModel6 = new ShieldModel();

        shieldModel6.TakeDamage(11);
        shieldModel6.Tick();
        Assert.AreEqual(shieldModel6.GetStrength(), 99);
    }
    public void OneDamageOfElevenAndOneTickActionTest()
    {
        ShieldModel sm = new ShieldModel();

        sm.TakeDamage(11);
        sm.Tick();
        Assert.AreEqual(99, sm.GetStrength());
    }
    public void TestIfAfter1dmgOf90IsRepairableIsFalseAndStrenghtIs10()
    {
        ShieldModel shieldModel5 = new ShieldModel();

        shieldModel5.TakeDamage(90);
        Assert.AreEqual(shieldModel5.IsRepairable(), false);
        Assert.AreEqual(shieldModel5.GetStrength(), 10);
    }
    public void TestIfAfter1dmgOf10IsRepairableIsTrueAndStrenghtIs90()
    {
        ShieldModel shieldModel3 = new ShieldModel();

        shieldModel3.TakeDamage(10);
        Assert.AreEqual(shieldModel3.IsRepairable(), true);
        Assert.AreEqual(shieldModel3.GetStrength(), 90);
    }
    public void OneDamageOfTenActionTest()
    {
        ShieldModel sm = new ShieldModel();

        sm.TakeDamage(10);
        Assert.AreEqual(90, sm.GetStrength());
        Assert.IsTrue(sm.IsRepairable());
    }
    public void IsStrength99After11DamageAndTick()
    {
        ShieldModel model = new ShieldModel();

        model.TakeDamage(11);
        model.Tick();

        Assert.AreEqual(model.GetStrength(), 99);
    }
    public void CheckingAfter_11_DamageAfterTickStrengthIs10()
    {
        ShieldModel sh = new ShieldModel();

        sh.TakeDamage(11);
        sh.Tick();

        Assert.AreEqual(sh.GetStrength(), 99);
    }
    public void TestDamage11Tick1Strength99()
    {
        // Use the Assert class to test conditions.
        ShieldModel shieldModel = new ShieldModel();

        shieldModel.TakeDamage(11);
        shieldModel.Tick();
        Assert.AreEqual(99, shieldModel.GetStrength());
    }
    public void TestDamage1Strength99()
    {
        // Use the Assert class to test conditions.
        ShieldModel shieldModel = new ShieldModel();

        shieldModel.TakeDamage(1);
        Assert.IsTrue(shieldModel.IsRepairable());
        Assert.AreEqual(99, shieldModel.GetStrength());
    }
    public void IsRepairableReturnsFalseAfterOne90Damage()
    {
        ShieldModel model = new ShieldModel();

        model.TakeDamage(90);


        Assert.AreEqual(model.IsRepairable(), false);
    }
    public void TestDamage90Strength10()
    {
        // Use the Assert class to test conditions.
        ShieldModel shieldModel = new ShieldModel();

        shieldModel.TakeDamage(90);
        Assert.IsFalse(shieldModel.IsRepairable());
        Assert.AreEqual(10, shieldModel.GetStrength());
    }
Beispiel #26
0
    public void TestAfterDamageAndTick()
    {
        ShieldModel sm = new ShieldModel();

        sm.TakeDamage(11);
        sm.Tick();
        int strength = sm.GetStrength();

        Assert.That(strength == 99);
    }
    public void TestAfterDamage11And1TickStrength99()
    {
        ShieldModel sm       = new ShieldModel();
        int         expected = 99;

        sm.TakeDamage(11);
        sm.Tick();
        int result = sm.GetStrength();

        Assert.AreEqual(expected, result);
    }
    public void CheckingAfter_80_DamageIsRepairable_False()
    {
        ShieldModel sh = new ShieldModel();

        for (int i = 0; i < 8; i++)
        {
            sh.TakeDamage(10);
        }

        Assert.AreEqual(sh.IsRepairable(), false);
    }
Beispiel #29
0
    public void TestAfterNinetyDamage()
    {
        ShieldModel sm = new ShieldModel();

        sm.TakeDamage(90);
        int  strength     = sm.GetStrength();
        bool isRepairable = sm.IsRepairable();

        Assert.False(isRepairable);
        Assert.That(strength == 10);
    }
    public void EightDamageOfTenActionTest()
    {
        ShieldModel sm = new ShieldModel();

        for (int i = 0; i < 8; i++)
        {
            sm.TakeDamage(10);
        }
        Assert.AreEqual(20, sm.GetStrength());
        Assert.IsFalse(sm.IsRepairable());
    }