コード例 #1
0
 public void MustNotHaveInvalidEmail(string invalidEmail)
 {
     // Then
     Assert.Throws <DomainException>(() =>
                                     MemberContactsBuilder.New().WithEmail(invalidEmail).Build())
     .WithMessage(MemberContactsValidation.EmailIsInvalid);
 }
コード例 #2
0
        public void MustNotHaveInvalidPhone(string phone)
        {
            // Given
            var phoneInvalid = new List <string> {
                phone
            };

            // Then
            Assert.Throws <DomainException>(() =>
                                            MemberContactsBuilder.New().WithPhones(phoneInvalid).Build())
            .WithMessage(MemberContactsValidation.PhoneIsInvalid);
        }
コード例 #3
0
        public void MustNotHaveDuplicatedPhone()
        {
            // Given
            var phoneInvalid = new List <string> {
                "1112345678",
                "1112345678"
            };

            // Then
            Assert.Throws <DomainException>(() =>
                                            MemberContactsBuilder.New().WithPhones(phoneInvalid).Build())
            .WithMessage(MemberContactsValidation.PhoneIsDuplicated);
        }
コード例 #4
0
 public MemberContactsTest()
 {
     _memberContacts = MemberContactsBuilder.New().Build();
 }