forked from FluentValidation/FluentValidation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e48695
commit 313c2f2
Showing
30 changed files
with
125 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
// The latest version of this file can be found at http://www.codeplex.com/FluentValidation | ||
#endregion | ||
|
||
using Xunit.Extensions; | ||
|
||
namespace FluentValidation.Tests { | ||
using System; | ||
using System.Globalization; | ||
|
@@ -29,8 +31,7 @@ public class EmailValidatorTests { | |
TestValidator validator; | ||
|
||
public EmailValidatorTests() { | ||
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); | ||
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); | ||
CultureScope.SetDefaultCulture(); | ||
|
||
validator = new TestValidator { | ||
v => v.RuleFor(x => x.Email).EmailAddress() | ||
|
@@ -72,20 +73,20 @@ public void double_period_with_uk_Domain() { | |
result.IsValid.ShouldBeFalse(); | ||
} | ||
|
||
[Xunit.Extensions.Theory] | ||
[Xunit.Extensions.InlineData((string)null)] | ||
[Xunit.Extensions.InlineData("[email protected]")] | ||
[Xunit.Extensions.InlineData("[email protected]")] | ||
[Xunit.Extensions.InlineData("[email protected]")] | ||
[Xunit.Extensions.InlineData("\"Abc\\@def\"@example.com")] | ||
[Xunit.Extensions.InlineData("\"Fred Bloggs\"@example.com")] | ||
[Xunit.Extensions.InlineData("\"Joe\\Blow\"@example.com")] | ||
[Xunit.Extensions.InlineData("\"Abc@def\"@example.com")] | ||
[Xunit.Extensions.InlineData("customer/[email protected]")] | ||
[Xunit.Extensions.InlineData("[email protected]")] | ||
[Xunit.Extensions.InlineData("!def!xyz%[email protected]")] | ||
[Xunit.Extensions.InlineData("[email protected]")] | ||
[Xunit.Extensions.InlineData("[email protected]")] | ||
[Theory] | ||
[InlineData((string)null)] | ||
[InlineData("[email protected]")] | ||
[InlineData("[email protected]")] | ||
[InlineData("[email protected]")] | ||
[InlineData("\"Abc\\@def\"@example.com")] | ||
[InlineData("\"Fred Bloggs\"@example.com")] | ||
[InlineData("\"Joe\\Blow\"@example.com")] | ||
[InlineData("\"Abc@def\"@example.com")] | ||
[InlineData("customer/[email protected]")] | ||
[InlineData("[email protected]")] | ||
[InlineData("!def!xyz%[email protected]")] | ||
[InlineData("[email protected]")] | ||
[InlineData("[email protected]")] | ||
public void Valid_email_addresses(string email) { | ||
var result = validator.Validate(new Person {Email = email}); | ||
result.IsValid.ShouldBeTrue(string.Format("The email address {0} should be valid", email)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.