Exemple #1
0
        public async Task EmailWithInvalidDomainReturnsInvalidMx()
        {
            var service = new PostCodeAnywhereEmailVerificationService("DA23-CE14-JH99-AW13");
            var result  = await service.VerifyEmailAddress("*****@*****.**");

            Assert.Equal(false, result.DomainHasMxRecord);
        }
Exemple #2
0
        public async Task ValidEmailReturnsDomainHasMxRecord()
        {
            var service = new PostCodeAnywhereEmailVerificationService("DA23-CE14-JH99-AW13");
            var result  = await service.VerifyEmailAddress("*****@*****.**");

            Assert.Equal(true, result.DomainHasMxRecord);
        }
Exemple #3
0
        public async Task EmailWithInvalidFormatReturnsInvalidFormat()
        {
            var service = new PostCodeAnywhereEmailVerificationService("DA23-CE14-JH99-AW13");
            var result  = await service.VerifyEmailAddress("michael.jameskslgarageservices.co.uk");

            Assert.Equal(false, result.IsFormatValid);
        }
Exemple #4
0
        public void InvalidApiKeyThrowsPostcodeAnywhereException()
        {
            var service   = new PostCodeAnywhereEmailVerificationService("234234234");
            var exception = AssertEx.TaskThrows <PostcodeAnywhereException>(async() => await service.VerifyEmailAddress("*****@*****.**"));

            Assert.Equal(2, exception.ErrorCode);
        }