public void InstanceOK() { //create instance of class that is to be created clsServiceOrder AnOrder = new clsServiceOrder(); //test to see that class exists Assert.IsNotNull(AnOrder); }
public void OrderNoOK() { //create instance of class clsServiceOrder AnOrder = new clsServiceOrder(); //create some test data to assign to property Int32 OrderNo = 120; //assign data to property AnOrder.OrderNo = OrderNo; //test to see if both values are the same Assert.AreEqual(AnOrder.OrderNo, OrderNo); }
public void ServicePropertyOK() { //creat instance of the class clsServiceOrder AnOrder = new clsServiceOrder(); //create test data to assign to the property string SomeService = "CPU Repair"; //assign the data to the property AnOrder.Service = SomeService; //test to see if both values are the same Assert.AreEqual(AnOrder.Service, SomeService); }
public void ServiceMinLessOne() { //create insatance of class clsServiceOrder AnOrder = new clsServiceOrder(); //boolean value to store result of validation., which is intitialised to false Boolean OK = false; //create some test data to assign to property string SomeService = ""; //invoke the methoid OK = AnOrder.Valid(SomeService); //test to see if result is ok Assert.IsFalse(OK); }
public void FindMethodOK() { //create instance of class we want to create clsServiceOrder AnOrder = new clsServiceOrder(); //boolean var to store result of validation Boolean Found = false; //create test data to use with the method Int32 OrderNo = 1; //invoke method Found = AnOrder.Find(OrderNo); //test to see that result is correcrt and proper Assert.IsTrue(Found); }
public void ValidNoOK() { //create insatance of class clsServiceOrder AnOrder = new clsServiceOrder(); //boolean value to store result of validation., which is intitialised to false Boolean OK = false; //create some test data to assign to property string SomeNumber = "123"; //invoke the methoid OK = AnOrder.ValidNo(SomeNumber); //test to see if result is ok Assert.IsTrue(OK); }
public void ServiceExtremeMax() { //create insatance of class clsServiceOrder AnOrder = new clsServiceOrder(); //boolean value to store result of validation., which is intitialised to false Boolean OK = false; //create some test data to assign to property string SomeService = ""; //pad the data with characters.PadRight is a built in method that allows us to pad out an existing string with a set number of a specific character. SomeService = SomeService.PadRight(129, 'a'); //invoke the methoid OK = AnOrder.Valid(SomeService); //test to see if result is ok Assert.IsFalse(OK); }
public void TestOrderDateFound() { //create insatnce of class we want to creaste clsServiceOrder AnOrder = new clsServiceOrder(); //boolean var to store search reuslt Boolean Found = false; //Boolean var to check if data is ok Boolean OK = true; //craete test data to use with method Int32 OrderNo = 21; //invoke method Found = AnOrder.Find(OrderNo); //check property if (AnOrder.OrderDate != Convert.ToDateTime("13/03/2016")) { OK = false; } //test to see that result is correct Assert.IsFalse(OK); }
public void TestOrderNoFound() { //create instance of class we want to create clsServiceOrder AnOrder = new clsServiceOrder(); //boolean variable to store result of search Boolean Found = false; //bolean var to record if data is ok (assume it is) Boolean OK = true; //create some test data to use with the method Int32 OrderNo = 21; //invoke the method Found = AnOrder.Find(OrderNo); //check the address no if (AnOrder.OrderNo != 21) { OK = false; } //test to see that result is correct Assert.IsTrue(OK); }
public void CountMatchesList() { //create instance of class we want to create clsServiceOrderCollection Orders = new clsServiceOrderCollection(); //create some test data to assign to the property //in this case the data needs to be list of objects List <clsServiceOrder> TestList = new List <clsServiceOrder>(); //add an item to the list //create the item of test data clsServiceOrder TestItem = new clsServiceOrder(); //set its properties TestItem.OrderNo = 1; TestItem.Service = "Antivirus"; //add item to test list TestList.Add(TestItem); //assign data to property Orders.AllOrders = TestList; //test to see that the 2 values are same Assert.AreEqual(Orders.Count, TestList.Count); }