Esempio n. 1
0
        public void FindByValues()
        {
            var t = new FakeDBTable();
            var data = new {PNImportId = 1, Filename = "foosums"};
            t.Add(data._AsDictionary());

            var key = new {PNImportId = 1};
            var res = t.FindByFieldValues(key._AsDictionary());
            Assert.AreEqual(1, res.Count());

            Assert.AreEqual(data._Inspect(), res.First().Print());
        }
Esempio n. 2
0
 public override FakeDBTable Apply(FakeDBTable table)
 {
     var victims = table.Where(r => Keys.IsSameAs(r)).ToList();
     var newVersions = victims.Select(r => r.Union(NewValues));
     return new FakeDBTable(table.Except(victims).And(newVersions), table.NextAutoKey);
 }
Esempio n. 3
0
 public abstract FakeDBTable Apply(FakeDBTable table);
Esempio n. 4
0
 public override FakeDBTable Apply(FakeDBTable table)
 {
     // We don't increment the NextAutoKey because that was assumed to have been done
     // already when we created the InsertOp in the first place
     return new FakeDBTable(table.And(Row), table.NextAutoKey);
 }
Esempio n. 5
0
 public override FakeDBTable Apply(FakeDBTable table)
 {
     var victims = table.Where(r => Keys.IsSameAs(r));
     return new FakeDBTable(table.Except(victims), table.NextAutoKey);
 }