Skip to content

Commit

Permalink
improved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeleusin committed Feb 19, 2015
1 parent 0081a2a commit eb68594
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Raven.Tests.Bundles/UniqueConstraints/Bugs/EmptyValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,25 @@ namespace Raven.Tests.Bundles.UniqueConstraints.Bugs
public class EmptyValues : UniqueConstraintsTest
{
[Fact]
public void When_Updating_Constraint_To_Empty_Value_Should_Delete_Constraint_Document()
public void When_Creating_User_With_Empty_Email_Value_Should_Not_Create_Constraint_Document()
{
var user = new User { Name = "Test", Email = "", TaskIds = null };

using (var session = DocumentStore.OpenSession())
{
session.Store(user);
session.SaveChanges();
}

using (var session = DocumentStore.OpenSession())
{
var constraints = session.Advanced.LoadStartingWith<object>("UniqueConstraints/");
Assert.Equal(0, constraints.Length);
}
}

[Fact]
public void When_Updating_User_With_Empty_Email_Value_Should_Not_Create_Constraint_Document()
{
var user = new User { Name = "Test", Email = "foo@bar.com", TaskIds = null };

Expand Down

0 comments on commit eb68594

Please sign in to comment.