コード例 #1
0
        public void ExecuteTest_NonQueryCallBack()
        {
            using (var adoTemplate = OracleFactory.CreateAdoTemplate(ConnectionString))
            {
                using (var opw = new OracleParametersWrapper <string>())
                {
                    opw.SetString("COL_ID", "ID");
                    opw.SetInt("COL_INT", 0);
                    opw.SetLong("COL_LONG", 0);
                    opw.SetDouble("COL_DOUBLE", 1);
                    opw.SetDecimal("COL_DECIMAL", 1);
                    opw.SetString("COL_STRING", "empty");
                    opw.SetDateTime("COL_DATE", DateTime.Now);
                    opw.SetClob("COL_CLOB", "BIG STRING");

                    NonQueryCallBack t = new NonQueryCallBack(CommandType.Text,
                                                              SQLBuilder.BuildInsert("DUMMY_TABLE", new[]
                    {
                        "COL_ID",
                        "COL_INT",
                        "COL_LONG",
                        "COL_DOUBLE",
                        "COL_DECIMAL",
                        "COL_STRING",
                        "COL_DATE",
                        "COL_CLOB",
                    }), opw);
                    int result = adoTemplate.Execute(t);
                    if (result != 1)
                    {
                        Assert.Fail("expected 1 insert.");
                    }
                }
            }
        }