コード例 #1
0
        public void AreDisposableConsideredFree()
        {
            Assert.NotNull(EmailSamples.Disposable);
            Assert.NotEmpty(EmailSamples.Disposable);

            foreach (var disposableEmail in EmailSamples.Disposable)
            {
                Assert.True(IsBizMail.IsFreeMailAddress(disposableEmail), $"{disposableEmail} is disposable");
            }
        }
コード例 #2
0
        public void DoPatternsWork()
        {
            Assert.NotNull(EmailSamples.DomainPatterns);
            Assert.NotEmpty(EmailSamples.DomainPatterns);

            foreach (var patternEmail in EmailSamples.DomainPatterns)
            {
                Assert.True(IsBizMail.IsFreeMailAddress(patternEmail), $"{patternEmail} is free");
            }
        }
コード例 #3
0
        public void AreFreeConsideredFree()
        {
            Assert.NotNull(EmailSamples.Free);
            Assert.NotEmpty(EmailSamples.Free);

            foreach (var freeEmail in EmailSamples.Free)
            {
                Assert.True(IsBizMail.IsFreeMailAddress(freeEmail), $"{freeEmail} is free");
            }
        }
コード例 #4
0
        public void AreExceptionsThrown()
        {
            Assert.NotNull(EmailSamples.Throws);
            Assert.NotEmpty(EmailSamples.Throws);

            foreach (var errorTrigger in EmailSamples.Throws.Select(t => t as string).Concat(EmailSamples.Incomplete))
            {
                Assert.Throws <ArgumentException>(() => {
                    IsBizMail.IsFreeMailAddress(errorTrigger);
                });
            }
        }