Пример #1
0
        /// <summary>
        /// Setup the HIServiceAPI mock and the response it will reply with
        /// </summary>
        /// <returns></returns>
        private IHiServiceApi GetMokIHiServiceApi()
        {
            //Mock<IHiServiceMessage> MokIHiServiceMessage = new Mock<IHiServiceMessage>();
            //MokIHiServiceMessage.Setup(x => x.Code).Returns("");
            //MokIHiServiceMessage.Setup(x => x.).Returns("");

            Moq.Mock <IIhiQueryMetadata> MokIIhiQueryMetadata = new Moq.Mock <IIhiQueryMetadata>();
            MokIIhiQueryMetadata.Setup(x => x.ErrorMessge).Returns(string.Empty);
            MokIIhiQueryMetadata.Setup(x => x.SoapRequest).Returns("SoapRequestData");
            MokIIhiQueryMetadata.Setup(x => x.SoapRequestMessageId).Returns($"{UrnUuidPrefix}{SoapRequestId}");
            MokIIhiQueryMetadata.Setup(x => x.SoapResponseMessageId).Returns($"{UrnUuidPrefix}{SoapResponseId}");
            MokIIhiQueryMetadata.Setup(x => x.SoapResponse).Returns("SoapResponseData");
            MokIIhiQueryMetadata.Setup(x => x.ServiceMessage).Returns(new List <IHiServiceMessage>());

            Moq.Mock <IIhiRequestData> MokIIhiRequestData = new Moq.Mock <IIhiRequestData>();
            MokIIhiRequestData.Setup(x => x.Dob).Returns(new DateTime(1973, 09, 30));
            MokIIhiRequestData.Setup(x => x.SexChar).Returns(HiPatientSexChar);
            MokIIhiRequestData.Setup(x => x.Family).Returns(HiPatientFamily);
            MokIIhiRequestData.Setup(x => x.Given).Returns(HiPatientGiven);
            MokIIhiRequestData.Setup(x => x.DVANumber).Returns(string.Empty);
            MokIIhiRequestData.Setup(x => x.MedicareNumber).Returns(HiPatientMedicareNumber);
            MokIIhiRequestData.Setup(x => x.IHINumber).Returns(HiPatientIHINumber);

            Moq.Mock <IIhiResponseData> MokIIhiResponseData = new Moq.Mock <IIhiResponseData>();
            MokIIhiResponseData.Setup(x => x.Dob).Returns(new DateTime(1973, 09, 30));
            MokIIhiResponseData.Setup(x => x.SexChar).Returns(HiPatientSexChar);
            MokIIhiResponseData.Setup(x => x.Family).Returns(HiPatientFamily);
            MokIIhiResponseData.Setup(x => x.Given).Returns(HiPatientGiven);
            MokIIhiResponseData.Setup(x => x.DVANumber).Returns(string.Empty);
            MokIIhiResponseData.Setup(x => x.MedicareNumber).Returns(HiPatientMedicareNumber);
            MokIIhiResponseData.Setup(x => x.IHINumber).Returns(HiPatientIHINumber);
            MokIIhiResponseData.Setup(x => x.IHIRecordStatus).Returns(HiPatientIHIRecordStatus);
            MokIIhiResponseData.Setup(x => x.IHIStatus).Returns(HiPatientIHIStatus);

            Moq.Mock <IIhiSearchValidateOutcome> MokIIhiSearchValidateOutcome = new Moq.Mock <IIhiSearchValidateOutcome>();
            MokIIhiSearchValidateOutcome.Setup(x => x.QueryMetadata).Returns(MokIIhiQueryMetadata.Object);
            MokIIhiSearchValidateOutcome.Setup(x => x.RequestData).Returns(MokIIhiRequestData.Object);
            MokIIhiSearchValidateOutcome.Setup(x => x.ResponseData).Returns(MokIIhiResponseData.Object);
            MokIIhiSearchValidateOutcome.Setup(x => x.SuccessfulQuery).Returns(true);

            Moq.Mock <IHiServiceApi> MokIHiServiceApi = new Moq.Mock <IHiServiceApi>();
            MokIHiServiceApi.SetReturnsDefault <IIhiSearchValidateOutcome>(MokIIhiSearchValidateOutcome.Object);

            return(MokIHiServiceApi.Object);
        }