Пример #1
0
        public void BookingDateExtremeMax()
        {
            //create an instance of the class we want to create
            clsAppointments AnAppointment = new clsAppointments();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string AppointmentTitle = "Website";
            string ClientNo         = "1";
            string Location         = "Birmingham";
            string StaffNo          = "1";
            string Status           = "Pending";
            //crate a variable to srtore the test date data
            DateTime TestDate;

            //set the date to todays date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the day is plus 100 years
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            string BookingDate = TestDate.ToString();

            //invoke this method
            OK = AnAppointment.Valid(AppointmentTitle, BookingDate, ClientNo, Location, StaffNo, Status);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
Пример #2
0
        public void DateAddedTestExtremeMin()
        {
            //Create an instance of the class we want to create
            clsCustomer AnAddress = new clsCustomer();
            //Boolean variable to store the result of the vaidation
            Boolean OK = false;
            //Create some test data to pass to the method
            string Address  = "32a";
            string City     = "some city";
            string PostCode = "LE1 1AS";
            //Create a variable to store the date data
            DateTime TestDate;

            //set the date to todays date
            TestDate = DateTime.Now.Date;
            //Change the date 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
            OK = AnAddress.Valid(Address, City, PostCode, DateAdded);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
Пример #3
0
        public void DateOrderedExtremeMax()
        {
            //Create instance of the class we want to create
            clsOrder AnOrder = new clsOrder();
            //Boolean to store result of validation
            Boolean OK = false;
            //create test data to pass the method
            string ProductName = "Some Product";
            String QuantityNo  = "1";
            string OrderPrice  = "50";
            //create variable to store test date data
            DateTime TestDate;

            //set date to todays date
            TestDate = DateTime.Now.Date;
            //change date to plus than 100 years
            TestDate = TestDate.AddYears(100);
            //convert the date variable to string variable
            string DateOrdered = TestDate.ToString();

            //invoke method
            OK = AnOrder.Valid(DateOrdered, ProductName, QuantityNo, OrderPrice);
            //test to see result is correct
            Assert.IsFalse(OK);
        }
Пример #4
0
        public void OrderDateExtremeMax()
        {
            //create an instance of the class I want to create
            clsOrder AnOrder = new clsOrder();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //Create some test data to pass to the method
            String HouseNo  = "5";
            String Street   = "Test Street";
            String Town     = "Test Town";
            String Postcode = "xxx xxx";
            //create a variable to store the test data
            DateTime TestDate;

            //set the date to todays date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date is plus 100 years
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            String OrderDate = TestDate.ToString();

            //invoke the method
            OK = AnOrder.Valid(HouseNo, Street, Town, Postcode, OrderDate);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
        public void ScreeningDateExtremeMin()
        {
            //Create an instance of the class we want to create
            clsScreening AScreening = new clsScreening();
            //String variable to store an error message
            String Error = "";
            //Create some test data to pass to the method
            string FilmID        = "1";
            string ScreenID      = "2";
            string ScreeningCost = "12.50";
            //Create a variable to store test data
            DateTime TestDate;

            //Set the date
            TestDate = DateTime.Now;
            //Change to date to whatever the date is less than 100 years
            TestDate = TestDate.AddYears(-100);
            //Convert the date variable to a string variable
            string ScreeningDate = TestDate.ToString();

            //Invoke the method
            Error = AScreening.Valid(FilmID, ScreenID, ScreeningCost, ScreeningDate);
            //Test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #6
0
        public void ReleaseDateExtremeMin()
        {
            //create an instance of the class you want to create
            clsStock AStock = new clsStock();
            //string variable to store any error message
            string Error = "";
            //create some test data to pass to the method
            string Name           = "The Hunger Games";
            string Genre          = "Drama";
            string Classification = "12A";
            //crate  variable to store the test data
            DateTime TestDate;

            //set the date to todys date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date is is less than 30 years
            TestDate = TestDate.AddYears(-30);
            //convert the date vaiabe to a string variable
            string ReleaseDate = TestDate.ToString();

            //invoke the method
            Error = AStock.Valid(Name, Genre, Classification, ReleaseDate);
            //test ti see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #7
0
        public void DateAddedExtremeMax()
        {
            clsReports AReport = new clsReports();

            //string variable to store the error message
            String Error = "";

            //create a variable to store the test date data
            DateTime TestDate;

            //set the date to todays date
            TestDate = DateTime.Now.Date;

            //change the date to whatever the date is plus 100 years
            TestDate = TestDate.AddYears(100);

            //convert the date variable to string variable
            String DateAdded = TestDate.ToString();

            //Invoke the method
            Error = AReport.Valid(EmployeeName, Total, Expenses, DateAdded);

            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #8
0
        public void DOBExtremeMax()
        {
            //create an instance of the class we want to create
            clsStaff AStaff = new clsStaff();
            //string variable to store any error message
            string Error = "";
            //create some test data to pass to the method
            string Address      = "1 Dmu st ";
            string First_name   = "Mary";
            string Last_name    = "Zugs";
            string Next_of_Kin  = "Dave Zugs";
            string Phone_Number = "781234562";
            //create a variable to store the test date data
            DateTime TestDate;

            //set the date to todays date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date of birth is less 14 years
            TestDate = TestDate.AddYears(70);
            //convert the date variable to a string variable
            string DOB = TestDate.ToString();

            //invoke the method
            Error = AStaff.Valid(Address, DOB, First_name, Last_name, Next_of_Kin, Phone_Number);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #9
0
        public void ReleaseExtMaz()
        {
            try
            {
                ClsStock Stock = new ClsStock();

                String Error = "";

                DateTime TestDate;

                TestDate = DateTime.Now.Date;

                TestDate = TestDate.AddYears(100);

                string DateAdded = TestDate.ToString();

                Error = Stock.Valid(Name, Release, Quantity, Price, Size);

                Assert.AreEqual(Error, "");
            }

            catch (Exception)
            {
            }
        }
Пример #10
0
        public void RegisteredDateExtremeMax()

        {
            //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;

            //set the date totodays date

            TestDate = DateTime.Now.Date;

            //change the date to whatever the date is plus 100 years

            TestDate = TestDate.AddYears(100);

            //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.AreNotEqual(Error, "");
        }
        public void DateOfBirthExtremeMax()
        {
            //Create an instance of the class we want toc reate
            clsCustomer ACustomer = new clsCustomer();
            //String variable to store an error message
            String Error = "";
            //Create some test data to pass to the method
            string FirstName = "David";
            string LastName  = "Haddock";
            //Create a variable to store test data
            DateTime TestDate;

            //Set the date
            TestDate = DateTime.Now;
            //Change to date to be 100 years in the future
            TestDate = TestDate.AddYears(100);
            string DateOfBirth   = TestDate.ToString();
            string EmailAddress  = "*****@*****.**";
            string MobilePhoneNo = "07775828423";
            string Password      = "******";

            //Invoke the method
            Error = ACustomer.Valid(FirstName, LastName, DateOfBirth, EmailAddress, MobilePhoneNo, Password);
            //Test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #12
0
        public void Expected_Return_DateExtremeMax()
        {
            //create an instance of the class we want to create
            clsOrders AnOrder = new clsOrders();
            //string variable to store any error messages
            String Error = "";
            //create some test data to pass to the method
            string Stock_ID       = "5678";
            string Order_Date     = "12/01/2018";
            string Customer_ID    = "123456";
            string Payment_Method = "Card";
            //create a variable to store the test date data
            DateTime TestDate;

            //Set the date to todays date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date is plus 100 years
            TestDate = TestDate.AddYears(100);
            //convert the date variable to string variable
            string Expected_Return_Date = TestDate.ToString();

            //invoke the method
            Error = AnOrder.Valid(Stock_ID, Expected_Return_Date, Order_Date, Customer_ID, Payment_Method);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #13
0
        public void OrderPlacedExtremeMax()
        {
            clsOrder AOrder = new clsOrder();
            string Error = "";
            DateTime TestDate;
            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(1000);
            string OrderPlaced = TestDate.ToString();
            Error = AOrder.Valid(OrderNo, ItemDescription, StaffId, DeliveryAddress, ItemColour, OrderPlaced, ItemPrice);
            Assert.AreNotEqual(Error, "");

        }
Пример #14
0
        public void DOBEXMax()
        {
            clsStaff staff = new clsStaff();
            string   Error = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            DOB      = TestDate.ToString();
            Error    = staff.Valid(ID, Name, Address, DOB, Manager);
            Assert.AreNotEqual(Error, "");
        }
Пример #15
0
        public void DateAddedExtremeMax()
        {
            clsStock AStock = new clsStock();
            String   Error  = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            string DatePurchased = TestDate.ToString();

            Error = AStock.Valid(OrderNo, StockDescription, DatePurchased, Quantity); Assert.AreNotEqual(Error, "");
        }
Пример #16
0
        public void CostumerDOBEXMax()
        {
            clsCostumer aCostumer = new clsCostumer();
            string      Error     = "";
            DateTime    TestDate;

            TestDate    = DateTime.Now.Date;
            TestDate    = TestDate.AddYears(100);
            CostumerDOB = TestDate.ToString();
            Error       = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active);
            Assert.AreNotEqual(Error, "");
        }
Пример #17
0
        public void DOBExtremeMax()
        {
            clsMember AMember = new clsMember();
            String    Error   = "";
            DateTime  TestDate;

            TestDate = DateTime.Now.Date;
            string DOB = TestDate.AddYears(100).ToString();

            Error = AMember.Valid(FullName, Address, DOB, PhoneNumber);
            Assert.AreNotEqual(Error, "");
        }
Пример #18
0
        public void OrderDateExtremeMax()
        {
            clsOrders AnOrder = new clsOrders();
            String    Error   = "";
            DateTime  TestDate;

            TestDate  = DateTime.Now.Date;
            TestDate  = TestDate.AddYears(100);
            OrderDate = TestDate;
            Error     = AnOrder.Valid(OrderId, ItemId, OrderDate, DeliveryAddress, DispatchedStatus, UnitPrice, Quantity, ProductCode);
            Assert.AreNotEqual(Error, "");
        }
Пример #19
0
        public void DOBMaxMinusOne()
        {
            clsMember AMember = new clsMember();
            String    Error   = "";
            DateTime  TestDate;

            TestDate = DateTime.Now.Date;
            string DOB = TestDate.AddYears(-18).AddDays(-1).ToString();

            Error = AMember.Valid(FullName, Address, DOB, PhoneNumber);
            Assert.AreEqual(Error, "");
        }
Пример #20
0
        public void DateAddedExtremeMax()
        {
            clsStock ABook = new clsStock();
            String   Error = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            string DateAdded = TestDate.ToString();

            Error = ABook.Valid(BookDescription, Price, QuantityAvailable, DateAdded);
            Assert.AreNotEqual(Error, "");
        }
Пример #21
0
        public void ItemDateOfAvailabilityExtremeMax()
        {
            clsItems AnItem = new clsItems();
            String   Error  = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            string ItemDateOfAvailability = TestDate.ToString();

            Error = AnItem.Valid(ItemDescription, ItemQuantity, ItemPricePerUnit, ItemDateOfAvailability);
            Assert.AreNotEqual(Error, "");
        }
Пример #22
0
        public void DateReceivedExtremeMax()
        {
            clsOrder AnOrder = new clsOrder();
            String   Error   = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            string DateReceived = TestDate.ToString();

            Error = AnOrder.Valid(Description, DateReceived, CustomerId, OrderPrice, Quantity);
            Assert.AreNotEqual(Error, "");
        }
Пример #23
0
        public void InspectionDateExtremeMax()
        {
            OfficeClasses AnOffice = new OfficeClasses();
            String        Error    = "";
            DateTime      TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(99);
            string InspectionDate = TestDate.ToString();

            Error = AnOffice.Valid(AddressLine1, AddressLine2, City, PostCode, PhoneNumber, InspectionDate);
            Assert.AreNotEqual(Error, "");
        }
Пример #24
0
        public void OrderDateExtremeMin()
        {
            clsOrder AnOrder = new clsOrder();
            string   Error   = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(-100);
            string OrderDate = Convert.ToString(TestDate);

            Error = AnOrder.Valid(CustomerId, StaffId, OrderDate, OrderTotal, OrderProgress);
            Assert.AreNotEqual(Error, "");
        }
Пример #25
0
        public void LastRestockDateMinLessOne()
        {
            clsStaff AStock = new clsStaff();
            string   Error  = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(-1).AddDays(-1);
            string LastRestockDate = TestDate.ToString();

            Error = AStock.Valid(ProductId, ProductDescription, InStock, LastRestockDate, Price, ProductName, StockVariants);
            Assert.AreNotEqual(Error, "");
        }
Пример #26
0
        public void CustomerDOBExtremeMax()
        {
            clsCustomer ACustomer = new clsCustomer();
            string      Error     = "";
            DateTime    TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            String CustomerDOB = TestDate.ToString();

            Error = ACustomer.Valid(CustomerNumber, CustomerName, CustomerEmail, CustomerDOB, CustomerGender, CustomerPostcode);
            Assert.AreNotEqual(Error, "");
        }
Пример #27
0
        public void BackInStockDateExtremeMax()
        {
            clsStock AProduct = new clsStock();
            String   Error    = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            string BackInStockDate = TestDate.ToString();

            Error = AProduct.Valid(StyleName, BackInStockDate, Price, QuantityAvailable);
            Assert.AreNotEqual(Error, "");
        }
Пример #28
0
        public void DateOfBirthExtremeMax()
        {
            clsCustomer ACustomer = new clsCustomer();
            String      Error     = "";
            DateTime    TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(-1000);
            string DateOfBirth = TestDate.ToString();

            Error = ACustomer.Valid(Email, DateOfBirth, Address, Name, Password);
            Assert.AreNotEqual(Error, "");
        }
Пример #29
0
        public void DateOfBirthMaxLessOne()
        {
            clsCustomer ACustomer = new clsCustomer();
            String      Error     = "";
            DateTime    TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(-200).AddDays(1);
            string DateOfBirth = TestDate.ToString();

            Error = ACustomer.Valid(Email, DateOfBirth, Address, Name, Password);
            Assert.AreEqual(Error, "");
        }
Пример #30
0
        public void OrderDateExtremeMax()
        {
            clsOrder AOrder = new clsOrder();
            string   Error  = "";
            DateTime TestDate;

            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            string OrderDate = TestDate.ToString();

            Error = AOrder.Valid(OrderID, CustomerNo, CustomerAddress, OrderDate, ItemPrice, ItemColour, ProductDescription, StaffID);
            Assert.AreNotEqual(Error, "");
        }