????????????????????
???????????? ???????[ 2013/8/8 15:22:24 ] ????????
?????? Assert.AreSame
?????ж??????????????????????£?
?????? Assert.AreNotSame
?????????????????????????????£?
?????? Assert.IsNotNull??Assert.IsNull??Assert.IsTrue??Assert.IsFalse
????????Щ?????????????????
?????? Assert.IsInstanceOfType??Assert.IsNotInstanceOfType
?????ж????????????????????????
?????? Assert.Fail
???????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????
??????????????????DataSet????????????????ж?????“null” → ???ж?????“Empty”(????????????) →?? ?????????????????????????????DataSet??????????????????
/// <summary>
/// Modify.
/// </summary>
[TestMethod()]
[RollBack()]
public void UpdateBondAssessApplicationConfiguration_ModifyData_DataUpdated() //????????淶???????????????
{
AssessApplicationConfigurationDataSet assessConfigurationDataSet = target.GetBondAssessApplicationConfiguration();
assessConfigurationDataSet.CM_LookupConfiguration[0].Description = "This is my modify";
AssessApplicationConfigurationDataSet actual = target.UpdateBondAssessApplicationConfiguration(assessConfigurationDataSet);
AssessApplicationConfigurationDataSet newAssessAppDataSet = target.GetBondAssessApplicationConfiguration();
Assert.IsNotNull(actual); //????? ???????Null
Assert.IsTrue(actual.CM_LookupConfiguration.Rows.Count > 0); //????? ???????Empty
Assert.IsTrue(newAssessAppDataSet.CM_LookupConfiguration[0].Description == "This is my modify");//?????? ?????????????
Assert.IsTrue(CompareToTable(newAssessAppDataSet.CM_LookupConfiguration?? actual.CM_LookupConfiguration));
}
????4.?????? → ExpectedException(??????)
????????????????????????????????????????????????в????????????????????????????????????????б???????
??????VS???????????????????????????
??????????????????????????????
????????????????????г??????????? → [ExpectedException(typeof(NullReferenceException))]
???????????????????????????(Message) → [ExpectedException(typeof(NullReferenceException)??"Don't is null.")]
?????????????Щ????????????????????????????????????????????????ж??????????????????????????????????????б???????????????????д???
/// <summary>
/// Is null.
/// </summary>
[TestMethod()]
[RollBack()]
[ExpectedException(typeof(NullReferenceException))] //???????????????????
public void UpdateLookupChequeNumberRegion_UpdateChequeNumberRegionAndDataSetIsNull_ThrowException()
{
LookupChequeNumberRegionDataSet actual = target.UpdateLookupChequeNumberRegion(null);
}
/// <summary>
/// Add.
/// </summary>
[TestMethod()]
[RollBack()]????????????????????????//??????????????????????????????????
[ExpectedException(typeof(BusinessException)?? "The category and code combination you have entered already exist. Please enter a different category and code combination.")]
public void UpdatePolicyConsideration_AddPolicyTheCODEIsSame_ThrowException()
{
string newGUID = Guid.NewGuid().ToString();
CodeTableDataSet expectedDataSet = target.GetPolicyConsideration();
expectedDataSet.T_IC_CODE.AddT_IC_CODERow(GetNewRow(expectedDataSet?? null?? ref newGUID));
CodeTableDataSet actual = target.UpdatePolicyConsideration(expectedDataSet);
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11