Esempio n. 1
0
        public async Task InsertCommand()
        {
            var random = new Random();
            var sproc = new dboSimulatedInsertStatement()
            {
                TestInt = random.Next(),
            };

            using (var con = new SqlConnection(connectionString))
            {
                var executor = new Executor(con);
                var results = await executor.NonQuery(sproc.Build(con));

                Assert.AreEqual(1, results);
            }
        }
Esempio n. 2
0
        public async Task IDbCommandLoadNothing()
        {
            var random = new Random();
            using (var con = new SqlConnection(connectionString))
            {
                var sproc = new dboSimulatedInsertStatement()
                {
                    TestInt = random.Next(),
                };

                var cmd = sproc.Build(con);

                var loader = new Loader<SelectData>();
                await con.OpenAsync();

                var obj = loader.Model(cmd);

                Assert.IsNull(obj);
            }
        }