Skip to content

Instantly share code, notes, and snippets.

@jsonmez
Created May 15, 2014 15:41
Show Gist options
  • Save jsonmez/ffb16d2aee85fc364dc6 to your computer and use it in GitHub Desktop.
Save jsonmez/ffb16d2aee85fc364dc6 to your computer and use it in GitHub Desktop.
Using enumerations to restrict choices in customer API
public enum CustomerType
{
NEW_CUSTOMER,
REWARDS_CUSTOMER,
REGULAR_CUSTOMER
}
public void LoginAsCustomer(LoginInfo loginInfo, CustomerType customerType, int numberOfTries)
{
// ...
}
var loginInfo = new LoginInfo("Darth Vader", "ihatewookes");
LoginAsCustomer(loginInfo, CustomerType.NEW_CUSTOMER, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment