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
internal static void SplitDirectoryFile(string path, out string directory, out string file) | |
{ | |
directory = null; | |
file = null; | |
// assumes a validated full path | |
if (path != null) | |
{ | |
int length = path.Length; | |
int rootLength = GetRootLength(path); |
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
Items = new Meteor.Collection("items"); | |
if (Meteor.isClient) { | |
Template.list.helpers({ | |
items: function() { | |
return Items.find(); | |
}, | |
doneClass: function() { | |
if(this.done) | |
return "done"; |
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
<head> | |
<title>Spartan TODO</title> | |
</head> | |
<body> | |
<h1>DO OR DIE!</h1> | |
{{> list}} | |
{{> controls }} | |
</body> |
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. |
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 ValidateCustomer(int maximumAge) | |
{ | |
//... | |
} | |
ValidateCustomer(25); | |
// Using an Age class to restrict values | |
public class Age |
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) | |
{ | |
// ... |
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, string customerType, int numberOfTries) | |
{ | |
// ... | |
} | |
var loginInfo = new LoginInfo("Darth Vader", "ihatewookes"); | |
LoginAsCustomer(loginInfo, "New Customer", 3); |
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(string userName, string password, string customerType, int numberOfTries) | |
{ | |
// ... | |
} | |
// Code to call the method | |
LoginAsCustomer("Darth Vader", "ihatewookies", "New Customer", 3); |