예제 #1
0
 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);
 }
예제 #3
0
 /// <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;
 }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
 /// <summary>
 /// Equalses the specified other.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns></returns>
 public bool Equals(EmailAddress other)
 {
     return other.Value == Value;
 }
예제 #7
0
 public void TestToString()
 {
     var email = new EmailAddress("*****@*****.**");
     Assert.AreEqual("*****@*****.**", email.ToString());
 }
예제 #8
0
 public void TestConstruction_TooLong()
 {
     var email = new EmailAddress(new string('*', 51));
 }
예제 #9
0
 public void TestConstruction_EmptyValue()
 {
     var email = new EmailAddress("");
 }
예제 #10
0
 public void TestConstruction()
 {
     var email = new EmailAddress("*****@*****.**");
     Assert.AreEqual("*****@*****.**", email.Value);
 }