public void TestEquality() { var email1 = new EmailAddress("*****@*****.**"); Assert.AreEqual(email1, email1); var email2 = new EmailAddress("*****@*****.**"); Assert.AreEqual(email1, email2); }
private static EventAttendee CreateAttendee(string firstName, string lastName) { var name = new PersonName(firstName, lastName); var email = new EmailAddress("*****@*****.**"); var phone = new PhoneNumber("2055551212"); var address = new Address("123 Main St.", "Suite 1", "Los Angeles", 10, "90036"); return new EventAttendee(name, address, email, phone, firstName, lastName); }
/// <summary> /// Creates the attendee. /// </summary> /// <param name="attendeeDto">The attendee dto.</param> /// <returns></returns> public static EventAttendee CreateAttendee(AttendeeDto attendeeDto) { var name = new PersonName(attendeeDto.FirstName, attendeeDto.LastName); var address = new Address(attendeeDto.Address1, attendeeDto.Address2, attendeeDto.City, attendeeDto.StateId, attendeeDto.PostalCode); var phone = new PhoneNumber(attendeeDto.PrimaryPhone); var email = new EmailAddress(attendeeDto.EmailAddress); var attendee = new EventAttendee(name, address, email, phone, attendeeDto.FirstName, attendeeDto.LastName, attendeeDto.DynamicColumnsData, attendeeDto.ProfileId, attendeeDto.UserId, attendeeDto.DidAttend); return attendee; }
public void TestInequality() { var name = new PersonName("John", "Doe"); var email = new EmailAddress("*****@*****.**"); var phone = new PhoneNumber("2055551212"); var address = new Address("123 Main St.", "Suite 1", "Los Angeles", 5, "90036"); var attendee1 = new EventAttendee(name, address, email, phone,"John", "Doe"); name = new PersonName("Jane", "Doe"); var attendee2 = new EventAttendee(name, address, email, phone,"John", "Doe"); Assert.AreNotEqual(attendee1, attendee2); }
public void TestConstruction() { var name = new PersonName("John", "Doe"); var email = new EmailAddress("*****@*****.**"); var phone = new PhoneNumber("2055551212"); var address = new Address("123 Main St.", "Suite 1", "Los Angeles", 5, "90036"); var attendee = new EventAttendee(name, address, email, phone, "John", "Doe"); Assert.AreEqual(name, attendee.Name); Assert.AreEqual(address, attendee.Address); Assert.AreEqual(phone, attendee.Phone); Assert.AreEqual(email, attendee.Email); }
/// <summary> /// Equalses the specified other. /// </summary> /// <param name="other">The other.</param> /// <returns></returns> public bool Equals(EmailAddress other) { return other.Value == Value; }
public void TestToString() { var email = new EmailAddress("*****@*****.**"); Assert.AreEqual("*****@*****.**", email.ToString()); }
public void TestConstruction_TooLong() { var email = new EmailAddress(new string('*', 51)); }
public void TestConstruction_EmptyValue() { var email = new EmailAddress(""); }
public void TestConstruction() { var email = new EmailAddress("*****@*****.**"); Assert.AreEqual("*****@*****.**", email.Value); }