public void CheckExistTest() { int barcode = packageDao.RegisterPackage(testPack); var result = packageService.CheckIfBarcodeExist(barcode, null); int resultBarcode = result.Barcode; var pack = packageDao.Packages.SingleOrDefault(Package => Package.Barcode == barcode); packageDao.Packages.Remove(pack); packageDao.SaveChanges(); Assert.AreEqual(barcode, resultBarcode); }
public int AddPackage(Package pack, int userID) { //Form Proper package types pack.UserId = userID; pack.DistributionCenterID = employeeLoginDao.GetEmployeeLoginDetail(userID).DistributionCenterID; pack.ReceivingCenterID = null; pack.StockStatus = StockType.InStock; pack.TransactionDate = DateTime.Today; return(packageDao.RegisterPackage(pack)); }