예제 #1
0
        public void FindMethod()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            Boolean     found      = false;
            Int32       CustomerNo = 1;

            Found = AnCustomer.Find(CustomerNo);
            Assert.IsTrue(Found);
        }
        public void FindMethodOK()
        {
            //Create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //Boolean variable to store the result of the validation
            Boolean Found = false;
            //Create some test data to use with the method
            Int32 CustomerID = 1;

            //Invoke the method
            Found = ACustomer.Find(CustomerID);
            //Test to see that the result is correct
            Assert.IsTrue(Found);
        }
예제 #3
0
        public void TestPhoneAddedFound()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            Boolean     found      = false;
            Boolean     OK         = true;
            Int32       CustomerNo = 21;

            Found = AnCustomer.Find(CustomerNo);
            if (AnCustomer.PhoneNumber != "07946274531")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #4
0
        public void TestDateAddedFound()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            Boolean     found      = false;
            Boolean     OK         = true;
            Int32       CustomerNo = 21;

            Found = AnCustomer.Find(CustomerNo);
            if (AnCustomer.DateAdded != Convert.ToDateTime("16/09/2015"))
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #5
0
        public void TestCustomerNoFound()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            Boolean     found      = false;
            Boolean     OK         = true;
            Int32       CustomerNo = 21;

            Found = AnCustomer.Find(CustomerNo);
            if (AnCustomer.CustomerNo != 21)
            {
                OK = false;
            }
            Assert.IsTrue(Found);
        }
예제 #6
0
        public void TestOwnServerFound()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 AddressNo = 21;

            //invoke the method
            Found = AnCustomer.Find(AddressNo);
            //check the property
            if (AnCustomer.Active != true)
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
예제 #7
0
        public void TestActiveFound()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //boolean variable to store theresult of the search
            Boolean Found = false;
            //boolean variable recod if data is ok
            Boolean OK = true;
            //create some test data o use with the method
            Int32 CustomerNo = 21;

            //invoke the method
            Found = ACustomer.Find(CustomerNo);
            //check the customer no
            if (ACustomer.Active != true)
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
        public void PasswordFound()
        {
            //Create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //Boolean variable to store the result of the search
            Boolean Found = false;
            //Boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //Create some test data to use with the method
            Int32 CustomerID = 1;

            //Invoke the method
            Found = ACustomer.Find(CustomerID);
            //Check the Password
            if (ACustomer.Password != "Swordfish")
            {
                OK = false;
            }
            //Test to see that the result is correct
            Assert.IsTrue(OK);
        }