public void MustNotHaveInvalidEmail(string invalidEmail) { // Then Assert.Throws <DomainException>(() => MemberContactsBuilder.New().WithEmail(invalidEmail).Build()) .WithMessage(MemberContactsValidation.EmailIsInvalid); }
public void MustNotHaveInvalidPhone(string phone) { // Given var phoneInvalid = new List <string> { phone }; // Then Assert.Throws <DomainException>(() => MemberContactsBuilder.New().WithPhones(phoneInvalid).Build()) .WithMessage(MemberContactsValidation.PhoneIsInvalid); }
public void MustNotHaveDuplicatedPhone() { // Given var phoneInvalid = new List <string> { "1112345678", "1112345678" }; // Then Assert.Throws <DomainException>(() => MemberContactsBuilder.New().WithPhones(phoneInvalid).Build()) .WithMessage(MemberContactsValidation.PhoneIsDuplicated); }
public MemberContactsTest() { _memberContacts = MemberContactsBuilder.New().Build(); }