Skip to content

Commit

Permalink
reformatting
Browse files Browse the repository at this point in the history
git-svn-id: https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk@1660 d7b3437e-3345-0410-94a8-cbd290e69f67
  • Loading branch information
darioquintana committed Mar 10, 2011
1 parent fbcdb40 commit 8ba715d
Showing 1 changed file with 16 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,40 @@
namespace NHibernate.Validator.Tests.CustomValidator
{
[TestFixture]
public class ValidatorClassFixture
public class ValidatorClassFixture
{
[Test]
public void IntegrationWithValidation()
{
var ve = new ValidatorEngine();
ve.AssertValid(new Foo(1));

Assert.IsFalse(ve.IsValid(new Foo(3)));
}

[Test]
public void OnlyAttributes()
{
ValidatorClassAttribute vc1 =
new ValidatorClassAttribute(
var vc1 = new ValidatorClassAttribute(
"NHibernate.Validator.Tests.CustomValidator.IsOneValidator, NHibernate.Validator.Tests");

Assert.IsNotNull(vc1.Value);

ValidatorClassAttribute vc2 =
new ValidatorClassAttribute(typeof(IsOneValidator));
var vc2 = new ValidatorClassAttribute(typeof(IsOneValidator));

Assert.IsNotNull(vc1.Value);

Assert.AreEqual(vc1.Value,vc2.Value);

Assert.AreEqual(vc1.Value, vc2.Value);
}

[Test]
public void IntegrationWithValidation()
{
ValidatorEngine ve = new ValidatorEngine();
ve.AssertValid(new Foo(1));

Assert.IsFalse(ve.IsValid(new Foo(3)));
}

public class Foo
{
[IsOne] public int Bar;

public Foo(int bar)
{
Bar = bar;
}

[IsOne]
public int Bar;
}

}
}
}

0 comments on commit 8ba715d

Please sign in to comment.