コード例 #1
0
        public async Task ShouldGetSolidarityInvitedSuppliersSucess()
        {
            SolidaritySearchCriteria cretria = new SolidaritySearchCriteria();
            var result = await _sut.GetSolidarityInvitedSuppliers(cretria);

            Assert.NotNull(result);
        }
コード例 #2
0
        public async Task Should_GetSolidarityInvitedSuppliers()
        {
            SolidaritySearchCriteria solidaritySearchCriteria = new SolidaritySearchCriteria();

            _moqSupplierQueries.Setup(s => s.GetSolidarityInvitedSuppliers(solidaritySearchCriteria))
            .Returns(() =>
            {
                return(Task.FromResult <QueryResult <SolidarityInvitedRegisteredSupplierModel> >(new OfferDefaults().GetSolidarityInvitedRegisteredSupplierModelQueryResult()));
            });

            var result = await _sut.GetSolidarityInvitedSuppliers(solidaritySearchCriteria);

            Assert.NotNull(result);
        }
コード例 #3
0
        public async Task Should_GetAllSuppliersBySearchCretriaForSolidarity()
        {
            SolidaritySearchCriteria solidaritySearchCriteria = new SolidaritySearchCriteria();

            solidaritySearchCriteria.CurrentSupplierCR = "1299659801";
            SupplierIntegrationSearchCriteria integrationSearchCriteria = new SupplierIntegrationSearchCriteria()
            {
                CrNumber = "1299659801"
            };

            _moqMapper.Setup(m => m.Map <SupplierIntegrationSearchCriteria>(It.IsAny <SolidaritySearchCriteria>()))
            .Returns(() => { return(integrationSearchCriteria); });
            _moqIidmService.Setup(s => s.GetSupplierDetailsBySearchCriteria(It.IsAny <SupplierIntegrationSearchCriteria>()))
            .Returns(() =>
            {
                return(Task.FromResult <QueryResult <SupplierIntegrationModel> >(new IDMDefaults().GetSupplierIntegrationModelQueryResult()));
            });

            var result = await _sut.GetAllSuppliersBySearchCretriaForSolidarity(solidaritySearchCriteria);

            Assert.NotNull(result);
        }
コード例 #4
0
 public async Task <QueryResult <SolidarityInvitedRegisteredSupplierModel> > GetSolidarityInvitedSuppliers(SolidaritySearchCriteria cretria)
 {
     return(await _context.OfferSolidarities.Include(s => s.Offer).ThenInclude(d => d.Supplier)
            .Where(x => x.OfferId == Util.Decrypt(cretria.offerIdString) &&
                   x.IsActive == true &&
                   x.SolidarityTypeId == (int)Enums.UnRegisteredSuppliersInvitationType.Existed)
            .SortBy(cretria.Sort, cretria.SortDirection).Select(i => new SolidarityInvitedRegisteredSupplierModel()
     {
         SolidarityIdString = Util.Encrypt(i.Id),
         CrName = ((OfferSolidarity)i).Supplier.SelectedCrName,
         CrNumber = ((OfferSolidarity)i).CRNumber,
         TenderId = i.Offer.TenderId,
         StatusId = i.StatusId,
         StatusName = i.SolidarityStatus.Name,
         OfferIdString = Util.Encrypt(i.OfferId)
     }).ToQueryResult(cretria.PageNumber, cretria.PageSize));
 }
コード例 #5
0
ファイル: SupplierService.cs プロジェクト: lulzzz/UITest-POC
        public async Task <QueryResult <SolidarityInvitedRegisteredSupplierModel> > GetAllSuppliersBySearchCretriaForSolidarity(SolidaritySearchCriteria cretria)
        {
            SupplierIntegrationSearchCriteria      integrationSearchCriteria = _mapper.Map <SupplierIntegrationSearchCriteria>(cretria);
            QueryResult <SupplierIntegrationModel> suppliers = await _iidmService.GetSupplierDetailsBySearchCriteria(integrationSearchCriteria);

            List <SolidarityInvitedRegisteredSupplierModel> suppliersInvitation = suppliers.Items.Where(d => d.supplierNumber != cretria.CurrentSupplierCR).Select(supplier => new SolidarityInvitedRegisteredSupplierModel()
            {
                CrName   = supplier.supplierName,
                CrNumber = supplier.supplierNumber,
            }).ToList();
            QueryResult <SolidarityInvitedRegisteredSupplierModel> suppliersList = suppliersInvitation != null ? new QueryResult <SolidarityInvitedRegisteredSupplierModel>(suppliersInvitation, suppliers.TotalCount, suppliers.PageNumber, suppliers.PageSize) : new QueryResult <SolidarityInvitedRegisteredSupplierModel>(new List <SolidarityInvitedRegisteredSupplierModel>(), 0, 1, 1);

            return(suppliersList);
        }
コード例 #6
0
ファイル: SupplierService.cs プロジェクト: lulzzz/UITest-POC
        public async Task <QueryResult <SolidarityInvitedRegisteredSupplierModel> > GetSolidarityInvitedSuppliers(SolidaritySearchCriteria cretria)
        {
            var suppliers = await _supplierQueries.GetSolidarityInvitedSuppliers(cretria);

            return(suppliers);
        }