Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void validationFailsIfNoStartEventFound()
        public virtual void validationFailsIfNoStartEventFound()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<org.camunda.bpm.model.xml.validation.ModelElementValidator<?>> validators = new java.util.ArrayList<org.camunda.bpm.model.xml.validation.ModelElementValidator<?>>();
            IList <ModelElementValidator <object> > validators = new List <ModelElementValidator <object> >();

            validators.Add(new ProcessStartEventValidator());

            BpmnModelInstance bpmnModelInstance = Bpmn.createProcess().done();

            ValidationResults validationResults = bpmnModelInstance.validate(validators);

            assertThat(validationResults.hasErrors()).True;

            IDictionary <ModelElementInstance, IList <ValidationResult> > results = validationResults.Results;

            assertThat(results.Count).isEqualTo(1);

            Process process = bpmnModelInstance.Definitions.getChildElementsByType(typeof(Process)).GetEnumerator().next();

            assertThat(results.ContainsKey(process)).True;

            IList <ValidationResult> resultsForProcess = results[process];

            assertThat(resultsForProcess.Count).isEqualTo(1);

            ValidationResult validationResult = resultsForProcess[0];

            assertThat(validationResult.Element).isEqualTo(process);
            assertThat(validationResult.Code).isEqualTo(10);
            assertThat(validationResult.Message).isEqualTo("Process does not have exactly one start event. Got 0.");
            assertThat(validationResult.Type).isEqualTo(ValidationResultType.ERROR);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldValidateWithEmptyList()
        public virtual void shouldValidateWithEmptyList()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<ModelElementValidator<?>> validators = new java.util.ArrayList<ModelElementValidator<?>>();
            IList <ModelElementValidator <object> > validators = new List <ModelElementValidator <object> >();

            ValidationResults results = modelInstance.validate(validators);

            assertThat(results).NotNull;
            assertThat(results.hasErrors()).False;
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCollectErrors()
        public virtual void shouldCollectErrors()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<ModelElementValidator<?>> validators = new java.util.ArrayList<ModelElementValidator<?>>();
            IList <ModelElementValidator <object> > validators = new List <ModelElementValidator <object> >();

            validators.Add(new IllegalBirdValidator("tweety"));

            ValidationResults results = modelInstance.validate(validators);

            assertThat(results).NotNull;
            assertThat(results.hasErrors()).True;
            assertThat(results.ErrorCount).isEqualTo(1);
            assertThat(results.WarinigCount).isEqualTo(0);
        }