Ejemplo n.º 1
0
        public void TestConstructor()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            Assert.IsFalse(collection.HasError);
            collection.Throw();
        }
Ejemplo n.º 2
0
        public void TestAddConstraint()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            collection.AddConstraintException(new ConstraintException("Erreur"));
            Assert.IsTrue(collection.HasError);
            collection.Throw();
        }
Ejemplo n.º 3
0
        public void TestAddErrorStack()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            collection.AddErrorStack("Prefix", new ErrorMessageCollection());
            Assert.IsFalse(collection.HasError);
            collection.Throw();
        }
Ejemplo n.º 4
0
        public void TestAddEntryWithRowNum()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            collection.AddEntry(0, "Field", "Erreur");
            Assert.IsTrue(collection.HasError);
            collection.Throw();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
        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();
        }