public async Task Should_Success_Get_Empty_DataExcel()
        {
            var serviceProviderMock = GetServiceProvider();

            var dbContext = GetDbContext(GetCurrentAsyncMethod());

            serviceProviderMock
            .Setup(serviceProvider => serviceProvider.GetService(typeof(FinanceDbContext)))
            .Returns(dbContext);

            var serviceProvider1 = new Mock <IServiceProvider>();

            var httpClientService = new Mock <IHttpClientService>();

            serviceProviderMock
            .Setup(x => x.GetService(typeof(IIdentityService)))
            .Returns(new IdentityService()
            {
                Token = "Token", Username = "******", TimezoneOffset = 7
            });

            HttpResponseMessage message = new HttpResponseMessage(System.Net.HttpStatusCode.OK);

            message.Content = new StringContent("{\"data\":[]}");

            httpClientService
            .Setup(x => x.GetAsync(It.Is <string>(s => s.Contains("garment-shipping/local-sales-notes/localSalesDebtor"))))
            .ReturnsAsync(message);

            serviceProvider1
            .Setup(x => x.GetService(typeof(IHttpClientService)))
            .Returns(new HttpClientTestService());


            serviceProvider1
            .Setup(x => x.GetService(typeof(IIdentityService)))
            .Returns(new IdentityService()
            {
                Token = "Token", Username = "******", TimezoneOffset = 7
            });

            serviceProvider1
            .Setup(x => x.GetService(typeof(IHttpClientService)))
            .Returns(httpClientService.Object);

            GarmentFinanceMemorialDetailLocalService serviceMemo = new GarmentFinanceMemorialDetailLocalService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            GarmentFinanceMemorialDetailLocalModel   modelMemo   = _dataUtilMemo(serviceMemo, GetCurrentMethod()).GetNewData();

            GarmentFinanceBankCashReceiptDetailLocalService serviceBankCash        = new GarmentFinanceBankCashReceiptDetailLocalService(serviceProviderMock.Object);
            GarmentFinanceBankCashReceiptDetailLocalModel   cashReceiptDetailModel = await _dataUtilBankCash(serviceBankCash).GetTestData();

            LocalSalesDebtorReportService service = new LocalSalesDebtorReportService(serviceProvider1.Object, _dbContext(GetCurrentMethod()));

            var response1 = service.GenerateExcel(1, DateTimeOffset.Now.Year);

            Assert.NotNull(response1);

            var response2 = service.GenerateExcel(2, DateTimeOffset.Now.Year);

            Assert.NotNull(response2);

            var response3 = service.GenerateExcel(3, DateTimeOffset.Now.Year);

            Assert.NotNull(response3);

            var response4 = service.GenerateExcel(4, DateTimeOffset.Now.Year);

            Assert.NotNull(response4);

            var response5 = service.GenerateExcel(5, DateTimeOffset.Now.Year);

            Assert.NotNull(response5);

            var response6 = service.GenerateExcel(6, DateTimeOffset.Now.Year);

            Assert.NotNull(response6);

            var response7 = service.GenerateExcel(7, DateTimeOffset.Now.Year);

            Assert.NotNull(response7);

            var response8 = service.GenerateExcel(8, DateTimeOffset.Now.Year);

            Assert.NotNull(response8);

            var response9 = service.GenerateExcel(9, DateTimeOffset.Now.Year);

            Assert.NotNull(response9);

            var response10 = service.GenerateExcel(10, DateTimeOffset.Now.Year);

            Assert.NotNull(response10);

            var response11 = service.GenerateExcel(11, DateTimeOffset.Now.Year);

            Assert.NotNull(response11);

            var response12 = service.GenerateExcel(12, DateTimeOffset.Now.Year);

            Assert.NotNull(response12);
        }
        public async Task Should_Success_Get_All_DataExcel()
        {
            var serviceProviderMock = GetServiceProvider();

            var dbContext = GetDbContext(GetCurrentAsyncMethod());

            serviceProviderMock
            .Setup(serviceProvider => serviceProvider.GetService(typeof(FinanceDbContext)))
            .Returns(dbContext);

            var serviceProvider1 = new Mock <IServiceProvider>();

            var httpClientService = new Mock <IHttpClientService>();

            serviceProviderMock
            .Setup(x => x.GetService(typeof(IIdentityService)))
            .Returns(new IdentityService()
            {
                Token = "Token", Username = "******", TimezoneOffset = 7
            });

            HttpResponseMessage message = new HttpResponseMessage(System.Net.HttpStatusCode.OK);

            message.Content = new StringContent("{\"data\":[{\"salesContractNo\":null,\"localSalesContractId\":0,\"noteNo\":\"21/LBJ/00003\",\"date\":\"2021-08-31T17:00:00+00:00\",\"transactionType\":null,\"buyer\":{\"id\":63,\"code\":\"IJA\",\"name\":\"PT INDORENZA JAYA ABADI\",\"address\":null,\"npwp\":null,\"country\":null,\"nik\":null,\"kaberType\":null},\"tempo\":0,\"expenditureNo\":null,\"dispositionNo\":null,\"useVat\":false,\"remark\":null,\"isUsed\":false,\"paymentType\":null,\"amount\":55000000.0,\"items\":null,\"id\":29,\"active\":false,\"createdUtc\":\"0001 - 01 - 01T00: 00:00\",\"createdBy\":null,\"createdAgent\":null,\"lastModifiedUtc\":\"0001 - 01 - 01T00: 00:00\",\"lastModifiedBy\":null,\"lastModifiedAgent\":null,\"isDeleted\":false,\"deletedUtc\":\"0001 - 01 - 01T00: 00:00\",\"deletedBy\":null,\"deletedAgent\":null},]}");

            httpClientService
            .Setup(x => x.GetAsync(It.Is <string>(s => s.Contains("garment-shipping/local-sales-notes/localSalesDebtor"))))
            .ReturnsAsync(message);

            serviceProvider1
            .Setup(x => x.GetService(typeof(IHttpClientService)))
            .Returns(new HttpClientTestService());


            serviceProvider1
            .Setup(x => x.GetService(typeof(IIdentityService)))
            .Returns(new IdentityService()
            {
                Token = "Token", Username = "******", TimezoneOffset = 7
            });

            serviceProvider1
            .Setup(x => x.GetService(typeof(IHttpClientService)))
            .Returns(httpClientService.Object);

            GarmentFinanceMemorialDetailLocalService serviceMemo = new GarmentFinanceMemorialDetailLocalService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            GarmentFinanceMemorialDetailLocalModel   modelMemo   = _dataUtilMemo(serviceMemo, GetCurrentMethod()).GetNewData();

            GarmentFinanceBankCashReceiptDetailLocalService serviceBankCash        = new GarmentFinanceBankCashReceiptDetailLocalService(serviceProviderMock.Object);
            GarmentFinanceBankCashReceiptDetailLocalModel   cashReceiptDetailModel = await _dataUtilBankCash(serviceBankCash).GetTestData();

            LocalSalesDebtorReportService service = new LocalSalesDebtorReportService(serviceProvider1.Object, _dbContext(GetCurrentMethod()));

            var response1 = service.GenerateExcel(1, DateTimeOffset.Now.Year);

            Assert.NotNull(response1);

            var response2 = service.GenerateExcel(2, DateTimeOffset.Now.Year);

            Assert.NotNull(response2);

            var response3 = service.GenerateExcel(3, DateTimeOffset.Now.Year);

            Assert.NotNull(response3);

            var response4 = service.GenerateExcel(4, DateTimeOffset.Now.Year);

            Assert.NotNull(response4);

            var response5 = service.GenerateExcel(5, DateTimeOffset.Now.Year);

            Assert.NotNull(response5);

            var response6 = service.GenerateExcel(6, DateTimeOffset.Now.Year);

            Assert.NotNull(response6);

            var response7 = service.GenerateExcel(7, DateTimeOffset.Now.Year);

            Assert.NotNull(response7);

            var response8 = service.GenerateExcel(8, DateTimeOffset.Now.Year);

            Assert.NotNull(response8);

            var response9 = service.GenerateExcel(9, DateTimeOffset.Now.Year);

            Assert.NotNull(response9);

            var response10 = service.GenerateExcel(10, DateTimeOffset.Now.Year);

            Assert.NotNull(response10);

            var response11 = service.GenerateExcel(11, DateTimeOffset.Now.Year);

            Assert.NotNull(response11);

            var response12 = service.GenerateExcel(12, DateTimeOffset.Now.Year);

            Assert.NotNull(response12);
        }