public async Task Should_Success_Get_Unit_Payment_Order()
        {
            var numberGeneratorMock             = new Mock <IBankDocumentNumberGenerator>();
            PPHBankExpenditureNoteFacade facade = new PPHBankExpenditureNoteFacade(_dbContext(GetCurrentMethod()), numberGeneratorMock.Object);

            _dataUtil(facade, GetCurrentMethod());
            PurchasingDocumentExpedition model = await pdaDataUtil.GetCashierTestData();

            var Response = facade.GetUnitPaymentOrder(null, null, model.IncomeTaxName, model.IncomeTaxRate, model.Currency);

            Assert.NotEqual(Response.Count, 0);
        }
예제 #2
0
        public async Task Should_Success_Get_Unit_Payment_Order()
        {
            var numberGeneratorMock          = new Mock <IBankDocumentNumberGenerator>();
            BankExpenditureNoteFacade facade = new BankExpenditureNoteFacade(_dbContext(GetCurrentMethod()), numberGeneratorMock.Object, GetServiceProviderMock().Object);

            _dataUtil(facade, GetCurrentMethod());
            PurchasingDocumentExpedition model = await pdaDataUtil.GetCashierTestData();

            var filter = new
            {
                model.Currency
            };
            var filterJson = JsonConvert.SerializeObject(filter);

            var Response = facade.GetAllByPosition(1, 25, "{}", model.UnitPaymentOrderNo, filterJson);

            Assert.NotEmpty(Response.Data);
        }
예제 #3
0
        public async void Should_Success_Get_Unit_Payment_Order()
        {
            var numberGeneratorMock          = new Mock <IBankDocumentNumberGenerator>();
            BankExpenditureNoteFacade facade = new BankExpenditureNoteFacade(_dbContext(GetCurrentMethod()), numberGeneratorMock.Object);

            _dataUtil(facade, GetCurrentMethod());
            PurchasingDocumentExpedition model = await pdaDataUtil.GetCashierTestData();

            var Response = facade.GetAllByPosition(1, 25, "{}", null, "{}");

            Assert.NotEqual(Response.Data.Count, 0);
        }
        public async Task Should_Success_Get_Unit_Payment_Order()
        {
            var numberGeneratorMock = new Mock <IBankDocumentNumberGenerator>();

            var serviceProvider = new Mock <IServiceProvider>();

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

            var services = new ServiceCollection();

            services.AddMemoryCache();
            var serviceProviders = services.BuildServiceProvider();
            var memoryCache      = serviceProviders.GetService <IMemoryCache>();
            var mockMemoryCache  = new Mock <IMemoryCacheManager>();

            mockMemoryCache.Setup(x => x.Get(MemoryCacheConstant.Divisions, It.IsAny <Func <ICacheEntry, List <IdCOAResult> > >()))
            .Returns(new List <IdCOAResult>());
            mockMemoryCache.Setup(x => x.Get(MemoryCacheConstant.BankAccounts, It.IsAny <Func <ICacheEntry, List <BankAccountCOAResult> > >()))
            .Returns(new List <BankAccountCOAResult>());
            mockMemoryCache.Setup(x => x.Get(MemoryCacheConstant.IncomeTaxes, It.IsAny <Func <ICacheEntry, List <IncomeTaxCOAResult> > >()))
            .Returns(new List <IncomeTaxCOAResult>());
            serviceProvider
            .Setup(x => x.GetService(typeof(IMemoryCacheManager)))
            .Returns(mockMemoryCache.Object);

            PPHBankExpenditureNoteFacade facade = new PPHBankExpenditureNoteFacade(_dbContext(GetCurrentMethod()), numberGeneratorMock.Object, serviceProvider.Object);

            _dataUtil(facade, GetCurrentMethod());
            PurchasingDocumentExpedition model = await pdaDataUtil.GetCashierTestData();

            var Response = facade.GetUnitPaymentOrder(null, null, model.IncomeTaxName, model.IncomeTaxRate, model.Currency, model.DivisionCode);

            Assert.NotEmpty(Response);
        }