public void Email_is_obfuscated_if_user_is_authenticated(string input, string expectedLinkText) { var protector = new EmailProtector(); var result = protector.ProtectEmailAddresses(input, true); Assert.Equal(@$ "<p>Before <a href=" "{OBFUSCATED_MAILTO + OBFUSCATED_EMAIL_ADDRESS}" ">{expectedLinkText}</a> after</p>", result); }
public void Null_or_empty_is_returned_unaltered(string input) { var protector = new EmailProtector(); var result = protector.ProtectEmailAddresses(input, true); Assert.Equal(input, result); }
public void Email_is_protected_if_user_is_unauthenticated(string input) { var protector = new EmailProtector(); var result = protector.ProtectEmailAddresses(input, false); Assert.Equal(@"<p>Before (email address available – please <a href=""/account/sign-in"">sign in</a>) after</p>", result); }