public void C_CorrectData_A() { BillTermSet expectData = new BillTermSet() { }, actualData = Repo.Create(new BillTermSet() { BillTerm = new BillTermModel() { CustomerCode = "992086", BillTermName = "測試用期別01", BillTermNo = "123", }, BillTermDetail = new List <BillTermDetailModel>() { new BillTermDetailModel() { CustomerCode = "992086", FeeName = "停車費", PayAmount = 3000, }, new BillTermDetailModel() { CustomerCode = "992086", FeeName = "管理費", PayAmount = 5000, }, } }); AssertCorrectData(expectData, actualData); }
/// <summary> /// 檢查欄位 /// </summary> /// <param name="set"></param> public static void CheckData(ApplicationDbContext dataAccess, SysMessageLog message, BillTermSet set) { CheckTermNo(message, set.BillTerm); CheckTermNoLen(message, set.BillTerm); CheckTermNoExist(message, dataAccess, set.BillTerm); }
/// <summary> /// /// </summary> /// <param name="expectData"></param> /// <param name="actualData"></param> private void AssertSet(BillTermSet expectData, BillTermSet actualData) { //Assert.AreEqual(testData.BillTerm.BillTermId, result.BillTerm.BillTermId, $"{ResxManage.GetDescription<BillTermSet>(p => p.BillTerm)} 結果不一致"); //Assert.AreEqual(expectData.BillTermDetail, actualData.BillTermDetail, $"{ResxManage.GetDescription<BillTermSet>(p => p.BillTermDetail)} 結果不一致"); }
/// <summary> /// /// </summary> /// <param name="expectData"></param> /// <param name="actualData"></param> /// <param name="messageLog"></param> private void AssertCorrectData(BillTermSet expectData, BillTermSet actualData) { AssertSet(expectData, actualData); AssertMessage(); }