Exemplo n.º 1
0
        public void DescriptionPlusOne()
        {
            //create an instance of the class we want to create
            clsMaintenance AMaitenance = new clsMaintenance();
            //boolean variable to store the results of the vaildation
            Boolean OK = false;
            string  TestDescription = "aa";
            string  TestCost        = "1.00";
            string  TestDate        = DateTime.Now.Date.ToString();

            //invoke the method
            OK = AMaitenance.Valid(TestDescription, TestCost, TestDate);
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Exemplo n.º 2
0
        public void CostLessOne()
        {
            //create an instance of the class we want to create
            clsMaintenance AMaitenance = new clsMaintenance();
            //boolean variable to store the results of the vaildation
            Boolean OK = false;
            //create some test data to assign to the property
            string TestDescription = "a";
            string TestCost        = "";
            string TestDate        = DateTime.Now.Date.ToString();

            //invoke the method
            OK = AMaitenance.Valid(TestDescription, TestCost, TestDate);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
Exemplo n.º 3
0
        public void DateInvalidDate()
        {
            //create an instance of the class we want to create
            clsMaintenance AMaitenance = new clsMaintenance();
            //boolean variable to store the results of the vaildation
            string Error           = "";
            string TestDescription = "a";
            string TestCost        = "";
            //create the variable
            string Date = "this is not date";

            //invoke the method
            Error = AMaitenance.Valid(TestDescription, TestCost, Date);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Exemplo n.º 4
0
        public void DescriptionMinBoundary()
        {
            //create an instance of the class we want to create
            clsMaintenance AMaitenance = new clsMaintenance();
            //boolean variable to store the results of the vaildation
            string Error           = "";
            string TestDescription = "";

            TestDescription = TestDescription.PadRight(1, 'a');
            string TestCost = "1.00";
            string TestDate = DateTime.Now.Date.ToString();

            //invoke the method
            Error = AMaitenance.Valid(TestDescription, TestCost, TestDate);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Exemplo n.º 5
0
        public void CostLessOne()
        {
            //create an instance of the class we want to create
            clsMaintenance AMaitenance = new clsMaintenance();
            //boolean variable to store the results of the vaildation
            string Error = "";
            //create some test data to assign to the property
            string TestDescription = "a";
            string TestCost        = "";

            TestCost = TestCost.PadRight('a');
            string TestDate = DateTime.Now.Date.ToString();

            //invoke the method
            Error = AMaitenance.Valid(TestDescription, TestCost, TestDate);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Exemplo n.º 6
0
        public void DateMin()
        {
            //create an instance of the class we want to create
            clsMaintenance AMaitenance = new clsMaintenance();
            //boolean variable to store the results of the vaildation
            string Error           = "";
            string TestDescription = "a";
            string TestCost        = "";
            //create the variable
            DateTime TestDate;

            //set the date today
            TestDate = DateTime.Now.Date;
            //convert the date varialbe to string varibale
            string Date = TestDate.ToString();

            //invoke the method
            Error = AMaitenance.Valid(TestDescription, TestCost, Date);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }