Ejemplo n.º 1
0
        public void ConstContradictTests_1a(Store store)
        {
            myTestServices.LogValidationErrors("ExclusionContradictsEqualityError exists");

            ORMModel            model      = store.ElementDirectory.FindElements <ORMModel>()[0];
            ExclusionConstraint constraint = (ExclusionConstraint)model.ConstraintsDictionary.GetElement("ExConstraint").FirstElement;

            myTestServices.LogValidationErrors("Removing Exclusion Constraint");

            using (Transaction t = store.TransactionManager.BeginTransaction("Remove Ex Constraint"))
            {
                constraint.Delete();
                t.Commit();
            }
            myTestServices.LogValidationErrors("Error Removed");
        }
Ejemplo n.º 2
0
        public void ExclusionMandatoryContra_1b(Store store)
        {
            myTestServices.LogValidationErrors("No Errors Found Initialliy");

            ORMModel            model      = store.ElementDirectory.FindElements <ORMModel>()[0];
            Role                role       = (Role)store.ElementDirectory.GetElement(new Guid("1C424E34-8369-41EC-850F-FD24E7B30C7A"));
            ExclusionConstraint constraint = (ExclusionConstraint)model.ConstraintsDictionary.GetElement("ExclusionConstraint1").SingleElement;

            using (Transaction t = store.TransactionManager.BeginTransaction("Add Mandatory Constraint"))
            {
                role.IsMandatory = true;
                t.Commit();
            }
            myTestServices.LogValidationErrors("Error is Introduced");

            using (Transaction t = store.TransactionManager.BeginTransaction("Add Mandatory Constraint"))
            {
                constraint.Delete();
                t.Commit();
            }
            myTestServices.LogValidationErrors("Error is removed upon Removal of Exclusion Constraint");
        }