示例#1
0
        public void Should_Update()
        {
            var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest();

            supplierExtendOfferDatesRequest.Update();
            supplierExtendOfferDatesRequest.State.ShouldBe(SharedKernal.ObjectState.Modified);
        }
示例#2
0
        public void Should_Delete()
        {
            var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest();

            supplierExtendOfferDatesRequest.Delete();
            supplierExtendOfferDatesRequest.State.ShouldBe(SharedKernal.ObjectState.Deleted);
        }
示例#3
0
        public void Should_SetActive()
        {
            var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest();

            supplierExtendOfferDatesRequest.SetActive();
            supplierExtendOfferDatesRequest.IsActive.ShouldBe(true);
            supplierExtendOfferDatesRequest.State.ShouldBe(SharedKernal.ObjectState.Modified);
        }
示例#4
0
        public void Should_Constructor_SetValues()
        {
            var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest(_extendOfferDatesReason, _extendOfferDatesRequestedDate, _agencyCommunicationRequestId, _cr, _supplierExtendOfferDatesRequestId);

            supplierExtendOfferDatesRequest.ShouldNotBeNull();
            supplierExtendOfferDatesRequest.State.ShouldBe(SharedKernal.ObjectState.Added);
            supplierExtendOfferDatesRequest.ExtendOfferDatesRequestReason.ShouldBe(_extendOfferDatesReason);
            supplierExtendOfferDatesRequest.ExtendOfferDatesRequestedDate.ShouldBe(_extendOfferDatesRequestedDate);
            supplierExtendOfferDatesRequest.AgencyCommunicationRequestId.ShouldBe(_agencyCommunicationRequestId);
            supplierExtendOfferDatesRequest.CR.ShouldBe(_cr);
        }
示例#5
0
        public async Task IsValidToCreateRequest(SupplierExtendOfferDatesRequest supplierExtendOfferDatesRequest, DateTime requestedDate, Tender tender)
        {
            if (supplierExtendOfferDatesRequest != null)
            {
                throw new BusinessRuleException("عفوا لا يمكن اضافة اكثر من طلب");
            }

            if (requestedDate <= DateTime.Now || requestedDate.Date <= tender.LastOfferPresentationDate.Value.Date)
            {
                throw new BusinessRuleException(Resources.TenderResources.ErrorMessages.TenderOfferCannotBeTodayOrLessThanOffer);
            }
        }
示例#6
0
        public async Task <SupplierExtendOfferDatesRequest> CreateSupplierExtendOfferDatesRequestAsync(SupplierExtendOfferDatesRequest supplierExtendOfferDatesRequest)
        {
            await _context.SupplierExtendOfferDatesRequests.AddAsync(supplierExtendOfferDatesRequest);

            await _context.SaveChangesAsync();

            return(supplierExtendOfferDatesRequest);
        }
示例#7
0
        public void Should_Empty_Construct_SupplierExtendOfferDatesRequest()
        {
            var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest();

            supplierExtendOfferDatesRequest.ShouldNotBeNull();
        }