public void Should_Update() { var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest(); supplierExtendOfferDatesRequest.Update(); supplierExtendOfferDatesRequest.State.ShouldBe(SharedKernal.ObjectState.Modified); }
public void Should_Delete() { var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest(); supplierExtendOfferDatesRequest.Delete(); supplierExtendOfferDatesRequest.State.ShouldBe(SharedKernal.ObjectState.Deleted); }
public void Should_SetActive() { var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest(); supplierExtendOfferDatesRequest.SetActive(); supplierExtendOfferDatesRequest.IsActive.ShouldBe(true); supplierExtendOfferDatesRequest.State.ShouldBe(SharedKernal.ObjectState.Modified); }
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); }
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); } }
public async Task <SupplierExtendOfferDatesRequest> CreateSupplierExtendOfferDatesRequestAsync(SupplierExtendOfferDatesRequest supplierExtendOfferDatesRequest) { await _context.SupplierExtendOfferDatesRequests.AddAsync(supplierExtendOfferDatesRequest); await _context.SaveChangesAsync(); return(supplierExtendOfferDatesRequest); }
public void Should_Empty_Construct_SupplierExtendOfferDatesRequest() { var supplierExtendOfferDatesRequest = new SupplierExtendOfferDatesRequest(); supplierExtendOfferDatesRequest.ShouldNotBeNull(); }