public async Task EmailWithInvalidDomainReturnsInvalidMx() { var service = new PostCodeAnywhereEmailVerificationService("DA23-CE14-JH99-AW13"); var result = await service.VerifyEmailAddress("*****@*****.**"); Assert.Equal(false, result.DomainHasMxRecord); }
public async Task ValidEmailReturnsDomainHasMxRecord() { var service = new PostCodeAnywhereEmailVerificationService("DA23-CE14-JH99-AW13"); var result = await service.VerifyEmailAddress("*****@*****.**"); Assert.Equal(true, result.DomainHasMxRecord); }
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); }
public void InvalidApiKeyThrowsPostcodeAnywhereException() { var service = new PostCodeAnywhereEmailVerificationService("234234234"); var exception = AssertEx.TaskThrows <PostcodeAnywhereException>(async() => await service.VerifyEmailAddress("*****@*****.**")); Assert.Equal(2, exception.ErrorCode); }