public void NotNull_Update() { TValidateData d = new TValidateData(); d.Body = "body"; Result result = db.insert( d ); Assert.IsTrue( result.IsValid ); d.Body = ""; Result updateResult = db.update( d ); Assert.IsFalse( updateResult.IsValid ); Console.WriteLine( updateResult.ErrorsText ); //自定义错误信息 TValidateData2 d2 = new TValidateData2(); d2.Body = "body"; Result result2 = db.insert( d2 ); Assert.IsTrue( result2.IsValid ); d2.Body = ""; Result updateResult2 = db.update( d2 ); Assert.IsFalse( updateResult2.IsValid ); Assert.AreEqual( "请填写内容", updateResult2.ErrorsText.Trim() ); Console.WriteLine( updateResult2.ErrorsText ); }
public void NotNull_Update() { TValidateData d = new TValidateData(); d.Body = "body"; Result result = db.insert(d); Assert.IsTrue(result.IsValid); d.Body = ""; Result updateResult = db.update(d); Assert.IsFalse(updateResult.IsValid); Console.WriteLine(updateResult.ErrorsText); //自定义错误信息 TValidateData2 d2 = new TValidateData2(); d2.Body = "body"; Result result2 = db.insert(d2); Assert.IsTrue(result2.IsValid); d2.Body = ""; Result updateResult2 = db.update(d2); Assert.IsFalse(updateResult2.IsValid); Assert.AreEqual("请填写内容", updateResult2.ErrorsText.Trim()); Console.WriteLine(updateResult2.ErrorsText); }
public void NotNull_Insert() { TValidateData d = new TValidateData(); Result result = db.insert( d ); Assert.IsFalse( result.IsValid ); Console.WriteLine( result.ErrorsText ); //自定义错误信息 TValidateData2 d2 = new TValidateData2(); Result result2 = db.insert( d2 ); Assert.IsFalse( result2.IsValid ); Assert.AreEqual( "请填写内容", result2.ErrorsText.Trim() ); Console.WriteLine( result2.ErrorsText ); }
public void NotNull_Insert() { TValidateData d = new TValidateData(); Result result = db.insert(d); Assert.IsFalse(result.IsValid); Console.WriteLine(result.ErrorsText); //自定义错误信息 TValidateData2 d2 = new TValidateData2(); Result result2 = db.insert(d2); Assert.IsFalse(result2.IsValid); Assert.AreEqual("请填写内容", result2.ErrorsText.Trim()); Console.WriteLine(result2.ErrorsText); }