public void UpdateMethodOK() { var AllClaims = new clsClaimCollection(); var TestItem = new clsClaim(); var PrimaryKey = 0; TestItem.ClaimStatus = true; TestItem.ClaimAmnt = 295255.18M; TestItem.ClaimDate = DateTime.Now.Date; TestItem.ClaimID = 1; TestItem.ClaimReason = "sem"; TestItem.CustomerID = 8194; TestItem.StaffID = 16; AllClaims.ThisClaim = TestItem; PrimaryKey = AllClaims.Add(); TestItem.ClaimID = PrimaryKey; TestItem.ClaimStatus = false; TestItem.ClaimAmnt = 125.12M; TestItem.ClaimDate = DateTime.Now.Date; TestItem.ClaimID = 95; TestItem.ClaimReason = "Lorem Ipsum"; TestItem.CustomerID = 34; TestItem.StaffID = 81; AllClaims.ThisClaim = TestItem; AllClaims.Update(); AllClaims.ThisClaim.Find(PrimaryKey); Assert.AreEqual(AllClaims.ThisClaim, TestItem); }
public void ReportByClaimReasonNoneFound() { var FilteredClaims = new clsClaimCollection(); FilteredClaims.ReportByClaimReason("xxxxxxxxx"); Assert.AreEqual(0, FilteredClaims.Count); }
public void ReportByClaimReasonMethodOK() { var AllClaims = new clsClaimCollection(); var FilteredClaims = new clsClaimCollection(); FilteredClaims.ReportByClaimReason(""); Assert.AreEqual(AllClaims.Count, FilteredClaims.Count); }
protected void btnYes_Click(object sender, EventArgs e) { var ClaimList = new clsClaimCollection(); ClaimList.ThisClaim.Find(ClaimID); ClaimList.Delete(); Response.Redirect("ClaimList.aspx"); }
private void DisplayClaims() { var Claims = new clsClaimCollection(); lstClaimList.DataSource = Claims.ClaimList; lstClaimList.DataValueField = "ClaimID"; lstClaimList.DataTextField = "ClaimReason"; lstClaimList.DataBind(); }
protected void btnApply_Click(object sender, EventArgs e) { var Claims = new clsClaimCollection(); Claims.ReportByClaimReason(txtClaimReason.Text); lstClaimList.DataSource = Claims.ClaimList; lstClaimList.DataValueField = "ClaimID"; lstClaimList.DataTextField = "ClaimReason"; lstClaimList.DataBind(); }
protected void DisplayClaim() { var ClaimList = new clsClaimCollection(); ClaimList.ThisClaim.Find(ClaimID); txtClaimID.Text = Convert.ToString(ClaimList.ThisClaim.ClaimID); txtCustomerID.Text = Convert.ToString(ClaimList.ThisClaim.CustomerID); txtStaffID.Text = Convert.ToString(ClaimList.ThisClaim.StaffID); txtClaimDate.Text = Convert.ToString(ClaimList.ThisClaim.ClaimDate); txtClaimAmnt.Text = Convert.ToString(ClaimList.ThisClaim.ClaimAmnt); txtClaimStatus.Text = Convert.ToString(ClaimList.ThisClaim.ClaimStatus); txtClaimReason.Text = Convert.ToString(ClaimList.ThisClaim.ClaimReason); }
public void ThisClaimPropertyOK() { var AllClaims = new clsClaimCollection(); var TestClaim = new clsClaim(); TestClaim.ClaimAmnt = 295255.18M; TestClaim.ClaimDate = DateTime.Now.Date; TestClaim.ClaimID = 1; TestClaim.ClaimReason = "sem"; TestClaim.CustomerID = 8194; TestClaim.StaffID = 32; AllClaims.ThisClaim = TestClaim; Assert.AreEqual(AllClaims.ThisClaim, TestClaim); }
public void ListAndCountOK() { var AllClaims = new clsClaimCollection(); var TestList = new List <clsClaim>(); var TestItem = new clsClaim(); TestItem.ClaimStatus = true; TestItem.ClaimAmnt = 295255.18M; TestItem.ClaimDate = DateTime.Now.Date; TestItem.ClaimID = 1; TestItem.ClaimReason = "sem"; TestItem.CustomerID = 8194; TestItem.StaffID = 16; TestList.Add(TestItem); AllClaims.ClaimList = TestList; Assert.AreEqual(AllClaims.Count, TestList.Count); }
protected void btnOk_Click(object sender, EventArgs e) { var AClaim = new clsClaim(); var ClaimReason = txtClaimReason.Text; var ClaimDate = txtClaimDate.Text; var ClaimAmnt = txtClaimAmnt.Text; var CustomerID = txtCustomerID.Text; var StaffID = txtStaffID.Text; var ClaimStatus = txtClaimStatus.Text; var error = ""; error = AClaim.Valid(StaffID, CustomerID, ClaimDate, ClaimAmnt, ClaimReason, ClaimStatus); if (error == "") { AClaim.ClaimID = ClaimID; AClaim.ClaimReason = ClaimReason; AClaim.ClaimDate = Convert.ToDateTime(ClaimDate); AClaim.CustomerID = Convert.ToInt32(CustomerID); AClaim.ClaimAmnt = Convert.ToDecimal(ClaimAmnt); AClaim.ClaimStatus = Convert.ToBoolean(ClaimStatus); AClaim.StaffID = Convert.ToInt32(StaffID); var ClaimList = new clsClaimCollection(); if (ClaimID == -1) { ClaimList.ThisClaim = AClaim; ClaimList.Add(); } else { ClaimList.ThisClaim.Find(ClaimID); ClaimList.ThisClaim = AClaim; ClaimList.Update(); } Response.Redirect("ClaimList.aspx"); } else { lblError.Text = error; } }
public void DeleteMethodOK() { var AllClaims = new clsClaimCollection(); var TestItem = new clsClaim(); var PrimaryKey = 0; TestItem.ClaimStatus = true; TestItem.ClaimAmnt = 295255.18M; TestItem.ClaimDate = DateTime.Now.Date; TestItem.ClaimID = 1; TestItem.ClaimReason = "sem"; TestItem.CustomerID = 8194; TestItem.StaffID = 16; AllClaims.ThisClaim = TestItem; PrimaryKey = AllClaims.Add(); TestItem.ClaimID = PrimaryKey; AllClaims.ThisClaim.Find(PrimaryKey); AllClaims.Delete(); var found = AllClaims.ThisClaim.Find(PrimaryKey); Assert.IsFalse(found); }
public void ReportByClaimReasonDataFound() { var FilteredClaims = new clsClaimCollection(); var OK = true; FilteredClaims.ReportByClaimReason("sem. Pellentesque ut ipsum"); if (FilteredClaims.Count == 2) { if (FilteredClaims.ClaimList[0].ClaimID != 2) { OK = false; } if (FilteredClaims.ClaimList[1].ClaimID != 11) { OK = false; } } else { OK = false; } Assert.IsTrue(OK); }
public void InstanceOK() { var AllClaims = new clsClaimCollection(); Assert.IsNotNull(AllClaims); }