?????? 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);
}