public void FilterByOrderIDTestDataFound() { //create an instance of the filtered data clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection(); //var to store outcome Boolean OK = true; //apply a OrderID that doesn't exist FilteredOrderLines.FilterByOrderID("1"); //checked that the correct number of records ar found if (FilteredOrderLines.OrderLineList.Count == 2) { //check that the first record is ID 1 if (FilteredOrderLines.OrderLineList[0].OrderLineID != 1) { OK = false; } //check that the first record is ID 2 if (FilteredOrderLines.OrderLineList[1].OrderLineID != 2) { OK = false; } } else { OK = false; } //test to see that there are no records Assert.IsTrue(OK); }
public void FilterByOrderIDNoneFound() { //create an instance of the filtered data clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection(); //apply a OrderID that doesn't exist FilteredOrderLines.FilterByOrderID("9"); //test to see that there are no records Assert.AreEqual(0, FilteredOrderLines.Count); }
public void FilterByOrderIDeMethodOK() { //create an instance of the class we want to create clsOrderLineCollection AllOrderLines = new clsOrderLineCollection(); //create an instance of the filtered data clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection(); //apply a blank string (should return all records) FilteredOrderLines.FilterByOrderID(""); //test to see that the two values are the same Assert.AreEqual(AllOrderLines.Count, FilteredOrderLines.Count); }