Esempio n. 1
0
        public void InstanceOK()
        {
            // create an instance of the class
            clsCardDetails ACardDetail = new clsCardDetails();

            // test to see that it exists
            Assert.IsNotNull(ACardDetail);
        }
Esempio n. 2
0
        public void ValidMethodOK()
        {
            clsCardDetails ACardDetail = new clsCardDetails();
            String         Error       = "";

            Error = ACardDetail.Valid(CardNo1);
            Assert.AreEqual(Error, "");
        }
Esempio n. 3
0
        public void CardNoInvalidData() // invalid data
        {
            clsCardDetails ACardDetail = new clsCardDetails();
            String         Error       = "";
            string         CardNo1     = "this is not a card number";

            Error = ACardDetail.Valid(CardNo1);
            Assert.AreNotEqual(Error, "");
        }
Esempio n. 4
0
        public void CardNo1Mid() // 8 char
        {
            clsCardDetails ACardDetail = new clsCardDetails();
            String         Error       = "";
            string         CardNo1     = "12345678";

            Error = ACardDetail.Valid(CardNo1);
            Assert.AreEqual(Error, "");
        }
Esempio n. 5
0
        public void CardNo1MaxPlusOne() // 11 char
        {
            clsCardDetails ACardDetail = new clsCardDetails();
            String         Error       = "";
            string         CardNo1     = "12345678912";

            Error = ACardDetail.Valid(CardNo1);
            Assert.AreNotEqual(Error, "");
        }
Esempio n. 6
0
        public void CardNo1MaxBoundary() // 10 char
        {
            clsCardDetails ACardDetail = new clsCardDetails();
            String         Error       = "";
            string         CardNo1     = "12345";

            Error = ACardDetail.Valid(CardNo1);
            Assert.AreEqual(Error, "");
        }
Esempio n. 7
0
        public void CardNo1MinLessOne() // 4 char
        {
            clsCardDetails ACardDetail = new clsCardDetails();
            String         Error       = "";
            string         CardNo1     = "1234";

            Error = ACardDetail.Valid(CardNo1);
            Assert.AreNotEqual(Error, "");
        }
Esempio n. 8
0
        public void CardNo1ExtremeMax() // 8 char
        {
            clsCardDetails ACardDetail = new clsCardDetails();
            String         Error       = "";
            string         CardNo1     = "";

            CardNo1 = CardNo1.PadRight(100, 'a');
            Error   = ACardDetail.Valid(CardNo1);
            Assert.AreNotEqual(Error, "");
        }
Esempio n. 9
0
        public void CardNo1PropertyOK()
        {
            // create an instance of the class we want to create
            clsCardDetails ACardDetail = new clsCardDetails();
            // create some test data to assign to the property
            string TestData = "756483";

            // assign the data to the property
            ACardDetail.CardNo1 = TestData;
            // test to see that the two values are the same
            Assert.AreEqual(ACardDetail.CardNo1, TestData);
        }
Esempio n. 10
0
        public void FindMethodOK()
        {
            // create an instance of the class we want to create
            clsCardDetails ACardDetail = new clsCardDetails();
            // boolean variable to store the use with the method
            Boolean Found = false;
            // create some test data to use with the method
            Int32 CardNo = 1;

            // invoke the method
            Found = ACardDetail.Find(CardNo);
            // test to see that the result is correct
            Assert.IsTrue(Found);
        }
Esempio n. 11
0
        public void ThisCardDetailsPropertyOK()
        {
            // create an instance of the class
            clsCardDetailsCollection AllCardDetails = new clsCardDetailsCollection();
            // create the item of the test data
            clsCardDetails TestCardDetails = new clsCardDetails();

            // set its properties
            TestCardDetails.CardNo  = 1;
            TestCardDetails.CardNo1 = "123456";
            // assign the data to the property
            AllCardDetails.ThisCardDetails = TestCardDetails;
            // test to see that it exists
            Assert.AreEqual(AllCardDetails.ThisCardDetails, TestCardDetails);
        }
Esempio n. 12
0
        public void ListAndCountOK()
        {
            // create an instance of the class
            clsCardDetailsCollection AllCardDetails = new clsCardDetailsCollection();
            // create some test data to assign to the property
            // in this case the data to be a list of objects
            List <clsCardDetails> TestList = new List <clsCardDetails>();
            // create the item of the test data
            clsCardDetails TestItem = new clsCardDetails();

            // set its properties
            TestItem.CardNo  = 1;
            TestItem.CardNo1 = "123456";
            // assign the data to the property
            TestList.Add(TestItem);
            // assign the data to the property
            AllCardDetails.CardDetailsList = TestList;
            // test to see that it exists
            Assert.AreEqual(AllCardDetails.Count, TestList.Count);
        }
Esempio n. 13
0
        public void CardDetailsListOK()
        {
            // create an instance of the class
            clsCardDetailsCollection AllCardDetails = new clsCardDetailsCollection();

            List <clsCardDetails> TestList = new List <clsCardDetails>();

            // create the item of the test data
            clsCardDetails TestItem = new clsCardDetails();

            // set its properties
            TestItem.CardNo  = 1;
            TestItem.CardNo1 = "123456";
            // add item to the test list
            TestList.Add(TestItem);
            // assign the data to the property
            AllCardDetails.CardDetailsList = TestList;
            // test to see that it exists
            Assert.AreEqual(AllCardDetails.CardDetailsList, TestList);
        }
Esempio n. 14
0
        public void TestCardNo1Found()
        {
            // create an instance of the class we want to create
            clsCardDetails ACardDetail = new clsCardDetails();
            // create some test data to assign to the property
            Boolean Found = false;
            // boolean variable to record if the data is OK (assume it is)
            Boolean OK = true;
            // create some test data to use with the method
            Int32 CardNo = 1;

            // invoke the method
            Found = ACardDetail.Find(CardNo);
            // check the order no
            if (ACardDetail.CardNo1 != "123456")
            {
                OK = false;
            }
            // test to see that the result is correct
            Assert.IsTrue(OK);
        }