Пример #1
0
        public void DateOrderedMin()
        {
            //Create an instance of the class we want to create
            clsStock AStock = new clsStock();
            //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;
            //convert the date variable to a string variable
            string Dateordered = TestDate.ToString();

            //invoke the method
            Error = AStock.Valid(Stockdescription, Stockcolour, Stockamount, Stockprice, Dateordered);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #2
0
        public void DOBMax()
        {
            //create an instance of the class we want to create
            clscustomer Acustomer = 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;
            //convert the date variable to a string variable
            string DOB = TestDate.ToString();

            //invoke the method
            Error = Acustomer.Valid(Name, Email, DOB, Address);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #3
0
        public void ReleaseDateMax()
        {
            //create an instance of the class we want to create
            clsStock AnStock = new clsStock();
            //string variable to store any error message
            String Error = "";
            //creates test data
            DateTime TestDate;

            //sets to todays date
            TestDate = DateTime.Now.Date;//This should pass
            //convert the date variable to a string variable
            string ReleaseDate = TestDate.ToString();

            //invoke the method
            Error = AnStock.Valid(gameName, Price, AgeRating, ReleaseDate);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #4
0
        public void DatePurchasedMin()
        {
            //create an instance of the class we want to create
            clsOrder AnOrder = new clsOrder();
            //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;
            //convert the date variable to a string variable
            string DatePurchased = TestDate.ToString();

            //invoke the method
            Error = AnOrder.Valid(Address, DeliveryDate, DatePurchased);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #5
0
        public void AccountCreationDateMin()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = 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;
            //convert the date variable to a string variable
            string Account_Creation_Date = TestDate.ToString();

            //invoke the method
            Error = ACustomer.Valid(First_Name, Surname, AddressNo, Address, Postcode, Email, Account_Creation_Date);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #6
0
        public void DateAddedMin()
        {
            //create an instance of the class we want to create
            clsPhone APhone = new clsPhone();
            //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;
            //convert the date variable to a string variable
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = APhone.Valid(Capacity, Price, Colour, DateAdded, Description, Make, Model);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #7
0
        public void DateExtremeMax()
        {
            //create an instance of the class we want to create
            clsOrder Order = new clsOrder();
            //string variable to store any 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;
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            string Date = TestDate.ToString();

            //invoke the method
            Error = Order.Valid(ProductName, ProductNo, OrderNo, Date, Price);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #8
0
        public void DateExtremeMax()
        {
            //create an instance of the class we want to create
            clsCustomer Customer = 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 to todays date
            TestDate = DateTime.Now.Date;
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            string Date = TestDate.ToString();

            //invoke the method
            Error = Customer.Valid(FullName, Address, PostCode, Email, Date, PhoneNumber);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #9
0
        public void YearMadeMin()

        {
            //create an instance of the class we want to create
            clsManufacturer AnManufacturer = new clsManufacturer();
            //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;
            //convert the date variable to a string variable
            string YearMade = TestDate.ToString();

            //invoke the method
            Error = AnManufacturer.Valid(CarModel, ChairMan, Email, YearMade);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #10
0
        public void EquipmentDateAddedExtremeMin()
        {
            //create an instance of the class we want to create
            clsEquipment anEquipment = new clsEquipment();
            //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 less 100 years
            TestDate = TestDate.AddYears(-100);
            //convert the date variable to a string variable
            string EquipmentDateAdded = TestDate.ToString();

            //invoke the method
            Error = anEquipment.Valid(EquipmentDescription, EquipmentColour, EquipmentDateAdded, EquipmentPrice);
            Assert.AreNotEqual(Error, "");
        }
Пример #11
0
        public void DateAddedMin()
        {
            //create an instance of the class we want to create
            clsStock AnStock = new clsStock();
            //string variable to store any error message
            String Error = "";
            //create a variable to store the test date data
            DateTime TestDate;

            //set the test datetotodays date
            TestDate = DateTime.Now.Date;

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

            //invoke the method
            Error = AnStock.Valid(ClothesDescription, ClothesColour, DateAdded, Price);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #12
0
        public void DateAddedMin()
        {
            //create an instance of the class we want to create
            clsTutor aTutor = new clsTutor();
            //string variable to store any error messages
            String Error = "";
            //creating test variable to store test date
            DateTime TestDate;

            //set date to today
            TestDate = DateTime.Now.Date;// this should pass

            //have to convert date to string
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = aTutor.Valid(tutorFirstName, tutorLastName, tutorEmail, tutorSubject, tutorDateAdded, tutorPassword);
            //test to see that result is correct
            Assert.AreEqual(Error, "");
        }
Пример #13
0
        public void DateAddedExtremeMax()
        {
            clsHotel AHotel = new clsHotel(); //create an instance of the class we want to create
            Boolean  OK     = false;          //boolean variable to store the result of the validation
            //create some test data to pass the method
            string   Name         = "Premier Inn";
            string   Address      = "Test Street";
            string   PostCode     = "Le1 9BH";
            string   PhoneNo      = "07123456789";
            string   RoomCapacity = "300";
            DateTime TestDate;                 //create a variable to store the test data

            TestDate = DateTime.Now.Date;      //set the date to todaus date
            TestDate = TestDate.AddYears(100); //change current time to 100 years pluss
            string DateAdded = TestDate.ToString();

            //invoke the method
            OK = AHotel.Valid(Name, Address, PostCode, PhoneNo, RoomCapacity, DateAdded);
            Assert.IsFalse(OK); //test to see that the result is correct
        }
Пример #14
0
        public void DateAddedExtremeMin()
        {
            //create an instance of the class we want to create
            clsStock AStock = new clsStock();
            //string variablet store any error messafe
            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 less 100 years
            TestDate = TestDate.AddYears(-100);
            //convert the date variable to a string variable
            string DateAdded = TestDate.ToString();

            Error = AStock.Valid(CarModel, BHP, Price, DateAdded);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #15
0
        public void DateOrderedExtremeMax()
        {
            clsOrder AnOrder = new clsOrder();
            //string variable to store any error message
            String Error = "";
            //create a variable to store the test date data
            DateTime TestDate;

            //set the date to today's date
            TestDate = DateTime.Now.Date;
            //change the data to whatever the date is plus 100 years
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            string DateOrdered = TestDate.ToString();

            //invoke the method
            Error = AnOrder.Valid(DateOrdered, DeliveryAddress);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #16
0
        public void DateOfBirthExtremeMax()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = 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 to today's date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date + 200 years
            TestDate = TestDate.AddYears(200);
            //convert the date variable to a string variable
            string DateOfBirth = TestDate.ToString();

            //invoke the method
            Error = ACustomer.Valid(Email, Password, FirstName, SurName, DateOfBirth, PhoneNumber, Address, Gender);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #17
0
        public void DateOfBirthExtremeMax()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = 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 to todays date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date plus 100 years
            TestDate = TestDate.AddYears(100);
            //convert the data variable to a string variable
            string DateOfBirth = TestDate.ToString();

            //invoke the method
            Error = AnCustomer.Valid(Username, Password, Address, DateOfBirth);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #18
0
        public void DateExtrmeMax()
        {
            //create an instance of the class we want to create
            clsOrder AOrder = new clsOrder();
            //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 plus 100 years
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            string Date = TestDate.ToString();

            //invoke the method
            Error = AOrder.Valid(ItemName, Price, Quantity, Date);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #19
0
        public void DateOfBirthExtremeMax()
        {
            //create an instance of the class we want to create
            clsStaff AnStaff = new clsStaff();
            //string variable to store any 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 less 100 years
            TestDate = TestDate.AddYears(100);
            //comvert the date variable to a string variable
            string DateOfBirth = TestDate.ToString();

            //invoke the method
            Error = AnStaff.Valid(StaffPosition, StaffID, FirstName, StartDate, DateOfBirth);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #20
0
        public void CustomerDOBExtremeMax()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = 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 of the customer DOB
            TestDate = DateTime.Today.AddYears(150);
            //change the date to whatever the date is more 150 years
            TestDate = TestDate.AddYears(150);
            //convert the date variable to a string variable
            string CustomerDOB = TestDate.ToString();

            //invoke the method
            Error = ACustomer.Valid(CustomerName, CustomerDOB, CustomerEmailAddress, CustomerAddress);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #21
0
        public void DateOfJoiningExtremeMax()
        {
            //create an instance of the class we want to create
            clsStaff AStaff = new clsStaff();
            //string variable to store any 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 more than 100 years
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            string DateOfJoining = TestDate.ToString();

            //invoke the method
            Error = AStaff.Valid(FullName, Salary, DateOfJoining, Position);
            //test to see if the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #22
0
        public void DateAddedExtremeMax()
        {
            //Create an instance of the class we want to create
            clsOrder AnOrder = new clsOrder();
            //String variable to store any error message
            String Error = "";
            //Create a variable to store the test date data
            DateTime TestDate;

            //Set the date to today's 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 DateAdded = TestDate.ToString();

            //Invoke the method
            Error = AnOrder.Valid(DateAdded, Description, ShippingAddress, Quantity);
            //Test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #23
0
        public void OrderDateMinLessOne()
        {
            //create an instance of the class we want to create
            clsOrder AnOrder = new clsOrder();
            //string variable to store any error message
            String Error = "";
            //create a variable to store the test data
            DateTime TestDate;

            //set the date to today's date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date is less 1 day
            TestDate = TestDate.AddDays(-1);
            //convert the date variable to a string variable
            string OrderDate = TestDate.ToString();

            //invoke the method
            Error = AnOrder.Valid(OrderNumber, CustomerName, Email, Quantity, OrderDate, TrackingNumber);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #24
0
        public void DateJoinedExtremeMax()
        {
            //create an instance of the class we want to create
            clsStaff AStaff = new clsStaff();
            //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 1 day
            TestDate = TestDate.AddDays(100);
            //convert the date variable to a string variable
            string DateJoined = TestDate.ToString();

            //invoke the method
            Error = AStaff.Valid(StaffName, StaffAddress, StaffTelNumber, DateJoined, StaffID);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #25
0
        public void StartDateExtremeMax()
        {
            //create an instance of the class we want to create
            clsPolicy aPolicy = new clsPolicy();
            //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(10);
            //convert the date variable to a string variable
            string StartDate = TestDate.ToString();

            //invoke the method
            Error = aPolicy.Valid(StaffId, CustomerId, PolicyDetails, StartDate, Price);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #26
0
        public void DateaddedExtremeMax()
        {
            //create an instance of the class we want
            clsCustomer AnCustomer = new clsCustomer();
            //string variable to store any error message
            String Error = "";
            //create a variable to store the test data
            DateTime TestDate;

            //set the data to todays date
            TestDate = DateTime.Now.Date;
            //change the date to whatever the date is less 1 day
            TestDate = TestDate.AddYears(100);
            //convert the data variable to a string variable
            string Dateadded = TestDate.ToString();

            //invoke the method
            Error = AnCustomer.Valid(CustomerFirstName, CustomerLastName, CustomerUserName, Dateadded);
            //test to see that the results is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #27
0
        public void YearMadeExtrmeMax()
        {
            //create an instance of the class we want to create
            clsCar ACar = new clsCar();
            //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 1 day
            TestDate = TestDate.AddYears(100);
            //convert the date variable to a string variable
            string YearMade = TestDate.ToString();

            //invoke the method
            Error = ACar.Valid(CarName, Model, BodyType, YearMade);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #28
0
        public void OrderDateExtremeMax()
        {
            //create an instance of the class we want to create
            clsOrder AnOrder = new clsOrder();
            //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.AddDays(100);
            //convert the date variable to a string variable
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = AnOrder.Valid(OrderNumber, CustomerName, Email, Quantity, ShippingDate, TrackingNumber);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Пример #29
0
        public void PickupTimeExtremeMax()
        {
            //create an instance of the class we want to create
            clsDestination AnDestination = new clsDestination();
            //string variable to store any 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 less 1 day
            TestDate = TestDate.AddYears(100);
            //convert the data variable to a string variable
            string PickupTime = TestDate.ToString();

            //invoke the method
            Error = AnDestination.Valid(EndPointHouseNo, EndPointPostCode, EndPointStreet, EndPointTown, PickupTime);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Пример #30
0
        public void DateAddedMinPlusOne()
        {
            //create an instance of the class we want to create
            clsStock AStock = new clsStock();
            //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 1 day
            TestDate = TestDate.AddDays(1);
            //convert the date variable to a string variable
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = AStock.Valid(CarModel, BHP, Price, DateAdded);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }