예제 #1
0
        public void TestConstructor()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            Assert.IsFalse(collection.HasError);
            collection.Throw();
        }
예제 #2
0
        public void TestAddConstraint()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            collection.AddConstraintException(new ConstraintException("Erreur"));
            Assert.IsTrue(collection.HasError);
            collection.Throw();
        }
예제 #3
0
        public void TestAddErrorStack()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            collection.AddErrorStack("Prefix", new ErrorMessageCollection());
            Assert.IsFalse(collection.HasError);
            collection.Throw();
        }
예제 #4
0
        public void TestAddEntryWithRowNum()
        {
            ErrorMessageCollection collection = new ErrorMessageCollection();

            collection.AddEntry(0, "Field", "Erreur");
            Assert.IsTrue(collection.HasError);
            collection.Throw();
        }
예제 #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();
        }
예제 #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();
        }
예제 #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();
        }