Beispiel #1
0
        public void KeysTypesSet() {

            var cfg = File.ReadAllText(@"Files\PersonAndPet.xml");
            var shorthand = File.ReadAllText(@"Files\Shorthand.xml");

            var root = new Root(cfg, shorthand, new Cfg.Net.Validators("js", new JintParser()));

            foreach (var error in root.Errors()) {
                Console.WriteLine(error);
            }

            foreach (var warning in root.Warnings()) {
                Console.WriteLine(warning);
            }

            var pet = root.Processes.First().Entities.First();
            Assert.AreEqual(KeyType.Primary, pet.Fields[0].KeyType);
            Assert.AreEqual(KeyType.None, pet.Fields[1].KeyType);
            Assert.IsTrue(pet.Fields[4].KeyType.HasFlag(KeyType.Foreign));

            var person = root.Processes.First().Entities.Last();
            Assert.IsTrue(person.Fields[0].KeyType == KeyType.Primary, "Person Id is a primary key on Person table.");
            Assert.IsTrue(person.Fields.Skip(1).All(f => f.KeyType == KeyType.None), "All other Person fields are KeyType.None.");

        }
Beispiel #2
0
        public void TestRelationshipToMaster() {
            var cfg = File.ReadAllText(@"Files\PersonAndPet.xml");
            var shorthand = File.ReadAllText(@"Files\Shorthand.xml");
            var root = new Root(cfg, shorthand, new Cfg.Net.Validators("js", new JintParser()));
            var rtm = root.Processes[0].Entities[1].RelationshipToMaster;

            Assert.AreEqual(1, rtm.Count());

        }
Beispiel #3
0
        public void GetTypedDataSet() {

            var cfg = File.ReadAllText(@"Files\PersonAndPet.xml");
            var shorthand = File.ReadAllText(@"Files\Shorthand.xml");
            var process = new Root(cfg, shorthand, new Cfg.Net.Validators("js", new JintParser())).Processes.First();
            var personContext = new PipelineContext(new DebugLogger(), process, process.Entities.Last());
            var entityInput = new InputContext(personContext, new Incrementer(personContext));
            var rows = new DataSetEntityReader(entityInput).Read().ToArray();

            Assert.IsInstanceOf<IEnumerable<Row>>(rows);
            Assert.AreEqual(3, rows.Length);

            var dale = rows[0];
            var micheal = rows[1];
            Assert.IsInstanceOf<int>(dale[FieldAt(0)]);
            Assert.AreEqual(1, dale[FieldAt(0)]);
            Assert.AreEqual("Dale", dale[FieldAt(1)]);
            Assert.AreEqual("Michael", micheal[FieldAt(1)]);

            foreach (var row in rows) {
                Console.WriteLine(row);
            }
        }
 public EntityDeleteModule(Root root) : base(root) {
 }
Beispiel #5
0
 public TemplateModule(Root root) {
     _root = root;
 }
Beispiel #6
0
 public MapModule(Root root) {
     _root = root;
 }
 public EntityPipelineModule(Root root) : base(root) { }
 public ProcessControlModule(Root root) : base(root) { }
 public EntityInputModule(Root root) : base(root) { }
Beispiel #10
0
 protected ProcessModule(Root root) {
     _root = root;
 }
Beispiel #11
0
 public ActionModule(Root root) {
     _root = root;
 }
 public EntityMasterUpdateModule(Root root) : base(root) { }
Beispiel #13
0
 protected EntityModule(Root root) {
     _root = root;
 }
 public ProcessPipelineModule(Root root) : base(root) { }
 public EntityControlModule(Root root) : base(root) { }