コード例 #1
0
    //this function displays the data for a phone on the web form
    void DisplayBrand(Int32 PhoneNo)
    {
        //create an instance of the phone class
        clsPhone MyPhoneBook = new clsPhone();

        //find the record we want to display
        MyPhoneBook.Find(PhoneNo);
        //display the phone name
        txtPhoneName.Text = MyPhoneBook.PhoneName;
        //display the brand
        txtBrand.Text = MyPhoneBook.Brand;
        //display the screen size
        txtScreenSize.Text = MyPhoneBook.ScreenSize;
        //display the operating system
        txtOperatingSystem.Text = MyPhoneBook.OperatingSystem;
        //display the back camera
        txtBackCamera.Text = MyPhoneBook.BackCamera;
        //display the battery size
        txtBatterySize.Text = MyPhoneBook.BatterySize;
        //display the release data
        txtReleaseDate.Text = MyPhoneBook.ReleaseDate.ToString("dd/MM/yyyy");
        //set the drop down list to display the Company No
        ddlCompany.SelectedValue = Convert.ToString(MyPhoneBook.CompanyNo);
        //display the active state
        chkDiscontinued.Checked = MyPhoneBook.Discontinued;
    }
コード例 #2
0
ファイル: tstPhone.cs プロジェクト: shridharj25/A-Phone
        public void FindMethodOk()
        {
            //create an instance of the class we want to create
            clsPhone APhone = new clsPhone();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create the test data to use with the method
            Int32 PhoneId = 1;

            //invoke the method
            Found = APhone.Find(PhoneId);
            //Test to see that the result is correct
            Assert.IsTrue(Found);
        }
コード例 #3
0
ファイル: tstPhone.cs プロジェクト: meeravaria/PhoneSystem
        public void FindMethodOK()
        //Find Method
        {
            //create an instance of the filtered data
            clsPhone APhone = new clsPhone();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 PhoneID = 3;

            //invoke the method
            Found = APhone.Find(PhoneID);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
コード例 #4
0
ファイル: tstPhone.cs プロジェクト: shridharj25/A-Phone
        public void TestPhoneCameraQualityFound()
        {
            //create an instance of the class we want to create
            clsPhone APhone = new clsPhone();
            //boolean variable for storing the result of the search
            Boolean Found = false;
            //boolean varibale to record if data is ok (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 PhoneId = 2;

            //invoke the method
            Found = APhone.Find(PhoneId);
            //check the property
            if (APhone.CameraQuality != "HD")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
コード例 #5
0
ファイル: tstPhone.cs プロジェクト: meeravaria/PhoneSystem
        public void PhoneStockStatusFound()
        //Phone No Found Method
        {
            //create an instance of the filtered data
            clsPhone APhone = new clsPhone();
            //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 PhoneID = 3;

            //invoke the method
            Found = APhone.Find(PhoneID);
            //check the PhoneID
            if (APhone.StockStatus != true)
            {
                OK = false;
            }

            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
コード例 #6
0
ファイル: tstPhone.cs プロジェクト: meeravaria/PhoneSystem
        public void PhoneDateAddedFound()
        //Phone Active Method
        {
            //create an instance of the filtered data
            clsPhone APhone = new clsPhone();
            //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 PhoneID = 3;

            //invoke the method
            Found = APhone.Find(PhoneID);
            //check the PhoneID
            if (APhone.DateAdded != Convert.ToDateTime("13/02/2020"))
            {
                OK = false;
            }

            //test to see that the result is correct
            Assert.IsTrue(OK);
        }