Last active
June 26, 2024 17:58
-
-
Save franreyes/a4c6ddd3f3936fa6d0a0d2f00a527735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Budget { | |
public double CalculateTotal() { ... } | |
} | |
/* ---- */ | |
OneClient { | |
... | |
budget.CalculateTotal(); | |
... | |
} | |
/* ---- */ | |
OtherClient { | |
... | |
budget.CalculateTotal(); | |
... | |
} | |
/* new changes => Take into account spanish taxes */ | |
OneClient { | |
... | |
budget.CalculateTotal(0); | |
... | |
} | |
/* ---- */ | |
OtherClient { | |
... | |
budget.CalculateTotal(0); | |
... | |
} | |
/* ---- */ | |
Budget { | |
public double CalculateTotal(int taxAmount) { ... } | |
} | |
/* remove duplicated code */ | |
OneClient { | |
... | |
budget.CalculateTotal(spainTaxes.Get()); | |
... | |
} | |
/* ---- */ | |
OtherClient { | |
... | |
budget.CalculateTotal(spainTaxes.Get()); | |
... | |
} | |
/* ---- */ | |
Budget { | |
public double CalculateTotal(int taxAmount) { ... } | |
} | |
SpainTaxes { | |
public int Get() { | |
return 0; | |
} | |
} | |
/* new changes => last step when finish to add code in Budget */ | |
SpainTaxes { | |
public int Get() { | |
return 21; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment