public void BuildInsertTest()
        {
            var ed = new EntityDescription(typeof(POCOMultiTypeObject));
            var provider = new SQLite.SQLiteProviderFactory();

            var data = new POCOMultiTypeObject();

            var commandBuilder = ed.CommandBuilder;
            using (var command = commandBuilder.BuildInsertCommand(provider, data, null, Core.SQL.OnConflictOption.Default))
            {
                _output.WriteLine(command.CommandText);

                Assert.NotNull(command);
                AssertEx.NotNullOrWhitespace(command.CommandText);

                Assert.DoesNotContain("ID", command.CommandText);

                VerifyCommandSyntex(provider, command);
            }

            using (var command = commandBuilder.BuildInsertCommand(provider, data, 1, Core.SQL.OnConflictOption.Default))
            {
                _output.WriteLine(command.CommandText);

                Assert.NotNull(command);
                AssertEx.NotNullOrWhitespace(command.CommandText);

                Assert.Contains("ID", command.CommandText);

                VerifyCommandSyntex(provider, command);
            }
        }
        public static POCOMultiTypeObject CreateWithNullID(bool nullableSetNull = false)
        {
            var poco = new POCOMultiTypeObject()
            {
                BoolField      = _randomizer.Bool(),
                DateTimeField  = DateTime.Now,
                NDateTimeField = (nullableSetNull) ? (DateTime?)null : DateTime.Now,
                StrDateTime    = (nullableSetNull) ? (string)null : DateTime.Now.ToShortTimeString(),
                DoubleField    = _randomizer.Double(),
                FloatField     = _randomizer.Float(),
                GuidField      = _randomizer.Guid(),
                NGuidField     = (nullableSetNull) ? (Guid?)null : _randomizer.Guid(),
                IntField       = _randomizer.Int(),
                LongField      = _randomizer.Long(),
                NBoolField     = (nullableSetNull) ? (bool?)null : _randomizer.Bool(),
                NDoubleField   = (nullableSetNull) ? (double?)null : _randomizer.Double(),
                NFloatField    = (nullableSetNull) ? (float?)null : _randomizer.Float(),
                NIntField      = (nullableSetNull) ? (int?)null : _randomizer.Int(),
                NLongField     = (nullableSetNull) ? (long?)null : _randomizer.Long(),
                //RowID = randomizer.Int(),
                StringField = _randomizer.String2(16),
            };

            return(poco);
        }
        public void ReadPrimaryKeyTest()
        {
            var poco = new POCOMultiTypeObject()
            {
                ID = 1
            };

            var reader = new TestSupport.ObjectDataReader<POCOMultiTypeObject>(new POCOMultiTypeObject[] { poco });
            Assert.True(reader.Read());

            var ed = new EntityDescription(typeof(POCOMultiTypeObject));

            ed.Inflator.CheckOrdinals(reader);
            var id = ed.Inflator.ReadPrimaryKey(reader);

            Assert.Equal(id, 1);
        }
        public void BuildDeleteTest()
        {
            var ed = new EntityDescription(typeof(POCOMultiTypeObject));
            var provider = new SQLite.SQLiteProviderFactory();

            var data = new POCOMultiTypeObject();

            var commandBuilder = ed.CommandBuilder;
            using (var command = commandBuilder.BuildSQLDeleteCommand(provider, data))
            {
                _output.WriteLine(command.CommandText);

                Assert.NotNull(command);
                AssertEx.NotNullOrWhitespace(command.CommandText);

                VerifyCommandSyntex(provider, command);
            }
        }
        public void ReadDataTest()
        {
            var poco = new POCOMultiTypeObject()
            {
                ID = 1,
                StringField = "1",
                IntField = 1
            };

            var reader = new TestSupport.ObjectDataReader<POCOMultiTypeObject>(new POCOMultiTypeObject[] { poco });
            Assert.True(reader.Read());

            var ed = new EntityDescription(typeof(POCOMultiTypeObject));

            var data = new POCOMultiTypeObject();
            ed.Inflator.CheckOrdinals(reader);
            ed.Inflator.ReadData(reader, data);

            Assert.Equal(data.StringField, "1");
            Assert.Equal(data.ID, 1);
        }