Last active
January 9, 2021 23:53
-
-
Save ThiagoBarradas/d3d589a095aa31ab46338c8c9578a52c to your computer and use it in GitHub Desktop.
SOLID [S] - Wrong Method
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
public class PaymentService | |
{ | |
public Payment ProcessPayment(Payment payment) | |
{ | |
if (payment.Type == "credit_card") | |
{ | |
// proccess payment with credit card | |
} | |
else if (payment.Type == "debit_card") | |
{ | |
// proccess payment with debit card | |
} | |
else if (payment.Type == "bank_invoice") | |
{ | |
// proccess payment with bank invoice | |
} | |
// some code | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment