public void SuccessfulBindingParameterTypes() { var pms = new { you = "test123", AGE = 11 }; MySQLParameterProcessor mProcessor = new MySQLParameterProcessor("@"); var results = mProcessor.GetParameters(pms); var dbCommand = new MySqlCommand(); mProcessor.BindParameters(dbCommand, results); Assert.IsTrue(dbCommand.Parameters != null && dbCommand.Parameters.Count == 2); Assert.IsTrue(dbCommand.Parameters["@you"].MySqlDbType == MySqlDbType.VarChar); Assert.IsTrue(dbCommand.Parameters["@AGE"].MySqlDbType == MySqlDbType.Int32); }
public void SuccessfulBindingParameter() { var pms = new { you = "test123", AGE = 11 }; MySQLParameterProcessor mProcessor = new MySQLParameterProcessor("@"); var results = mProcessor.GetParameters(pms); var dbCommand = new MySqlCommand(); mProcessor.BindParameters(dbCommand, results); Assert.IsTrue(dbCommand.Parameters != null && dbCommand.Parameters.Count == 2); Assert.IsTrue(dbCommand.Parameters["@you"]?.Value?.ToString() == "test123"); Assert.IsTrue(Convert.ToInt32(dbCommand.Parameters["@AGE"]?.Value?.ToString()) == 11); }