Exemple #1
0
        public void RegistereDateMinPlusOne()

        {
            //create an instance of the class we want to create

            clsCustomer theCustomer = new clsCustomer();

            //string variable to store any error message

            String Error = "";

            //create a variable to store the test date data

            DateTime TestDate;

            TestDate = DateTime.Now.Date;

            //set the date totodays date

            TestDate = TestDate.AddMonths(-4);

            //change the date to whatever the date is plus 1 day

            //convert the date variable to a string variable

            string CustomerRegisteredDate = TestDate.ToString();

            //invoke the method

            Error = theCustomer.Valid(CustomerRegisteredDate, Name, Point, ProductId);

            //test to see that the result is correct

            Assert.AreEqual(Error, "");
        }
Exemple #2
0
        public void BackInStockDateMinPlusOneMonth()
        {
            clsStock AProduct = new clsStock();
            String   Error    = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddMonths(1);
            string BackInStockDate = TestDate.ToString();

            Error = AProduct.Valid(StyleName, BackInStockDate, Price, QuantityAvailable);
            Assert.AreEqual(Error, "");
        }
Exemple #3
0
        public void StartDateMaxPlusOne()
        {
            clsStaff staff = new clsStaff();
            String   Error = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddMonths(1).AddDays(1);
            string StartDate = TestDate.ToString();

            Error = staff.Valid(FirstName, LastName, EmailAddress, HomeAddress, StartDate);
            Assert.AreNotEqual(Error, "");
        }
        public void LastRestockDateMid()

        {
            clsStaff AStock = new clsStaff();
            string   Error  = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddMonths(-6);
            string LastRestockDate = TestDate.ToString();

            Error = AStock.Valid(ProductId, ProductDescription, InStock, LastRestockDate, Price, ProductName, StockVariants);
            Assert.AreEqual(Error, "");
        }