Skip to content

Commit

Permalink
better reset
Browse files Browse the repository at this point in the history
  • Loading branch information
bchavez committed Mar 21, 2016
1 parent 135839f commit 92d7b2d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Source/Bogus.Tests/UniquenessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ public class User
public string Username { get; set; }
}

[SetUp]
public void BeforeEachTest()
{
Faker.GlobalUniqueIndex = 0;
}

[Test]
public void every_new_generation_should_have_a_new_unqiue_index()
{
Faker.GlobalUniqueIndex = 0;
var faker = new Faker<User>()
.RuleFor(u => u.FirstName, f => f.Person.FirstName)
.RuleFor(u => u.LastName, f => f.Person.LastName)
Expand Down Expand Up @@ -53,7 +58,7 @@ public class Video

[Test]
public void should_be_able_to_create_some_hash_ids()
{
{
var faker = new Faker<Video>()
.RuleFor(v => v.VideoId, f => f.Hashids.EncodeLong(f.UniqueIndex))
.RuleFor(v => v.Summary, f => f.Lorem.Sentence());
Expand Down

0 comments on commit 92d7b2d

Please sign in to comment.