samedi 2 mars 2019

How do I need kill the mutants if it have same result

My Production Code like this

public override double GetCharge(int daysRented)
{
    double result = 2;
    if (daysRented > 2)
        result += (daysRented - 2) * 1.5;
    return result;
}

It's mutants is

public override double GetCharge(int daysRented)
{
    double result = 2;
    if (daysRented >= 2)
        result += (daysRented - 2) * 1.5;
    return result;
}

I can't kill the mutants when the daysRented is 2, the if condition daysRented > 2 will not true and return 2 and the if condition daysRented >= 2 will true but add zero , so it also return 2

Should I try to kill the mutants ?? or just ignore it ?

Aucun commentaire:

Enregistrer un commentaire