Esempio n. 1
0
        public virtual void ChangeContactInformation(ContactInformation contactInformation)
        {
            this.ContactInformation = contactInformation;

            DomainEventPublisher.Instance.Publish(new PersonContactInformationChanged(this.TenantId, this.User.UserName,
                this.ContactInformation));
        }
        public PersonContactInformationChanged(TenantId tenantId, string userName, ContactInformation contactInformation)
        {
            this.TenantId = tenantId.Id;
            this.UserName = userName;
            this.ContactInformation = contactInformation;

            this.EventVersion = 1;
            this.OccurredOn = DateTime.Now;
        }
        public void TestChangeEmailAddress()
        {
            ContactInformation contactInformation = this.ContactInformation();
            ContactInformation contactInformationCopy = new ContactInformation(contactInformation);

            const string changeEmailAddress = "*****@*****.**";
            ContactInformation contactInformation2 = contactInformation.ChangeEmailAddress(new EmailAddress(changeEmailAddress));

            Assert.AreEqual(contactInformationCopy, contactInformation);
            Assert.IsFalse(contactInformation.Equals(contactInformation2));
            Assert.IsFalse(contactInformationCopy.Equals(contactInformation2));

            Assert.AreEqual(changeEmailAddress, contactInformation2.EmailAddress.Address);
        }
        public void TestChangeSecondaryTelephone()
        {
            ContactInformation contactInformation = this.ContactInformation();
            ContactInformation contactInformationCopy = new ContactInformation(contactInformation);

            const string changeNumber = "720-555-1212";
            ContactInformation contactInformation2 =
                contactInformation.ChangeSecondaryTelephone(new Telephone(changeNumber));

            Assert.AreEqual(contactInformationCopy, contactInformation);
            Assert.IsFalse(contactInformation.Equals(contactInformation2));
            Assert.IsFalse(contactInformationCopy.Equals(contactInformation2));

            Assert.AreEqual(changeNumber, contactInformation2.SecondaryTelephone.Number);
        }
        public void TestChangePostalAddress()
        {
            ContactInformation contactInformation = this.ContactInformation();
            ContactInformation contactInformationCopy = new ContactInformation(contactInformation);

            ContactInformation contactInformation2 = contactInformation.ChangePostalAddress(
                new PostalAddress("321 Mockingbird Lane", "Denver", _stateProvince, "81121", _countryCode));

            Assert.AreEqual(contactInformationCopy, contactInformation);
            Assert.IsFalse(contactInformation.Equals(contactInformation2));
            Assert.IsFalse(contactInformationCopy.Equals(contactInformation2));

            Assert.AreEqual("321 Mockingbird Lane", contactInformation2.PostalAddress.StreetAddress);
            Assert.AreEqual("Denver", contactInformation2.PostalAddress.City);
            Assert.AreEqual(_stateProvince, contactInformation.PostalAddress.StateProvince);
        }
Esempio n. 6
0
 public virtual void ChangePersonalContactInformation(ContactInformation contactInformation)
 {
     Person.ChangeContactInformation(contactInformation);
 }
 public ContactInformation(ContactInformation contactInformation)
     : this(contactInformation.EmailAddress, contactInformation.PostalAddress,
         contactInformation.PrimaryTelephone, contactInformation.SecondaryTelephone)
 {
 }
Esempio n. 8
0
 public Person(TenantId tenantId, FullName name, ContactInformation contactInformation)
 {
     this.TenantId = tenantId;
     this.Name = name;
     this.ContactInformation = contactInformation;
 }