public void ReportByCountryNoneFound() { clsVendorCollection FilteredVendors = new clsVendorCollection(); FilteredVendors.ReportByCountry("xxxxxx"); Assert.AreEqual(0, FilteredVendors.Count); }
public void ReportByCountryTestDataFound() { clsVendorCollection FilteredVendors = new clsVendorCollection(); Boolean OK = true; FilteredVendors.ReportByCountry("Italy"); //chack that the correst number of records are found if (FilteredVendors.VendorList.Count == 4) { //check that the first record ID 7 if (FilteredVendors.VendorList[0].VendorNo != 7) { OK = false; } //check that the first record ID 10 if (FilteredVendors.VendorList[1].VendorNo != 10) { OK = false; } //check that the first record ID 12 if (FilteredVendors.VendorList[2].VendorNo != 12) { OK = false; } //check that the first record ID 32 if (FilteredVendors.VendorList[3].VendorNo != 32) { OK = false; } } }
public void ReportByCountryMethodOK() { clsVendorCollection AllVendors = new clsVendorCollection(); clsVendorCollection FilteredVendors = new clsVendorCollection(); FilteredVendors.ReportByCountry(""); Assert.AreEqual(AllVendors.Count, FilteredVendors.Count); }
protected void btnApply_Click(object sender, EventArgs e) { clsVendorCollection Vendors = new clsVendorCollection(); Vendors.ReportByCountry(txtFilter.Text); lstVendors.DataSource = Vendors.VendorList; //set Name of primary key lstVendors.DataValueField = "VendorNo"; //set Name of the field to display lstVendors.DataTextField = "Country"; //bind data to the list lstVendors.DataBind(); }