Exemple #1
0
        public void CheckDomain_BadDomainServiceNullEmpty()
        {
            var baddomain = new BadEmailDomainsProvider(_mockBadDomainRepository.Object);

            Assert.IsTrue(baddomain.IsBadDomain(null));
            Assert.IsTrue(baddomain.IsBadDomain(string.Empty));
            Assert.IsTrue(baddomain.IsBadDomain("    "));

            Assert.IsTrue(baddomain.IsBadDomain("test"));
            Assert.IsTrue(baddomain.IsBadDomain("test@"));
        }
Exemple #2
0
        public void CheckDomain_BadDomainService_BadDomain()
        {
            var baddomain = new BadEmailDomainsProvider(_mockBadDomainRepository.Object);
            var domains   = new List <BadEmailDomain>();

            domains.Add(new BadEmailDomain {
                Domain = "bar.com"
            });
            domains.Add(new BadEmailDomain {
                Domain = "bad.com"
            });
            _mockBadDomainRepository.Setup(m => m.All).Returns(domains.AsQueryable);
            string recipient = "*****@*****.**";

            Assert.IsTrue(baddomain.IsBadDomain(recipient));
        }