public void DeleteMethodOK() { clsCardsCollection AllCards = new clsCardsCollection(); clsCard TestItem = new clsCard(); double PrimaryKey = 0; TestItem.Active = true; TestItem.CardNr = 945345634563456; TestItem.CardHolder = "Cezary Szwalbe"; TestItem.CardSecurityNumber = 123; TestItem.ExpireDateYear = DateTime.Now.Year; TestItem.ExpireDateMonth = DateTime.Now.Month; AllCards.ThisCard = TestItem; PrimaryKey = AllCards.Add(); TestItem.CardNr = PrimaryKey; AllCards.ThisCard.Find(PrimaryKey); AllCards.Delete(); Boolean Found = AllCards.ThisCard.Find(PrimaryKey); Assert.IsFalse(Found); }
void DeleteCard() { clsCardsCollection CardBook = new clsCardsCollection(); CardBook.ThisCard.Find(CardNr); CardBook.Delete(); }
public void TwoRecordsPresent() { clsCardsCollection AllCards = new clsCardsCollection(); int pair = AllCards.Count; Assert.AreEqual(AllCards.Count, pair); }
public void CountCardsOK() { clsCardsCollection AllCards = new clsCardsCollection(); Int32 SomeCount = AllCards.Count; AllCards.Count = SomeCount; Assert.AreEqual(AllCards.Count, SomeCount); }
public void FindMethodOK() { clsCardsCollection AllCards = new clsCardsCollection(); Boolean Found = false; Int32 CardNr = 1; Found = AllCards.Find(CardNr); Assert.IsTrue(Found); }
public void CardsListOK() { clsCardsCollection AllCards = new clsCardsCollection(); List <clsCard> TestList = new List <clsCard>(); clsCard TestItem = new clsCard(); TestItem.Active = true; TestItem.CardNr = 945634563456345; TestItem.CardHolder = "Cezary Szwalbe"; TestItem.CardSecurityNumber = 123; TestItem.ExpireDateYear = DateTime.Now.Year; TestItem.ExpireDateMonth = DateTime.Now.Month; TestList.Add(TestItem); AllCards.CardsList = TestList; Assert.AreEqual(AllCards.CardsList, TestList); }
public void ThisCardPropertyOK() { clsCardsCollection AllCards = new clsCardsCollection(); clsCard TestItem = new clsCard(); TestItem.Active = true; TestItem.CardNr = 9456345634563456; TestItem.CardHolder = "Cezary Szwalbe"; TestItem.CardSecurityNumber = 123; TestItem.ExpireDateYear = DateTime.Now.Year; TestItem.ExpireDateMonth = DateTime.Now.Month; AllCards.ThisCard = TestCard; Assert.AreEqual(AllCards.ThisCard, TestCard); }
int Add() { clsCardsCollection CardBook = new clsCardsCollection(); String Error = CardBook.ThisCard.Valid(txtCardNumber.Text, txtCardHolder.Text, txtsecuritycode.Text, txtYear.Text, txtMonth.Text); if (Error == "") { CardBook.ThisCard.Active = true; CardBook.ThisCard.CardHolder = txtCardHolder.Text; CardBook.ThisCard.CardNr = Int64.Parse(txtCardNumber.Text); CardBook.ThisCard.ExpireDateMonth = Int32.Parse(txtMonth.Text); CardBook.ThisCard.ExpireDateYear = Int32.Parse(txtYear.Text); CardBook.ThisCard.CardSecurityNumber = Int32.Parse(txtsecuritycode.Text); CardBook.Add(); Response.Redirect("Payment_Details.aspx"); return(1); } else { lblError.Text = "There were problems with data entered" + Error; return(0); } }
public void InstanceOK() { clsCardsCollection acard = new clsCardsCollection(); Assert.IsNotNull(acard); }