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()); }
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); }
public abstract FakeDBTable Apply(FakeDBTable table);
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); }
public override FakeDBTable Apply(FakeDBTable table) { var victims = table.Where(r => Keys.IsSameAs(r)); return new FakeDBTable(table.Except(victims), table.NextAutoKey); }