示例#1
0
        public void ExecuteNonQueryTest()
        {
            DAO_Access.AccessDBHelper target = new DAO_Access.AccessDBHelper(); // TODO: Initialize to an appropriate value
            string sql = "update users set lastloginip='127.0.0.1'";            // TODO: Initialize to an appropriate value

            System.Data.OleDb.OleDbParameter[] parameters = null;               // TODO: Initialize to an appropriate value
            int expected = 2;                                                   // TODO: Initialize to an appropriate value
            int actual;

            actual = target.ExecuteNonQuery(sql, parameters);
            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void ExecuteNonQueryTestWithParameters()
        {
            DAO_Access.AccessDBHelper target = new DAO_Access.AccessDBHelper();           // TODO: Initialize to an appropriate value
            string sql = "update users set lastloginip='127.0.0.1' where userid=@userid"; // TODO: Initialize to an appropriate value

            System.Data.OleDb.OleDbParameter[] parameters = new OleDbParameter[] {
                new OleDbParameter()
                {
                    ParameterName = "userid",
                    Value         = "Payne"
                }
            };

            int expected = 1; // TODO: Initialize to an appropriate value
            int actual;

            actual = target.ExecuteNonQuery(sql, parameters);
            Assert.AreEqual(expected, actual);
        }