public Task <int> InsertAsync(GarmentShippingCreditAdviceModel model)
        {
            model.FlagForCreate(_identityProvider.Username, UserAgent);
            _dbSet.Add(model);

            return(_dbContext.SaveChangesAsync());
        }
        public void should_Success_Instantiate2()
        {
            GarmentShippingCreditAdviceModel model = new GarmentShippingCreditAdviceModel();

            model.SetBalanceAmount(1000, "username", "useragent");
            Assert.NotNull(model);
        }
        public void should_Success_Instantiate()
        {
            GarmentShippingCreditAdviceModel model = new GarmentShippingCreditAdviceModel();

            model.SetInvoiceId(2, "username", "useragent");
            Assert.NotNull(model);
        }
        public async Task <int> Update(int id, GarmentShippingCreditAdviceViewModel viewModel)
        {
            viewModel.buyer = viewModel.buyer ?? new Buyer();
            viewModel.bank  = viewModel.bank ?? new BankAccount();
            GarmentShippingCreditAdviceModel model = new GarmentShippingCreditAdviceModel(viewModel.packingListId, viewModel.invoiceId, viewModel.invoiceNo, viewModel.date.GetValueOrDefault(), viewModel.amount, viewModel.amountToBePaid, viewModel.paymentTerm, viewModel.receiptNo, viewModel.lcNo, viewModel.valas, viewModel.lcType, viewModel.inkaso, viewModel.disconto, viewModel.srNo, viewModel.negoDate.GetValueOrDefault(), viewModel.paymentDate.GetValueOrDefault(), viewModel.condition, viewModel.bankComission, viewModel.discrepancyFee, viewModel.nettNego, viewModel.btbCADate.GetValueOrDefault(), viewModel.btbAmount, viewModel.btbRatio, viewModel.btbRate, viewModel.btbTransfer, viewModel.btbMaterial, viewModel.billDays, viewModel.billAmount, viewModel.billCA, viewModel.buyer.Id, viewModel.buyer.Name, viewModel.buyer.Address, viewModel.bank.id, viewModel.bank.accountName, viewModel.bank.bankAddress, viewModel.creditInterest, viewModel.bankCharges, viewModel.otherCharge, viewModel.documentPresente.GetValueOrDefault(), viewModel.cargoPolicyNo, viewModel.cargoPolicyDate.GetValueOrDefault(), viewModel.cargoPolicyValue, viewModel.accountsReceivablePolicyNo, viewModel.accountsReceivablePolicyDate.GetValueOrDefault(), viewModel.accountsReceivablePolicyValue, viewModel.documentSendDate.GetValueOrDefault(), viewModel.remark);

            return(await _repository.UpdateAsync(id, model));
        }
Пример #5
0
        public Task <int> InsertAsync(GarmentShippingCreditAdviceModel model)
        {
            var invoice = _garmentshippingInvoiceDbSet.FirstOrDefault(a => a.Id == model.InvoiceId);

            invoice.SetAmountCA(invoice.AmountCA + (decimal)model.AmountPaid, _identityProvider.Username, UserAgent);

            model.FlagForCreate(_identityProvider.Username, UserAgent);
            _dbSet.Add(model);

            return(_dbContext.SaveChangesAsync());
        }
        public async Task ReadById_Success()
        {
            var model = new GarmentShippingCreditAdviceModel(1, 1, "", DateTimeOffset.Now, 1, 1, "", "", "", true, "", 1, 1, "", DateTimeOffset.Now, DateTimeOffset.Now, "", 0, 0, 1, DateTimeOffset.Now, 0, 0, 0, 0, 0, 0, 0, "", 1, "", "", 1, "", "", 0, 0, 0, DateTimeOffset.Now, "", DateTimeOffset.Now, 0, "", DateTimeOffset.Now, 0, DateTimeOffset.Now, "");

            var repoMock = new Mock <IGarmentShippingCreditAdviceRepository>();

            repoMock.Setup(s => s.ReadByIdAsync(It.IsAny <int>()))
            .ReturnsAsync(model);

            var service = GetService(GetServiceProvider(repoMock.Object).Object);

            var result = await service.ReadById(1);

            Assert.NotNull(result);
        }
        public void ReadData_Success()
        {
            var model    = new GarmentShippingCreditAdviceModel(1, 1, "", DateTimeOffset.Now, 1, 1, "", "", "", true, "", 1, 1, "", DateTimeOffset.Now, DateTimeOffset.Now, "", 0, 0, 1, DateTimeOffset.Now, 0, 0, 0, 0, 0, 0, 0, "", 1, "", "", 1, "", "", 0, 0, 0, DateTimeOffset.Now, "", DateTimeOffset.Now, 0, "", DateTimeOffset.Now, 0, DateTimeOffset.Now, "");
            var repoMock = new Mock <IGarmentShippingCreditAdviceRepository>();

            repoMock.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCreditAdviceModel>()
            {
                model
            }.AsQueryable());

            var service = GetService(GetServiceProvider(repoMock.Object).Object);

            var result = service.ReadData(1, 25, "{}", "{}", null);

            Assert.NotEmpty(result.Data);
        }
