Created
May 15, 2014 16:38
-
-
Save jsonmez/7dbfaaeec35a4520fa6c to your computer and use it in GitHub Desktop.
Using reasonable defaults and optional parameters
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 void LoginAsCustomer(LoginInfo loginInfo, CustomerType customerType = CustomerType.NEW_CUSTOMER, int numberOfTries = 3) | |
{ | |
// ... | |
} | |
var loginInfo = new LoginInfo("Darth Vader", "ihatewookes"); | |
LoginAsCustomer(loginInfo); | |
// What if we need to override a default? No problem. | |
LoginAsCustomer(loginInfo, customerType: CustomerType.REWARDS_CUSTOMER); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment