Ejemplo n.º 1
0
        public List <AgencyCommunicationRequest> GetAgencyCommunicationRequests()
        {
            Tender tender = new TenderDefault().GetGeneralTender();
            List <AgencyCommunicationRequest> generalAgencyCommunicationRequests = new List <AgencyCommunicationRequest>();
            var communicationRequest = new AgencyCommunicationRequest(agencyRequestId, tenderId, agencyRequestTypeId, statusId, requestedByRoleName);

            communicationRequest.AddTender(tender);
            communicationRequest.UpdatePlaintAgencyCommunicationRequest(1, "no");
            communicationRequest.UpdateAgencyCommunicationRequestStatus(1, "");
            communicationRequest.UpdateAgencyCommunicationPlaintRequestStatus(1, 1, null, "", "");
            AgencyCommunicationPlaintStatus PlaintAcceptanceStatus = new AgencyCommunicationPlaintStatus();

            typeof(AgencyCommunicationPlaintStatus).GetProperty(nameof(AgencyCommunicationPlaintStatus.Name)).SetValue(PlaintAcceptanceStatus, "name");

            typeof(AgencyCommunicationRequest).GetProperty(nameof(AgencyCommunicationRequest.PlaintAcceptanceStatus)).SetValue(communicationRequest, PlaintAcceptanceStatus);
            communicationRequest.Negotiations = new List <Negotiation>();
            generalAgencyCommunicationRequests.Add(communicationRequest);

            var communicationRequest2 = new AgencyCommunicationRequest(2, 2, agencyRequestTypeId, statusId, requestedByRoleName);

            communicationRequest2.AddTender(tender);
            communicationRequest2.Negotiations = new List <Negotiation>();
            generalAgencyCommunicationRequests.Add(communicationRequest2);
            return(generalAgencyCommunicationRequests);
        }
        public void Should_ApprovePlaintAgencyCommunicationRequest()
        {
            AgencyCommunicationRequest communicationRequest = new AgencyCommunicationRequest();

            communicationRequest.UpdatePlaintAgencyCommunicationRequest((int)Enums.AgencyCommunicationRequestStatus.Approved, REJECTION_REASON);
            communicationRequest.ShouldNotBeNull();
            communicationRequest.StatusId.ShouldBe((int)Enums.AgencyCommunicationRequestStatus.Approved);
            communicationRequest.RejectionReason.ShouldBe(REJECTION_REASON);
        }
        public void Should_UpdatePlaintAgencyCommunicationRequest()
        {
            var attachments = new List <CommunicationAttachmentModel>();

            attachments.Add(new CommunicationAttachmentModel()
            {
                FileNetReferenceId = "id", Name = "Name", AttachmentTypeId = (int)Enums.AttachmentType.PlainRequest
            });

            AgencyCommunicationRequest communicationRequest = new AgencyCommunicationRequest();

            communicationRequest.UpdatePlaintAgencyCommunicationRequest(CommunicationRequestId, Util.Encrypt(1), 1, Util.Encrypt(1), PlaintReason, attachments);
            communicationRequest.ShouldNotBeNull();
            communicationRequest.PlaintAcceptanceStatusId.ShouldBe((int)Enums.AgencyPlaintStatus.New);
            communicationRequest.AgencyRequestTypeId.ShouldBe((int)Enums.AgencyCommunicationRequestType.Plaint);
            communicationRequest.StatusId.ShouldBe((int)Enums.AgencyCommunicationRequestStatus.RequestSent);
        }