public void IsSatisfiedBy_WithoutListValue_False() { var target = new MustNotHaveNullOrDefaultPropertySpecification<EntityStub>(t => t.Children); var entity = new EntityStub() { Children = new List<int>() }; Assert.IsFalse(target.IsSatisfiedBy(entity)); Assert.AreEqual("The 'Children' property of 'EntityStub' must not have null or default value.", target.NotSatisfiedReason); }
public void IsSatisfiedBy_WithListValueNotEmptyOrNull_True() { var entity = new EntityStub() { Children = new List<int>() { 1 }}; var target = new MustNotHaveNullOrDefaultPropertySpecification<EntityStub>(t => t.Children); Assert.IsTrue(target.IsSatisfiedBy(entity)); Assert.IsTrue(String.IsNullOrEmpty(target.NotSatisfiedReason)); }