Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
    void DeleteCard()
    {
        clsCardsCollection CardBook = new clsCardsCollection();

        CardBook.ThisCard.Find(CardNr);
        CardBook.Delete();
    }
Ejemplo n.º 3
0
        public void TwoRecordsPresent()
        {
            clsCardsCollection AllCards = new clsCardsCollection();
            int pair = AllCards.Count;


            Assert.AreEqual(AllCards.Count, pair);
        }
Ejemplo n.º 4
0
        public void CountCardsOK()
        {
            clsCardsCollection AllCards = new clsCardsCollection();
            Int32 SomeCount             = AllCards.Count;

            AllCards.Count = SomeCount;
            Assert.AreEqual(AllCards.Count, SomeCount);
        }
Ejemplo n.º 5
0
        public void FindMethodOK()
        {
            clsCardsCollection AllCards = new clsCardsCollection();

            Boolean Found  = false;
            Int32   CardNr = 1;

            Found = AllCards.Find(CardNr);

            Assert.IsTrue(Found);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
    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);
        }
    }
Ejemplo n.º 9
0
        public void InstanceOK()
        {
            clsCardsCollection acard = new clsCardsCollection();

            Assert.IsNotNull(acard);
        }