public void TestAddToStockRequirementDetail() { var storageRecordInfo = new StorageRecordInfo { FilialeId = new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), WarehouseId = new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05") }; IList <StorageRecordDetailInfo> storageRecordDetailInfos = new List <StorageRecordDetailInfo> { new StorageRecordDetailInfo { RealGoodsId = new Guid("D2F69F05-C02F-4549-93C8-D3CE768D82E2") } }; _stockCenterSao.GetGoodsQuantityByRealGoodsIdsIEnumerableOfGuidGuidGuid = (guids, guid, arg3) => new List <GoodsStockQuantityInfo> { new GoodsStockQuantityInfo { RealGoodsId = new Guid("D2F69F05-C02F-4549-93C8-D3CE768D82E2") } }; try { _goodsStockCurrent = new GoodsStockCurrent(_stubIGoodsStockCurrent, _stockCenterSao); _goodsStockCurrent.AddToStockRequirementDetail(storageRecordInfo, storageRecordDetailInfos, string.Empty, string.Empty, true); Assert.IsTrue(true); } catch (Exception) { Assert.IsFalse(false); } }
public void TestGetUsableStock() { var result = _goodsStockCurrent.GetUsableStock(Guid.Empty, new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05")); Assert.IsTrue(result < 0); var result2 = _goodsStockCurrent.GetUsableStock(new Guid("891F62CA-9164-44FA-9E5B-DB3A973841D3"), Guid.Empty); Assert.IsTrue(result2 < 0); var result3 = _goodsStockCurrent.GetUsableStock(new Guid("891F62CA-9164-44FA-9E5B-DB3A973841D3"), new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05")); Assert.IsTrue(result3 < 0); _stockCenterSao.GetGoodsQuantityByRealGoodIdWarehouseGuidGuid = (guid, guid1) => new List <GoodsStockQuantityInfo> { new GoodsStockQuantityInfo { GoodsId = Guid.NewGuid(), CurrentQuantity = 10 } }; _goodsStockCurrent = new GoodsStockCurrent(_stubIGoodsStockCurrent, _stockCenterSao); var result4 = _goodsStockCurrent.GetUsableStock(new Guid("891DE2CA-9164-44FA-9E5B-DB3A973841D3"), new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05")); Assert.IsTrue(result4 == 10); }
public void Init() { _stockCenterSao.SaveGoodsStockCurrentNotChangeQuantityGuidGoodsStockCurrentInfoInt32 = (guid, info, arg3) => true; _stockCenterSao.GetChildGoodsQuantityGuid = guid => new List <GoodsStockQuantityInfo> { new GoodsStockQuantityInfo { CurrentQuantity = 100, GoodsId = Guid.NewGuid() } }; _goodsStockCurrent = new GoodsStockCurrent(_stubIGoodsStockCurrent, _stockCenterSao); }
public void TestGetGoodsStockCurrentById() { _stockCenterSao.GetGoodsQuantityByRealGoodsIdsIEnumerableOfGuidGuidGuid = (guids, guid, arg3) => null; _goodsStockCurrent = new GoodsStockCurrent(_stubIGoodsStockCurrent, _stockCenterSao); try { _goodsStockCurrent.GetGoodsStockCurrentById(new Guid("7953FA6C-F88B-4079-BBBA-5E61C3D13C01"), new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05")); } catch (Exception ex) { Assert.IsTrue(!string.IsNullOrEmpty(ex.Message)); } _stockCenterSao.GetGoodsQuantityByRealGoodsIdsIEnumerableOfGuidGuidGuid = (guids, guid, arg3) => new List <GoodsStockQuantityInfo> { new GoodsStockQuantityInfo { CurrentQuantity = 100, GoodsId = new Guid("7953FA6C-F88B-4079-BBBA-5E61C3D13C01") } }; _goodsStockCurrent = new GoodsStockCurrent(_stubIGoodsStockCurrent, _stockCenterSao); try { var result2 = _goodsStockCurrent.GetGoodsStockCurrentById(new Guid("45825468-F88B-4079-BBBA-5E61C3D13C01"), new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05")); //Assert.IsTrue(result2 == 100); } catch (Exception ex) { Assert.IsTrue(!string.IsNullOrEmpty(ex.Message)); } _stockCenterSao.GetGoodsQuantityByRealGoodsIdsIEnumerableOfGuidGuidGuid = (guids, guid, arg3) => new List <GoodsStockQuantityInfo>(); _goodsStockCurrent = new GoodsStockCurrent(_stubIGoodsStockCurrent, _stockCenterSao); try { var result3 = _goodsStockCurrent.GetGoodsStockCurrentById(new Guid("45825468-F88B-4079-BBBA-5E61C3D13C01"), new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05")); //Assert.IsTrue(result3 < 0); } catch (Exception ex) { Assert.IsTrue(!string.IsNullOrEmpty(ex.Message)); } }
public void TestGoodsStockCurrent() { _goodsStockCurrent = new GoodsStockCurrent(_stubIGoodsStockCurrent, _stockCenterSao); }