Exemplo n.º 1
0
        public void InsertBySql()
        {
            // arrange
            string sql        = "Insert into aluno (nota,curso,data) values ('30','BBBB',getdate())";
            int    count      = 0;
            int    countAfter = 0;

            Parameters.SqlAndParameters sqlParameters = new Parameters.SqlAndParameters();


            sqlParameters.Sql = sql;

            count = (int)buildquery.ExecuteSqlGetSingle(new Parameters.SqlAndParameters()
            {
                Sql = "Select count(*) total from aluno"
            });


            // Insert query execution
            buildquery.ExecuteSql(sqlParameters);


            countAfter = (int)buildquery.ExecuteSqlGetSingle(new Parameters.SqlAndParameters()
            {
                Sql = "Select count(*) total from aluno"
            });

            // assert
            Assert.Greater(countAfter, count);
        }