Пример #1
0
        public void FindMethod3Ok()
        {
            // Create instance of the class
            clsManufacturer AnManufacturer = new clsManufacturer();
            //Boolean variable to store the result of the validation
            Boolean Found = false;
            //Create some test data to use with the method
            Int32 ManufacturerNo = 1;

            //Invoke the method
            Found = AnManufacturer.Find(ManufacturerNo);
            //Test to see that the result is correct
            Assert.IsTrue(Found);
        }
Пример #2
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsManufacturer AnManufacturer = new clsManufacturer();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            // create some test data to use with the method
            Int32 ManufacturerID = 123;

            // invoke the method
            Found = AnManufacturer.Find(ManufacturerID);
            // test to see that the result is correct
            Assert.IsTrue(Found);
        }
Пример #3
0
        //this function displays the data for a staff member on the web form
        void DisplayManufacturer(Int32 ManufacturerNo)
        {
            //create an instance of the laptops class
            clsManufacturer Manufacturer = new clsManufacturer();

            //find the record we want to display
            Manufacturer.Find(ManufacturerNo);
            //display title
            txtManufacturerName.Text = Manufacturer.ManufacturerName;
            //display fname
            txtManufacturerTelephone.Text = Manufacturer.ManufacturerTelephone;
            //display lname
            txtManufacturerEmail.Text = Manufacturer.ManufacturerEmail;
        }
Пример #4
0
        public void TestCheckFound()
        {
            // Create instance of the class
            clsManufacturer AnManufacturer = new clsManufacturer();
            //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 ManufacturerNo = 1;

            //Invoke the method
            Found = AnManufacturer.Find(ManufacturerNo);
            //Check the property
            if (AnManufacturer.Check != true)
            {
                OK = false;
            }
            //Test to see that the result is correct
            Assert.IsTrue(OK);
        }
Пример #5
0
        public void TestDateAddedFound()
        {
            // Create instance of the class
            clsManufacturer AnManufacturer = new clsManufacturer();
            //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 ManufacturerNo = 1;

            //Invoke the method
            Found = AnManufacturer.Find(ManufacturerNo);
            //Check the ManufacturerNo
            if (AnManufacturer.DateAdded != Convert.ToDateTime("14/03/2019 00:00:00"))
            {
                OK = false;
            }
            //Test to see that the result is correct
            Assert.IsTrue(OK);
        }
Пример #6
0
        public void TestEmailFound()
        {
            //create an instance of the class we want to create
            clsManufacturer AnManufacturer = new clsManufacturer();
            //boolean variable to store the result of the validation
            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 ManufacturerID = 123;

            // invoke the method
            Found = AnManufacturer.Find(ManufacturerID);
            // check the property
            if (AnManufacturer.Email != "*****@*****.**")
            {
                OK = false;
            }
            // test to see that the result is correct
            Assert.IsTrue(OK);
        }