jeudi 16 juillet 2020

Elegant way to overcome long if-else condition [closed]

What should be the elegant way or suggested design pattern to overcome long if-else-if condition in a unit testable way using c#

  if(Creditcard)
  {
  }
  else if(BankAccount)
  {
  }
  else if(CardLost)
  {
  }
  else if(Others)
  {
  }
  else if()
  ...

Aucun commentaire:

Enregistrer un commentaire