public void Insert() { using (var ds = new SQLiteDatastore()) { ds.CreateDatastore(new TestDBBuilder()); var ent = POCOMultiTypeObject.CreateWithNullID(); ent.ID.Should().BeNull(); ds.Insert(ent); ent.ID.Should().NotBeNull(); var entAgain = ds.From <POCOMultiTypeObject>().Query().Single(); ent.Should().BeEquivalentTo(entAgain); } }
public void FluentInterfaceTest_Single_Record(bool nulls) { using (var ds = new SQLiteDatastore()) { ds.Execute(TestDBBuilder.CREATE_MULTIPROPTABLE); var poco = POCOMultiTypeObject.CreateWithNullID(); ds.Insert(poco); var result = ds.From <MultiPropTypeWithAliases>().Query() .SingleOrDefault(); result.Should().NotBeNull(); poco.Should().BeEquivalentTo(result, config => config.ExcludingMissingMembers()); result.AliasForStringField.Should().Be(result.StringField); } }