コード例 #1
0
        public void AddressMinLessOne()
        {
            //create an instance of the class we want to create
            clsInvoice AInvoice = new clsInvoice();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to assign to the property
            string SomeAddress = "";

            //invoke the method
            OK = AInvoice.Valid(SomeAddress);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
コード例 #2
0
        public void AddressExtremeMax()
        {
            //create an instance of the class we want to create
            clsInvoice AInvoice = new clsInvoice();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to assign to the property
            string SomeAddress = "";

            //pad the string with a character
            SomeAddress = SomeAddress.PadRight(500, 'a');
            //invoke the method
            OK = AInvoice.Valid(SomeAddress);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
コード例 #3
0
        public void DateCreatedInvalidData()
        {
            //create an instance of the class we want to create
            clsInvoice AInvoice = new clsInvoice();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to method
            Int32  SomeInvoiceNo   = 1;
            string SomeDateCreated = "This is not a date";
            double SomePrice       = 1.1;
            string SomePostcode    = "LE2 7FZ";
            Int32  SomeOrderNo     = 1;

            //invoke the method
            Error = AInvoice.Valid(SomeInvoiceNo, SomeDateCreated, SomePrice, SomePostcode, SomeOrderNo);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
コード例 #4
0
        public void OrderNoMid()
        {
            //create an instance of the class we want to create
            clsInvoice AInvoice = new clsInvoice();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to method
            Int32    SomeInvoiceNo   = 1;
            DateTime TestDateCreated = DateTime.Now.Date;
            string   SomeDateCreated = TestDateCreated.ToString();
            double   SomePrice       = 1.1;
            string   SomePostcode    = "LE2 7FZ";
            Int32    SomeOrderNo     = 1073741824;

            //invoke the method
            Error = AInvoice.Valid(SomeInvoiceNo, SomeDateCreated, SomePrice, SomePostcode, SomeOrderNo);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }