コード例 #1
0
ファイル: tstPhone.cs プロジェクト: meeravaria/PhoneSystem
        public void ColourMaxLessOne()

        {
            //create an instance of the filtered data
            clsPhone APhone = new clsPhone();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to the method
            string Colour = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; //this should  be ok

            //invoke the method
            Error = APhone.Valid(Capacity, Price, Colour, DateAdded, Description, Make, Model);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
コード例 #2
0
ファイル: tstPhone.cs プロジェクト: meeravaria/PhoneSystem
        public void ModelExtremeMax()

        {
            //create an instance of the filtered data
            clsPhone APhone = new clsPhone();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to the method
            string Model = ""; //this should fail

            Model = Model.PadRight(50, 'a');
            //invoke the method
            Error = APhone.Valid(Capacity, Price, Colour, DateAdded, Description, Make, Model);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
コード例 #3
0
ファイル: tstPhone.cs プロジェクト: shridharj25/A-Phone
        public void PhoneCameraQualityMaxPlusOne()
        {
            //create an instance of the class we want to create
            clsPhone APhone = new clsPhone();
            //boolean variable to store the result of the validation
            //Boolean OK = false;
            string Error = "";
            //create some test data to pass to the method
            string CameraQuality = "aaaaaa"; //this should fail

            //invoke the method
            //OK = APhone.Valid(PhoneMake, PhoneModel, PhoneNo, Price, ScreenSize, CameraQuality);
            Error = APhone.Valid(PhoneMake, PhoneModel, PhoneNo, Price, ScreenSize, CameraQuality);
            //test to see that the result is correct
            //Assert.IsTrue(OK);
            Assert.AreNotEqual(Error, "");
        }
コード例 #4
0
ファイル: tstPhone.cs プロジェクト: meeravaria/PhoneSystem
        public void DateAddedMin()
        {
            //create an instance of the class we want to create
            clsPhone APhone = new clsPhone();
            //string variable to store any error message
            String Error = "";
            //create a variable to store the test date data
            DateTime TestDate;

            //set the date totodays date
            TestDate = DateTime.Now.Date;
            //convert the date variable to a string variable
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = APhone.Valid(Capacity, Price, Colour, DateAdded, Description, Make, Model);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
コード例 #5
0
ファイル: tstPhone.cs プロジェクト: meeravaria/PhoneSystem
        public void DateAddedExtremeMim()

        {
            //create an instance of the filtered data
            clsPhone APhone = new clsPhone();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to the method
            DateTime TestDate;

            //set the data to todays date
            TestDate = DateTime.Now.Date;
            //change the data to whatever the date is less 100 years
            TestDate = TestDate.AddYears(-100);
            //convert the date variable to a string variable
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = APhone.Valid(Capacity, Price, Colour, DateAdded, Description, Make, Model);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }