public void CopyTo_Should_Throw_ArgumentNullException_When_Copy_Target_Is_Null() { Contact contact = new EmailContact(); Action act = () => contact.CopyTo(null); act.Should().Throw <ArgumentNullException>(); }
public void CopyTo_Should_Throw_ArgumentException_When_Copy_Target_Is_Not_The_Same_Type_As_Copy_Origin() { Contact emailContact = new EmailContact(); Contact phoneContact = new PhoneContact(); Action act = () => emailContact.CopyTo(phoneContact); act.Should().Throw <ArgumentException>().WithMessage("Copy origin and copy target must be of the same type."); }
public void CopyTo_Should_Copy_EmailContact_Address_Property() { EmailContact emailContact = new EmailContact { Address = "*****@*****.**" }; EmailContact emailContactCopyTarget = new EmailContact { Address = "*****@*****.**" }; emailContact.CopyTo(emailContactCopyTarget); emailContactCopyTarget.Address.Should().Be(emailContact.Address); }
public void CopyTo_Should_Copy_Contact_Person_Property() { Contact contact = new EmailContact { Address = "*****@*****.**", Person = new Person { Name = "personName" } }; Contact copyTargetContact = new EmailContact(); contact.CopyTo(copyTargetContact); copyTargetContact.Person.Should().Be(contact.Person); }
public void CopyTo_Should_Copy_Contact_Name_Property() { Contact contact = new EmailContact { Address = "*****@*****.**", Name = "EmailContactName" }; Contact copyTargetContact = new EmailContact { Name = "CopyTargetEmailContactName" }; contact.CopyTo(copyTargetContact); copyTargetContact.Name.Should().Be(contact.Name); }