public void ToRecordSaveTest() { bool OK = false; RPobject obj = new RPobject(); RPconnect con = new RPconnect(obj); int T = con.ToRecordSave(); if (T != 0) { OK = true; } Assert.AreEqual(OK, true); }
private void btPreserve_Click(object sender, EventArgs e) //所喜之语,应以录之 { I++; //id编号加一 Record.id = I.ToString(); Record.cn = this.rtxCollect.Text; RcConnect = new RPconnect(Record); int True_F = RcConnect.ToRecordSave(); if (True_F == 1) { MessageBox.Show("保存成功", "保存", MessageBoxButtons.OK, MessageBoxIcon.Information); DataToFill();//刷新记录显示 } else { MessageBox.Show("保存失败", "保存", MessageBoxButtons.OK, MessageBoxIcon.Information); } }