public void InstanceOK() { //create instance of class we want to create clsServiceOrderCollection AllCounties = new clsServiceOrderCollection(); //test to see that it exists Assert.IsNotNull(AllCounties); }
public void CountPropertyOK() { //create instance of class we want to create clsServiceOrderCollection AllOrders = new clsServiceOrderCollection(); //create some test data to assign to the property Int32 SomeCount = 14; //assign data to the property AllOrders.Count = SomeCount; //test to see that the 2 values are same Assert.AreEqual(AllOrders.Count, SomeCount); }
//function for populating the service drop down list void DisplayServices() { //create instance of Service Order Collection MyClassLibrary.clsServiceOrderCollection Services = new MyClassLibrary.clsServiceOrderCollection(); //set data source to list of services in collection ddlService.DataSource = Services.AllOrders; //set name of primary key ddlService.DataValueField = "OrderNo"; //set data field to display ddlService.DataTextField = "Service"; //bind data to the list ddlService.DataBind(); }
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); }