示例#1
0
        public static SelectList GetSupplierPortList(ISupplierPortBLL supplierPortbll)
        {
            ISupplierPortBLL supplierPortBll = supplierPortbll;
            var data = supplierPortBll.GetAll();

            return(new SelectList(data, "SUPPLIER_PORT_ID", "PORT_NAME"));
        }
示例#2
0
        public void GetSupplierPortAll()
        {
            _repositorySupplier = Substitute.For <IGenericRepository <SUPPLIER_PORT> >();
            _uow.GetGenericRepository <SUPPLIER_PORT>().ReturnsForAnyArgs(_repositorySupplier);
            _supplierPortBll = new SupplierPortBLL(_uow, _logger);
            var supplierPortFake = FakeStuffs.GetSupplierPorts();

            _repositorySupplier.Get().ReturnsForAnyArgs(supplierPortFake);
            var actualResult = GlobalFunctions.GetSupplierPortList(_supplierPortBll);

            var firstItemText  = actualResult.ToList()[0].Text;
            var firstItemValue = actualResult.ToList()[0].Value;

            Assert.AreEqual(firstItemText, supplierPortFake.ToList()[0].PORT_NAME);
            Assert.AreEqual(firstItemValue, supplierPortFake.ToList()[0].SUPPLIER_PORT_ID.ToString());
        }