public void TestSelectStockReportsGroupByCompanyId() { _iSupplierReport.SelectStockReportsGroupByCompanyIdInt32GuidString = (i, guid, arg3) => new List <SupplierPaymentsReportInfo> { new SupplierPaymentsReportInfo { CompanyId = new Guid("32CB5565-6EED-4F78-BC82-0571738FD771") } }; _stubICompanyCussent.GetCompanyCussentListByCompanyNameString = s => new List <CompanyCussentInfo> { new CompanyCussentInfo { CompanyId = new Guid("32CB5565-6EED-4F78-BC82-0571738FD771"), CompanyName = "测试数据", PaymentDays = 1 } }; _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result = _supplierReportBll.SelectStockReportsGroupByCompanyId(2014, new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), string.Empty, true); Assert.IsTrue(result.Count > 0); _iSupplierReport.GetPurchasingByForCompanyGuid = guid => new Dictionary <Guid, decimal> { { new Guid("32CB5565-6EED-4F78-BC82-0571738FD771"), 100 }, { new Guid("31BF01B3-C8D0-4D4F-8177-A835E3FCBF3C"), 200 } }; _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result2 = _supplierReportBll.SelectStockReportsGroupByCompanyId(DateTime.Now.Year, Guid.Empty, string.Empty, true); Assert.IsTrue(result2.Count > 0); }
public void TestSelectPaymentsReportsGroupByCompanyId() { var result = _supplierReportBll.SelectPaymentsReportsGroupByCompanyId(DateTime.Now.Year, new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), string.Empty, true); Assert.IsNotNull(result); _stubICompanyCussent.GetCompanyCussentListByCompanyNameString = str => new List <CompanyCussentInfo> { new CompanyCussentInfo { CompanyId = new Guid("32CB5565-5845-4F78-BC82-0571738FD771"), CompanyName = "测试", PaymentDays = 2 } }; var result3 = _supplierReportBll.SelectPaymentsReportsGroupByCompanyId(DateTime.Now.Year, new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), string.Empty, true); Assert.IsNotNull(result3); var result2 = _supplierReportBll.SelectPaymentsReportsGroupByCompanyId(DateTime.Now.Year, Guid.NewGuid(), string.Empty, false); Assert.IsNotNull(result2); _stubIReckoning.SelectCurrentMonthPaymentsRecordsDetailInt32Int32GuidString = (i, i1, arg3, arg4) => new List <SupplierPaymentsRecordInfo>(); _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result4 = _supplierReportBll.SelectPaymentsReportsGroupByCompanyId(DateTime.Now.Year, new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698"), string.Empty, true); Assert.IsNotNull(result4); }
public void TestSelectStockReprotsGroupByFilialeId() { var result = _supplierReportBll.SelectStockReprotsGroupByFilialeId(DateTime.Now.Year, true); Assert.IsNotNull(result); var result2 = _supplierReportBll.SelectStockReprotsGroupByFilialeId(DateTime.Now.Year, false); Assert.IsNotNull(result2); _stubIReckoning.SelectCurrentMonthStockRecordsInt32Int32 = (i, i1) => new List <SupplierPaymentsRecordInfo>(); _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result3 = _supplierReportBll.SelectStockReprotsGroupByFilialeId(DateTime.Now.Year, true); Assert.IsTrue(result3.Count > 0); }
public void TestInsertRececkoning() { _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 3); _iSupplierReport.IsExistsRecentDateTime = time => true; //_iSupplierReport.InsertRececkoningDateTimeIListOfRecordReckoningInfo = (time, list) => true; _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result8 = _supplierReportBll.InsertRececkoning(date); Assert.IsTrue(result8); date = new DateTime(DateTime.Now.Year, 11, 1); _iSupplierReport.IsExistsDateTime = time => true; _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result9 = _supplierReportBll.InsertRececkoning(date); Assert.IsTrue(result9); _iSupplierReport.IsExistsDateTime = time => false; _stubIReckoning.SelectRecordReckoningInfosDateTimeDateTime = (time, dateTime) => new List <ERP.Model.Report.RecordReckoningInfo>(); _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result2 = _supplierReportBll.InsertRececkoning(date); Assert.IsTrue(!result2); _stubIReckoning.SelectRecordReckoningInfosDateTimeDateTime = (time, dateTime) => new List <RecordReckoningInfo> { new RecordReckoningInfo { ReckoningId = Guid.NewGuid() } }; _iSupplierReport.InsertRececkoningBooleanIListOfRecordReckoningInfo = (b, list) => true; _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); var result3 = _supplierReportBll.InsertRececkoning(date); Assert.IsTrue(result3); }
public void Init() { _stubIReckoning.SelectCurrentMonthPaymentsRecordsInt32Int32 = (i, i1) => new List <SupplierPaymentsRecordInfo> { new SupplierPaymentsRecordInfo { CompanyId = new Guid("32CB5565-6EED-4F78-BC82-0571738FD771"), FilialeId = new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698") } }; _stubICompanyCussent.GetCompanyCussentListByCompanyNameString = str => new List <CompanyCussentInfo> { new CompanyCussentInfo { CompanyId = new Guid("32CB5565-6EED-4F78-BC82-0571738FD771"), CompanyName = "测试", PaymentDays = 2 } }; _iSupplierReport.SelectPaymentsReportsGroupByCompanyIdInt32GuidString = (i, guid, arg3) => new List <SupplierPaymentsReportInfo> { new SupplierPaymentsReportInfo { April = 400, April4 = 200, CompanyId = new Guid("32CB5565-6EED-4F78-BC82-0571738FD771"), FilialeId = new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698") } }; _iSupplierReport.SelectPaymentsReprotsGroupByFilialeIdInt32 = i => new List <SupplierPaymentsReportInfo> { new SupplierPaymentsReportInfo { FilialeId = new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698") } }; _stubIReckoning.SelectCurrentMonthPaymentsRecordsDetailInt32Int32GuidString = (i, i1, arg3, arg4) => new List <SupplierPaymentsRecordInfo> { new SupplierPaymentsRecordInfo { CompanyId = new Guid("32CB5565-6EED-4F78-BC82-0571738FD771"), TotalAmount = 100, TotalNoPayed = 50 } }; _iSupplierReport.SelectStockReprotsGroupByFilialeIdInt32 = i => new List <SupplierPaymentsReportInfo> { new SupplierPaymentsReportInfo { FilialeId = new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698") } }; _stubIReckoning.SelectCurrentMonthStockRecordsInt32Int32 = (i, i1) => new List <SupplierPaymentsRecordInfo> { new SupplierPaymentsRecordInfo { CompanyId = new Guid("32CB5565-6EED-4F78-BC82-0571738FD771"), TotalAmount = 100, TotalNoPayed = 50 , FilialeId = new Guid("7AE62AF0-EB1F-49C6-8FD1-128D77C84698") } }; _supplierReportBll = new SupplierReportBll(_iSupplierReport, _stubICompanyCussent, _stubIReckoning); }