Exemplo n.º 1
0
        //[TestMethod]
        //public void StartDateOfContractMaxMinusOne()
        //{
        //    //create an instance of the class we want to create
        //    clsContract AContract = new clsContract();
        //    //string variable to store the results of the validation
        //    String OK = "";
        //    //set the date totaldays date
        //    DateTime SomeDate;
        //    SomeDate = DateTime.Now.Date;
        //    //change to date the whatever date is 100 years in the future
        //    SomeDate = SomeDate.AddDays(1);
        //    //Convert data  to a string variable
        //    string DateAdded = SomeDate.ToString();
        //    //invoke the method
        //    OK = AContract.Valid(ContractNo, CustomerNo, PhoneID, ContractType, StartDateOfContract, EndDateOfContract);
        //    //test to see that the result is correct
        //    Assert.AreNotEqual(OK, "");

        //}



        public void StartDateOfContractMax()
        {
            //create an instance of the class we want to create
            clsContract AContract = new clsContract();
            //string variable to store the results of the validation
            String OK = "";
            //set the date totaldays date
            DateTime SomeDate;

            //set test date as todays daye
            SomeDate = DateTime.Now.Date;
            //Convert data  to a string variable
            string DateAdded = SomeDate.ToString();

            //invoke the method
            OK = AContract.Valid(ContractNo, CustomerNo, PhoneID, ContractType, StartDateOfContract, EndDateOfContract);
            //test to see that the result is correct
            Assert.AreEqual(OK, "");
        }
        public void BookingsDateBookedInvalidData()
        {
            //create an instance of new class we want to create
            clsBookings ABookings = new clsBookings();
            //string variable to store the results of the validation
            string OK = "";
            //create some test data to assign to property
            string PaymentType = "12345";
            string Ammount     = "23.50";
            //vaiable to store test date data
            string SomeDate;

            //set test date as todays daye
            SomeDate = "ytytyrtyr";
            string DateBooked = SomeDate.ToString();

            //invoke the method
            OK = ABookings.Valid(Ammount, DateBooked, PaymentType);
            //test to see if result correct
            Assert.AreNotEqual(OK, "");
        }
Exemplo n.º 3
0
        public void StartDateOfContractMinLessOne()
        {
            //create an instance of the class we want to create
            clsContract AContract = new clsContract();
            //string variable to store the results of the validation
            String OK = "";
            //create a variable to store the test date data
            DateTime SomeDate;

            //set the date totaldays date
            SomeDate = DateTime.Now.Date;
            //change the date to whatever the date is less 1 today
            SomeDate = SomeDate.AddDays(-1);
            //convert the date variable to a string variable
            string StartDateOfContract = SomeDate.ToString();

            //invoke the method
            OK = AContract.Valid(ContractNo, CustomerNo, PhoneID, ContractType, StartDateOfContract, EndDateOfContract);
            //test to see that the result is correct
            Assert.AreNotEqual(OK, "");
        }
Exemplo n.º 4
0
        public void EndDateOfContractExtremeMin()
        {
            //create an instance of the class we want to create
            clsContract AContract = new clsContract();
            //string variable to store the results of the validation
            String OK = "";
            //set the date totaldays date
            DateTime SomeDate;

            //set test date as todays date
            SomeDate = DateTime.Now.Date;
            //change to date the whatever date is 100 years in the future
            SomeDate = SomeDate.AddDays(-100);
            //Convert data  to a string variable
            string EndDateOfContract = SomeDate.ToString();

            EndDateOfContract = Convert.ToString(SomeDate);
            //invoke the method
            OK = AContract.Valid(ContractNo, CustomerNo, PhoneID, ContractType, StartDateOfContract, EndDateOfContract);
            //test to see that the result is correct
            Assert.AreNotEqual(OK, "");
        }
        public void BookingsDateBookedExtremeMax()
        {
            //create an instance of new class we want to create
            clsBookings ABookings = new clsBookings();
            //string variable to store the results of the validation
            string OK = "";
            //create some test data to assign to property
            string PaymentType = "12345";
            string Ammount     = "23.50";
            //vaiable to store test date data
            DateTime SomeDate;

            //set test date as todays daye
            SomeDate = DateTime.Now.Date;
            //change to date the whatever date is 100 years in the future
            SomeDate = SomeDate.AddYears(+100);
            //Convert data  to a string variable
            string DateBooked = SomeDate.ToString();

            //invoke the method
            OK = ABookings.Valid(Ammount, DateBooked, PaymentType);
            //test to see if result correct
            Assert.AreNotEqual(OK, "");
        }