Exemplo n.º 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.");

        }
Exemplo n.º 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());

        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 4
0
 public EntityDeleteModule(Root root) : base(root) {
 }
Exemplo n.º 5
0
 public TemplateModule(Root root) {
     _root = root;
 }
Exemplo n.º 6
0
 public MapModule(Root root) {
     _root = root;
 }
Exemplo n.º 7
0
 public EntityPipelineModule(Root root) : base(root) { }
Exemplo n.º 8
0
 public ProcessControlModule(Root root) : base(root) { }
Exemplo n.º 9
0
 public EntityInputModule(Root root) : base(root) { }
Exemplo n.º 10
0
 protected ProcessModule(Root root) {
     _root = root;
 }
Exemplo n.º 11
0
 public ActionModule(Root root) {
     _root = root;
 }
Exemplo n.º 12
0
 public EntityMasterUpdateModule(Root root) : base(root) { }
Exemplo n.º 13
0
 protected EntityModule(Root root) {
     _root = root;
 }
Exemplo n.º 14
0
 public ProcessPipelineModule(Root root) : base(root) { }
Exemplo n.º 15
0
 public EntityControlModule(Root root) : base(root) { }