Пример #8
0
        public void GenerateExcel_Success()
        {
            var model = new GarmentShippingInvoiceModel(1, "", DateTimeOffset.Now, "", "", 1, "A99", "", "", "", "", 1, "", "", DateTimeOffset.Now, "", 1, "", 1, "", 1, "", 1, "", DateTimeOffset.Now,
                                                        "", DateTimeOffset.Now, "", "", null, 1, "", "", "", false, "", DateTimeOffset.Now, "", DateTimeOffset.Now, "", DateTimeOffset.Now, null, 1, "", "", null)
            {
                Id = 1
            };

            var model1 = new GarmentPackingListModel("", "", "DL", 1, "", DateTimeOffset.Now, "", "", DateTimeOffset.Now, "", 1, "", "", "", "", "", DateTimeOffset.Now, DateTimeOffset.Now, DateTimeOffset.Now, false, false, "", "", "", null, 1, 1, 1, 1, null, "", "", "", "", "", "", "", false, false, 1, "", GarmentPackingListStatusEnum.CREATED, "", false, "")
            {
                Id = 1
            };

            var model2 = new GarmentShippingCreditAdviceModel(1, 1, "", DateTimeOffset.Now, 1, 1, "", "", true, "", 1, 1, "", DateTimeOffset.Now, DateTimeOffset.Now, "", 1, 1, 1, DateTimeOffset.Now, 1, 1, 1, 1, 1, 1, 1, "", 1, "", "", 1, "", "", 1, 1, 1, DateTimeOffset.Now, "", DateTimeOffset.Now, 1, "", DateTimeOffset.Now, 1, DateTimeOffset.Now, "");

            var repoMock = new Mock <IGarmentShippingInvoiceRepository>();

            repoMock.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInvoiceModel>()
            {
                model
            }.AsQueryable());

            var repoMock1 = new Mock <IGarmentPackingListRepository>();

            repoMock1.Setup(s => s.ReadAll())
            .Returns(new List <GarmentPackingListModel>()
            {
                model1
            }.AsQueryable());

            var repoMock2 = new Mock <IGarmentShippingCreditAdviceRepository>();

            repoMock2.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCreditAdviceModel>()
            {
                model2
            }.AsQueryable());

            var service = GetService(GetServiceProvider(repoMock.Object, repoMock1.Object, repoMock2.Object).Object);

            var result = service.GenerateExcel(model.BuyerAgentCode, null, DateTime.MinValue, DateTime.MaxValue, 7);

            Assert.NotNull(result);
        }
        public void GenerateExcel_Success()
        {
            var model = new GarmentShippingCreditAdviceModel(1, 1, "", DateTimeOffset.Now, 1, 1, 1, 1, "", "", "", true, "", 1, 1, "", DateTimeOffset.Now, DateTimeOffset.Now, "", 1, 1, 1, DateTimeOffset.Now, 1, 1, 1, 1, 1, 1, 1, "", 1, "", "", 1, "", "", 1, 1, 1, DateTimeOffset.Now, "", DateTimeOffset.Now, 1, "", DateTimeOffset.Now, 1, DateTimeOffset.Now, "");

            var repoMock = new Mock <IGarmentShippingCreditAdviceRepository>();

            repoMock.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCreditAdviceModel>()
            {
                model
            }.AsQueryable());

            var service = GetService(GetServiceProvider(repoMock.Object).Object);

            var result = service.GenerateExcel(model.BuyerName, null, null, DateTime.MinValue, DateTime.MaxValue, 7);

            Assert.NotNull(result);
        }
