Skip to content

Instantly share code, notes, and snippets.

@Restuta
Created November 20, 2012 04:19
Show Gist options
  • Select an option

  • Save Restuta/4115977 to your computer and use it in GitHub Desktop.

Select an option

Save Restuta/4115977 to your computer and use it in GitHub Desktop.
"New" test helper
//What do you thing about usage of "New" class as a test helper
var @event = new ContactCreatedEvent(Guid.NewGuid(), New.ContactDetails());
// ^^^^^^
public static class New
{
public static ContactDetails ContactDetails()
{
var contactDetails = new ContactDetails
{
BirthdayTimestamp = new DateTime(1986, 1, 1).Ticks,
Company = "company",
Department = "department",
Email = "email",
JobTitle = "jobTitle",
PhoneNumber = "phone_number",
ProfileImageUrl = "img_url",
Addresses = new List<StreetAddress>() { new StreetAddress() }
};
return contactDetails;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment