Created
May 15, 2014 15:41
-
-
Save jsonmez/ffb16d2aee85fc364dc6 to your computer and use it in GitHub Desktop.
Using enumerations to restrict choices in customer API
This file contains 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 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