public void SearchSupplierTest() { Factory factory = Factory.GetInstance(); string supplierCode = "RIBI-100"; // TODO: Initialize to an appropriate value try { ISupplierSvc supplierSvc = (ISupplierSvc)factory.GetService(typeof(ISupplierSvc).Name); supplierSvc.SearchSupplier(supplierCode);//adds product } catch (Exception e) { Assert.Fail(e.ToString());//force fail of test } }
//searches for a supplier via supplier code public Supplier SearchSupplier(string supplierCode) { Supplier supplier = new Supplier(); try { ISupplierSvc supplierSvc = (ISupplierSvc)GetService(typeof(ISupplierSvc).Name); supplier = supplierSvc.SearchSupplier(supplierCode); } catch (ServiceLoadException e) { throw new SupplierMgrException(e.Message); } catch (DBProcessingException e) { throw new SupplierMgrException(e.Message); } return(supplier); }