public void TestStrength()
    {
        // Use the Assert class to test conditions.
        ShieldModel shieldModel = new ShieldModel();

        Assert.AreEqual(100, shieldModel.GetStrength());
    }
Beispiel #2
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);
    }
    public void OneDamageOfTenActionTest()
    {
        ShieldModel sm = new ShieldModel();

        sm.TakeDamage(10);
        Assert.AreEqual(90, sm.GetStrength());
        Assert.IsTrue(sm.IsRepairable());
    }
    public void TestEightDamageOfTen()
    {
        //Arrange
        ShieldModel sm     = new ShieldModel();
        int         damage = 10;

        bool damage1        = sm.TakeDamage(damage * 8);
        int  expectedResult = sm.GetStrength();

        //Act
        int  result     = sm.GetStrength();
        bool repairable = sm.IsRepairable();

        //Assert
        Assert.IsFalse(repairable);
        Assert.AreEqual(result, expectedResult);
    }
    public void TestIfAfter1dmgOf11and1tickStrenghtIs99()
    {
        ShieldModel shieldModel6 = new ShieldModel();

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

        model.TakeDamage(10);

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

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

        shieldModel5.TakeDamage(90);
        Assert.AreEqual(shieldModel5.IsRepairable(), false);
        Assert.AreEqual(shieldModel5.GetStrength(), 10);
    }
    public void TestOneDamageOfTen()
    {
        //Arrange
        ShieldModel sm             = new ShieldModel();
        int         damage         = 10;
        bool        repairable     = sm.TakeDamage(damage);
        int         expectedResult = sm.GetStrength();

        //Act

        int result = sm.GetStrength();


        //Assert
        Assert.IsTrue(repairable);
        Assert.AreEqual(expectedResult, result);
    }
    public void TestIfAfter1dmgOf1IsRepairableIsTrueAndStrenghtIs99()
    {
        ShieldModel shieldModel2 = new ShieldModel();

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

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

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

        sh.TakeDamage(10);

        Assert.AreEqual(sh.GetStrength(), 90);
    }
Beispiel #14
0
 public void ButtonAction1()
 {
     sm.TakeDamage(1);
     //view.TakingDamage ();
     print(sm.GetStrength());
     view.UpdatingViewForStrength(sm.GetStrength(), sm.IsRepairable());
 }
    public void IsStrength99After11DamageAndTick()
    {
        ShieldModel model = new ShieldModel();

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

        Assert.AreEqual(model.GetStrength(), 99);
    }
    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());
    }
    public void InitialStrength()
    {
        ShieldModel sm = new ShieldModel();
        int         expectedStrength = 100;

        int result = sm.GetStrength();

        Assert.AreEqual(expectedStrength, result);
    }
    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 TestWhenCreatedStrength100()
    {
        ShieldModel sm       = new ShieldModel();
        int         expected = 100;

        int result = sm.GetStrength();

        Assert.AreEqual(expected, result);
    }
Beispiel #22
0
    public void TakingDamage()
    {
        if (sm.GetStrength() > 90)
        {
            //circleImage = images [9];
            images[9] = circleImage.mainTexture;
        }
        else if (sm.GetStrength() > 80)
        {
            //circleImage = images [8];
        }
        else if (sm.GetStrength() > 70)
        {
            //circleImage = images [7];
        }
        else if (sm.GetStrength() > 60)
        {
            //circleImage = images [6];
        }
        else if (sm.GetStrength() > 50)
        {
            //circleImage = images [5];
        }
        else if (sm.GetStrength() > 40)
        {
            //circleImage = images [4];
        }
        else if (sm.GetStrength() > 30)
        {
            //circleImage = images [3];
        }
        else if (sm.GetStrength() > 20)
        {
//			circleImage = images [2];
        }
        else if (sm.GetStrength() > 10)
        {
            //circleImage = images [1];
        }
        else if (sm.GetStrength() > 0)
        {
            //circleImage = images [0];
        }
    }
Beispiel #23
0
    public void TestStrengthIs100()
    {
        // Use the Assert class to test conditions.
        ShieldModel sm = new ShieldModel();
        int         expectedStrength = 100;

        int result = sm.GetStrength();

        Assert.AreEqual(expectedStrength, result);
    }
Beispiel #24
0
    public void TestAfterDamageAndTick()
    {
        ShieldModel sm = new ShieldModel();

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

        Assert.That(strength == 99);
    }
Beispiel #25
0
    public void TestStrengthOneHundred()
    {
        ShieldModel sm             = new ShieldModel();
        int         expectedResult = 100;

        //Act
        int result = sm.GetStrength();

        //Assert
        Assert.AreEqual(expectedResult, result);
    }
Beispiel #26
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 TestAfterDamage11And1TickStrength99()
    {
        ShieldModel sm       = new ShieldModel();
        int         expected = 99;

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

        Assert.AreEqual(expected, result);
    }
    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());
    }
Beispiel #29
0
    public void TestStrengthIs100()
    {
        //Arrange
        ShieldModel sm             = new ShieldModel();
        int         expectedResult = 100;

        //Act
        int result = sm.GetStrength();

        //Assert
        Assert.AreEqual(expectedResult, result);
    }
Beispiel #30
0
    public void TestWhenCreatedStrengthOnehundred()
    {
        //Arange
        ShieldModel sm             = new ShieldModel();
        int         expectedResult = 100;

        //Act
        int result = sm.GetStrength();

        //assert
        Assert.AreEqual(expectedResult, result);
    }