Example #1
0
        public static object[] createModel()
        {
            TestModelParser modelParser   = new TestModelParser();
            ModelInstance   modelInstance = modelParser.EmptyModel;

            Animals animals = modelInstance.newInstance(typeof(Animals));

            modelInstance.DocumentElement = animals;

            // add a tns namespace prefix for QName testing
            animals.DomElement.registerNamespace("tns", MODEL_NAMESPACE);

            FlyingAnimal tweety = createBird(modelInstance, "tweety", Gender.Female);
            FlyingAnimal hedwig = createBird(modelInstance, "hedwig", Gender.Male);
            FlyingAnimal birdo  = createBird(modelInstance, "birdo", Gender.Female);
            FlyingAnimal plucky = createBird(modelInstance, "plucky", Gender.Unknown);
            FlyingAnimal fiffy  = createBird(modelInstance, "fiffy", Gender.Female);

            createBird(modelInstance, "timmy", Gender.Male);
            createBird(modelInstance, "daisy", Gender.Female);

            tweety.FlightInstructor = hedwig;

            tweety.FlightPartnerRefs.Add(hedwig);
            tweety.FlightPartnerRefs.Add(birdo);
            tweety.FlightPartnerRefs.Add(plucky);
            tweety.FlightPartnerRefs.Add(fiffy);


            return(new object[] { "created", modelInstance, modelParser });
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void copyModelInstance()
        public virtual void copyModelInstance()
        {
            modelInstance = cloneModelInstance();
            tweety        = modelInstance.getModelElementById("tweety");
            hedwig        = modelInstance.getModelElementById("hedwig");
            birdo         = modelInstance.getModelElementById("birdo");
            plucky        = modelInstance.getModelElementById("plucky");
            fiffy         = modelInstance.getModelElementById("fiffy");
            timmy         = modelInstance.getModelElementById("timmy");
            daisy         = modelInstance.getModelElementById("daisy");
        }