public void TestConstructor() { ErrorMessageCollection collection = new ErrorMessageCollection(); Assert.IsFalse(collection.HasError); collection.Throw(); }
public void TestAddConstraint() { ErrorMessageCollection collection = new ErrorMessageCollection(); collection.AddConstraintException(new ConstraintException("Erreur")); Assert.IsTrue(collection.HasError); collection.Throw(); }
public void TestAddErrorStack() { ErrorMessageCollection collection = new ErrorMessageCollection(); collection.AddErrorStack("Prefix", new ErrorMessageCollection()); Assert.IsFalse(collection.HasError); collection.Throw(); }
public void TestAddEntryWithRowNum() { ErrorMessageCollection collection = new ErrorMessageCollection(); collection.AddEntry(0, "Field", "Erreur"); Assert.IsTrue(collection.HasError); collection.Throw(); }
public void TestAddConstraintWithField() { Bean b = new Bean(); ErrorMessageCollection collection = new ErrorMessageCollection(); collection.AddConstraintException(new ConstraintException(BeanDescriptor.GetDefinition(b).PrimaryKey, "Erreur")); Assert.IsTrue(collection.HasError); collection.Throw(); }
public void TestAddErrorStackWithError() { ErrorMessageCollection collection = new ErrorMessageCollection(); ErrorMessageCollection innerCollection = new ErrorMessageCollection(); innerCollection.AddEntry("Field", "Erreur"); collection.AddErrorStack("Prefix", innerCollection); Assert.IsTrue(collection.HasError); collection.Throw(); }
public void TestAddConstraintWithErrors() { ErrorMessageCollection innerCollection = new ErrorMessageCollection(); innerCollection.AddEntry("Field", "Erreur"); ErrorMessageCollection collection = new ErrorMessageCollection(); collection.AddConstraintException(new ConstraintException(innerCollection)); Assert.IsTrue(collection.HasError); collection.Throw(); }