Пример #10
0
        public async Task <int> UpdateAsync(int id, GarmentShippingCreditAdviceModel model)
        {
            var modelToUpdate = _dbSet.First(s => s.Id == id);

            modelToUpdate.SetValas(model.Valas, _identityProvider.Username, UserAgent);
            modelToUpdate.SetLCType(model.LCType, _identityProvider.Username, UserAgent);
            modelToUpdate.SetInkaso(model.Inkaso, _identityProvider.Username, UserAgent);
            modelToUpdate.SetDisconto(model.Disconto, _identityProvider.Username, UserAgent);
            modelToUpdate.SetSRNo(model.SRNo, _identityProvider.Username, UserAgent);
            modelToUpdate.SetNegoDate(model.NegoDate, _identityProvider.Username, UserAgent);
            modelToUpdate.SetPaymentDate(model.PaymentDate, _identityProvider.Username, UserAgent);
            modelToUpdate.SetReceiptNo(model.ReceiptNo, _identityProvider.Username, UserAgent);
            modelToUpdate.SetCondition(model.Condition, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBankComission(model.BankComission, _identityProvider.Username, UserAgent);
            modelToUpdate.SetDiscrepancyFee(model.DiscrepancyFee, _identityProvider.Username, UserAgent);
            modelToUpdate.SetNettNego(model.NettNego, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBTBCADate(model.BTBCADate, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBTBAmount(model.BTBAmount, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBTBRatio(model.BTBRatio, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBTBRate(model.BTBRate, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBTBTransfer(model.BTBTransfer, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBTBMaterial(model.BTBMaterial, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBillDays(model.BillDays, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBillAmount(model.BillAmount, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBillCA(model.BillCA, _identityProvider.Username, UserAgent);
            modelToUpdate.SetCreditInterest(model.CreditInterest, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBankCharges(model.BankCharges, _identityProvider.Username, UserAgent);
            modelToUpdate.SetOtherCharge(model.OtherCharge, _identityProvider.Username, UserAgent);
            modelToUpdate.SetDocumentPresente(model.DocumentPresente, _identityProvider.Username, UserAgent);
            modelToUpdate.SetCargoPolicyNo(model.CargoPolicyNo, _identityProvider.Username, UserAgent);
            modelToUpdate.SetCargoPolicyDate(model.CargoPolicyDate, _identityProvider.Username, UserAgent);
            modelToUpdate.SetCargoPolicyValue(model.CargoPolicyValue, _identityProvider.Username, UserAgent);
            modelToUpdate.SetAccountsReceivablePolicyNo(model.AccountsReceivablePolicyNo, _identityProvider.Username, UserAgent);
            modelToUpdate.SetAccountsReceivablePolicyDate(model.AccountsReceivablePolicyDate, _identityProvider.Username, UserAgent);
            modelToUpdate.SetAccountsReceivablePolicyValue(model.AccountsReceivablePolicyValue, _identityProvider.Username, UserAgent);
            modelToUpdate.SetDocumentSendDate(model.DocumentSendDate, _identityProvider.Username, UserAgent);
            modelToUpdate.SetRemark(model.Remark, _identityProvider.Username, UserAgent);
            modelToUpdate.SetAmountPaid(model.AmountPaid, _identityProvider.Username, UserAgent);
            modelToUpdate.SetBalanceAmount(model.BalanceAmount, _identityProvider.Username, UserAgent);
            modelToUpdate.SetInvoiceId(model.InvoiceId, _identityProvider.Username, UserAgent);

            return(await _dbContext.SaveChangesAsync());
        }
        private GarmentShippingCreditAdviceViewModel MapToViewModel(GarmentShippingCreditAdviceModel model)
        {
            GarmentShippingCreditAdviceViewModel viewModel = new GarmentShippingCreditAdviceViewModel
            {
                Active            = model.Active,
                Id                = model.Id,
                CreatedAgent      = model.CreatedAgent,
                CreatedBy         = model.CreatedBy,
                CreatedUtc        = model.CreatedUtc,
                DeletedAgent      = model.DeletedAgent,
                DeletedBy         = model.DeletedBy,
                DeletedUtc        = model.DeletedUtc,
                IsDeleted         = model.IsDeleted,
                LastModifiedAgent = model.LastModifiedAgent,
                LastModifiedBy    = model.LastModifiedBy,
                LastModifiedUtc   = model.LastModifiedUtc,
                receiptNo         = model.ReceiptNo,
                packingListId     = model.PackingListId,
                invoiceId         = model.InvoiceId,
                invoiceNo         = model.InvoiceNo,
                paymentTerm       = model.PaymentTerm,

                lcNo           = model.LCNo,
                date           = model.Date,
                amount         = model.Amount,
                amountToBePaid = model.AmountToBePaid,

                valas          = model.Valas,
                lcType         = model.LCType,
                inkaso         = model.Inkaso,
                disconto       = model.Disconto,
                srNo           = model.SRNo,
                negoDate       = model.NegoDate,
                paymentDate    = model.PaymentDate,
                condition      = model.Condition,
                bankComission  = model.BankComission,
                discrepancyFee = model.DiscrepancyFee,
                nettNego       = model.NettNego,

                btbCADate   = model.BTBCADate,
                btbAmount   = model.BTBAmount,
                btbRatio    = model.BTBRatio,
                btbRate     = model.BTBRate,
                btbTransfer = model.BTBTransfer,
                btbMaterial = model.BTBMaterial,

                billDays   = model.BillDays,
                billAmount = model.BillAmount,
                billCA     = model.BillCA,
                buyer      = new Buyer
                {
                    Id      = model.BuyerId,
                    Name    = model.BuyerName,
                    Address = model.BuyerAddress
                },
                bank = new BankAccount
                {
                    id          = model.BankAccountId,
                    accountName = model.BankAccountName,
                    bankAddress = model.BankAddress
                },
                creditInterest                = model.CreditInterest,
                bankCharges                   = model.BankCharges,
                otherCharge                   = model.OtherCharge,
                documentPresente              = model.DocumentPresente,
                cargoPolicyNo                 = model.CargoPolicyNo,
                cargoPolicyDate               = model.CargoPolicyDate,
                cargoPolicyValue              = model.CargoPolicyValue,
                accountsReceivablePolicyNo    = model.AccountsReceivablePolicyNo,
                accountsReceivablePolicyDate  = model.AccountsReceivablePolicyDate,
                accountsReceivablePolicyValue = model.AccountsReceivablePolicyValue,
                documentSendDate              = model.DocumentSendDate,
                remark = model.Remark
            };

            return(viewModel);
        }
        public void GetReportData_Success()
        {
            var model = new GarmentPackingListModel("", "", "DL", 1, "", DateTimeOffset.Now, "", "", DateTimeOffset.Now, "", 1, "", "", "", "", "", DateTimeOffset.Now, DateTimeOffset.Now, DateTimeOffset.Now, false, false, "", "", "", null, 1, 1, 1, 1, null, "", "", "", "", "", "", "", false, false, 1, "", GarmentPackingListStatusEnum.CREATED, "", false, "")
            {
                Id = 1
            };

            var model1 = new GarmentShippingInvoiceModel(1, "", DateTimeOffset.Now, "", "", 1, "A99", "", "", "", "", 1, "", "", DateTimeOffset.Now, "", 1, "", 1, "", 1, "", 1, "", DateTimeOffset.Now,
                                                         "", DateTimeOffset.Now, "", "", null, 1, "", "", "", false, "", DateTimeOffset.Now, "", DateTimeOffset.Now, "", DateTimeOffset.Now, null, 1, "", "", null)
            {
                Id = 1
            };

            var model2 = new GarmentShippingInstructionModel("no", 1, DateTimeOffset.Now, 1, "", "", "", "", "", "", "", 1, "", "", "", DateTimeOffset.Now, "", "", "", "", "", "", "", "", 1, "", 1, "", "", "", "", "", DateTimeOffset.Now, "", "", "")
            {
                Id = 1
            };

            var model3 = new GarmentShippingCoverLetterModel(1, 1, "", DateTimeOffset.Now, 1, "", "", "", "", "", "", "", DateTimeOffset.Now, 1, "", "", 1, 1, 1, 1, 1, "", "", "", "", "", "", "", "", "", "", DateTimeOffset.Now, "", 1, "");

            var model4 = new GarmentShippingCreditAdviceModel(1, 1, "", DateTimeOffset.Now, 1, 1, "", "", "", true, "", 1, 1, "", DateTimeOffset.Now, DateTimeOffset.Now, "", 1, 1, 1, DateTimeOffset.Now, 1, 1, 1, 1, 1, 1, 1, "", 1, "", "", 1, "", "", 1, 1, 1, DateTimeOffset.Now, "", DateTimeOffset.Now, 1, "", DateTimeOffset.Now, 1, DateTimeOffset.Now, "");

            var repoMock1 = new Mock <IGarmentPackingListRepository>();

            repoMock1.Setup(s => s.ReadAll())
            .Returns(new List <GarmentPackingListModel>()
            {
                model
            }.AsQueryable());

            var repoMock2 = new Mock <IGarmentShippingInvoiceRepository>();

            repoMock2.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInvoiceModel>()
            {
                model1
            }.AsQueryable());

            var repoMock3 = new Mock <IGarmentShippingInstructionRepository>();

            repoMock3.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInstructionModel>()
            {
                model2
            }.AsQueryable());

            var repoMock4 = new Mock <IGarmentCoverLetterRepository>();

            repoMock4.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCoverLetterModel>()
            {
                model3
            }.AsQueryable());

            var repoMock5 = new Mock <IGarmentShippingCreditAdviceRepository>();

            repoMock5.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCreditAdviceModel>()
            {
                model4
            }.AsQueryable());

            var service = GetService(GetServiceProvider(repoMock1.Object, repoMock2.Object, repoMock3.Object, repoMock4.Object, repoMock5.Object).Object);

            var result = service.GetReportData(model2.BuyerAgentCode, null, DateTime.MinValue, DateTime.MaxValue, 0);

            Assert.NotEmpty(result.ToList());
        }
        public void GetReportData_Success()
        {
            var model = new GarmentShippingInvoiceModel(1, "", DateTimeOffset.Now, "", "", 1, "A99", "", "", "", "", 1, "", "", DateTimeOffset.Now, "", 1, "", 1, "", 1, "", 1, "", DateTimeOffset.Now,
                                                        "", DateTimeOffset.Now, "", "", null, 1, "", "", "", false, "", DateTimeOffset.Now, "", DateTimeOffset.Now, "", DateTimeOffset.Now, null, 1, "", "", null)
            {
                Id = 1
            };

            var model1 = new GarmentPackingListModel("", "", "DL", 1, "", DateTimeOffset.Now, "", "", DateTimeOffset.Now, "", 1, "", "", "", "", "", DateTimeOffset.Now, DateTimeOffset.Now, DateTimeOffset.Now, false, false, "", "", "", null, 1, 1, 1, 1, null, "", "", "", "", "", "", "", false, false, 1, "", GarmentPackingListStatusEnum.CREATED, "", false, "")
            {
                Id = 1
            };

            var model2 = new GarmentShippingCreditAdviceModel(1, 1, "", DateTimeOffset.Now, 1, 1, "", "", "", true, "", 1, 1, "", DateTimeOffset.Now, DateTimeOffset.Now, "", 1, 1, 1, DateTimeOffset.Now, 1, 1, 1, 1, 1, 1, 1, "", 1, "", "", 1, "", "", 1, 1, 1, DateTimeOffset.Now, "", DateTimeOffset.Now, 1, "", DateTimeOffset.Now, 1, DateTimeOffset.Now, "");


            var model3 = new GarmentShippingInvoiceItemModel("", "", 1, "", 1, 1, "", "", "", "comodesc", "comodesc", "comodesc", 1, "", 1, 1, 1, "", 1, "C10", 1, 1)
            {
                GarmentShippingInvoiceId = 1
            };


            var repoMock = new Mock <IGarmentShippingInvoiceRepository>();

            repoMock.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInvoiceModel>()
            {
                model
            }.AsQueryable());

            var repoMock1 = new Mock <IGarmentPackingListRepository>();

            repoMock1.Setup(s => s.ReadAll())
            .Returns(new List <GarmentPackingListModel>()
            {
                model1
            }.AsQueryable());

            var repoMock2 = new Mock <IGarmentShippingCreditAdviceRepository>();

            repoMock2.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCreditAdviceModel>()
            {
                model2
            }.AsQueryable());


            var repoMock3 = new Mock <IGarmentShippingInvoiceItemRepository>();

            repoMock3.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInvoiceItemModel>()
            {
                model3
            }.AsQueryable());


            var httpMock = new Mock <IHttpClientService>();

            httpMock.Setup(s => s.SendAsync(HttpMethod.Get, It.IsAny <string>(), It.IsAny <HttpContent>()))
            .ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(JsonConvert.SerializeObject(new { data = new List <GarmentCurrency> {
                                                                                  new GarmentCurrency()
                                                                                  {
                                                                                      code = "usd"
                                                                                  }
                                                                              } }))
            });

            var spMock = GetServiceProvider(repoMock.Object, repoMock1.Object, repoMock2.Object, repoMock3.Object);

            spMock.Setup(s => s.GetService(typeof(IHttpClientService)))
            .Returns(httpMock.Object);
            var service = GetService(spMock.Object);

            var result = service.GetReportData(model.BuyerAgentCode, DateTime.MinValue, DateTime.MaxValue, 0);

            Assert.NotEmpty(result.Data);
        }
Пример #14
0
        public void GenerateExcel_Empty_Success()
        {
            var model1 = new GarmentPackingListModel("", "", "DL", 1, "", DateTimeOffset.Now, "", "", DateTimeOffset.Now, "", 1, "", "", "", "", "", DateTimeOffset.Now, DateTimeOffset.Now, DateTimeOffset.Now, false, false, "", "", "", null, 1, 1, 1, 1, null, "", "", "", "", "", "", "", false, false, 1, "", GarmentPackingListStatusEnum.CREATED, "", false, "")
            {
                Id = 1
            };

            var model2 = new GarmentShippingInvoiceModel(1, "", DateTimeOffset.Now, "", "", 1, "A99", "", "", "", "", 1, "", "", DateTimeOffset.Now, "", 1, "", 1, "", 1, "", 1, "", DateTimeOffset.Now,
                                                         "", DateTimeOffset.Now, "", "", null, 1, "", "", "", false, "", DateTimeOffset.Now, "", DateTimeOffset.Now, "", DateTimeOffset.Now, null, 1, "", "", null)
            {
                Id = 1
            };

            var iteminv = new List <GarmentShippingInvoiceItemModel>
            {
                new GarmentShippingInvoiceItemModel("", "", 1, "", 1, 1, "", "", "", "", "", "", 1, "", 1, 1, 1, "", 1, "C10", 1, 1)
                {
                    GarmentShippingInvoiceId = 1
                },
                new GarmentShippingInvoiceItemModel("", "", 1, "", 1, 1, "", "", "", "", "", "", 1, "", 1, 1, 1, "", 1, "C10", 1, 2)
                {
                    GarmentShippingInvoiceId = 1
                },
            };

            var itemadj = new List <GarmentShippingInvoiceAdjustmentModel>
            {
                new GarmentShippingInvoiceAdjustmentModel(1, "", 100, 1)
                {
                    GarmentShippingInvoiceId = 1
                },
                new GarmentShippingInvoiceAdjustmentModel(1, "", 25, 1)
                {
                    GarmentShippingInvoiceId = 1
                },
            };

            var model3 = new GarmentShippingCoverLetterModel(1, 1, "", DateTimeOffset.Now, 1, "", "", "", "", "", "", "", DateTimeOffset.Now, 1, "", "", 1, 1, 1, 1, 1, "", "", "", "", "", "", "", "", "", "", DateTimeOffset.Now, "", 1, "");

            var model4 = new GarmentShippingCreditAdviceModel(1, 1, "", DateTimeOffset.Now, 1, 1, "", "", "", true, "", 1, 1, "", DateTimeOffset.Now, DateTimeOffset.Now, "", 1, 1, 1, DateTimeOffset.Now, 1, 1, 1, 1, 1, 1, 1, "", 1, "", "", 1, "", "", 1, 1, 1, DateTimeOffset.Now, "", DateTimeOffset.Now, 1, "", DateTimeOffset.Now, 1, DateTimeOffset.Now, "");

            var repoMock1 = new Mock <IGarmentPackingListRepository>();

            repoMock1.Setup(s => s.ReadAll())
            .Returns(new List <GarmentPackingListModel>().AsQueryable());

            var repoMock2 = new Mock <IGarmentShippingInvoiceRepository>();

            repoMock2.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInvoiceModel>().AsQueryable());

            var repoMock3 = new Mock <IGarmentShippingInvoiceItemRepository>();

            repoMock3.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInvoiceItemModel>().AsQueryable());

            var repoMock4 = new Mock <IGarmentShippingInvoiceAdjustmentRepository>();

            repoMock4.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingInvoiceAdjustmentModel>().AsQueryable());

            var repoMock5 = new Mock <IGarmentCoverLetterRepository>();

            repoMock5.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCoverLetterModel>().AsQueryable());

            var repoMock6 = new Mock <IGarmentShippingCreditAdviceRepository>();

            repoMock6.Setup(s => s.ReadAll())
            .Returns(new List <GarmentShippingCreditAdviceModel>().AsQueryable());

            var service = GetService(GetServiceProvider(repoMock1.Object, repoMock2.Object, repoMock3.Object, repoMock4.Object, repoMock5.Object, repoMock6.Object).Object);

            var result = service.GenerateExcel(null, null, null, null, 7);

            Assert.NotNull(result);
        }