Skip to content

Instantly share code, notes, and snippets.

View gilzilberfeld's full-sized avatar

Gil Zilberfeld gilzilberfeld

View GitHub Profile
def "Cap and Iron Man Beat Thanos"() {
given:
createTeam('Avengers')
addAvenger('Captain America')
addAvenger('Iron Man')
badGuyArrives('Thanos')
when:
fight()
public void UpdateStreet(string newStreet) {
if(string.IsNullOrEmpty(newStreet) &&
!newStreet.StartsWith(" ") &&
!newStreet.StartsWith("@")) {
Address address = new Address(this);
address.SetStreet(newStreet);
}
}
}
public void UpdateStreet(string newStreet)
{
if (ValidateStreet(newStreet))
{
Address address = new Address(this);
address.SetStreet(newStreet);
}
}
private bool ValidateStreet(string street)
public void UpdateStreet(string newStreet) {
if (StreetValidator.Validate(newStreet)) {
Address address = new Address(this);
address.SetStreet(newStreet);
}
}
public void UpdateStreet(string otherStreet) {
if(string.IsNullOrEmpty(otherStreet) &&
!otherStreet.StartsWith(" ") &&
!otherStreet.StartsWith("@")) &&
currentAddress.GetStreet().CompareTo(otherStreet) == 0) {
Address address = new Address(this);
address.SetStreet(otherStreet);
}
}
}
private bool ValidateStreet(string street) {
return string.IsNullOrEmpty(street) &&
!street.StartsWith(" ") &&
!street.StartsWith("@") &&
currentAddress.GetStreet().CompareTo(street) == 0;
}
private bool ValidateStreet(string street, Address currentAddress)
{
return string.IsNullOrEmpty(street) &&
!street.StartsWith(" ") &&
!street.StartsWith("@") &&
currentAddress.GetStreet().CompareTo(street) == 0;
}