@Test public void replaceMultipleBindsTest() { SqlCommand sqlCmd = new SqlCommand("UPDATE USERS SET USER = '******' WHERE USER = '******';"); sqlCmd.setBind(":1", "USER1"); sqlCmd.setBind(":2", "USER2"); assertEquals("UPDATE USERS SET USER = '******' WHERE USER = '******';", sqlCmd.generateSql()); }
@Test public void replaceSameBindMultipleTimesTest() { SqlCommand sqlCmd = new SqlCommand("SELECT * FROM USERS WHERE (USER = '******' OR MANAGER_USER = '******');"); sqlCmd.setBind(":1", "USER1"); assertEquals( "SELECT * FROM USERS WHERE (USER = '******' OR MANAGER_USER = '******');", sqlCmd.generateSql()); }
@Test public void replaceSingleBindTest() { SqlCommand sqlCmd = new SqlCommand("DELETE FROM USERS WHERE USER = '******';"); sqlCmd.setBind(":1", "BindOne"); assertEquals("DELETE FROM USERS WHERE USER = '******';", sqlCmd.generateSql()); }