Пример #1
0
 public MqResult Cancellation(Credentials cr, Referral r)
 {
     try
     {
         TestReferral tr = TestReferral.BuildReferralFromDataBaseData(r.ReferralInfo.IdMq);
         tr.evInfo.cancellation = new TestCancellation(r.EventsInfo.Cancellation);
         MqResult x = client.Cancellation(cr, r);
         if (tr != TestReferral.BuildReferralFromDataBaseData(x.IdMq))
         {
             Global.errors1.Add("Несовпадение");
             Global.errors1.AddRange(Global.errors2);
         }
         return(x);
     }
     catch (System.ServiceModel.FaultException <MqTests.WebReference.MqFault[]> e)
     {
         getErrors(e.Detail);
         return(null);
     }
     catch (System.ServiceModel.FaultException <MqTests.WebReference.MqFault> e)
     {
         Global.errors1.Add(e.Detail.PropertyName + " - " + e.Detail.Message);
         return(null);
     }
 }
Пример #2
0
        public void MinCancellation()
        {
            using (MqServiceClient mq = new MqServiceClient())
            {
                Credentials cr = new Credentials {
                    Organization = idLpu, Token = guid
                };
                Referral referral = (new SetData()).MinRegister();
                var      result   = mq.Register(cr, referral);

                referral = (new SetData()).MinCancellation(result.IdMq);
                try
                {
                    var resultCancel = mq.Cancellation(cr, referral);
                }
                catch (FaultException <MqTests.WebReference.MqFault> e)
                {
                    string s = e.Detail.MqFaults[0].Message;
                }
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
Пример #3
0
        public void FullCancellation()
        {
            using (MqServiceClient mq = new MqServiceClient())
            {
                Credentials cr = new Credentials { Organization = idLpu, Token = guid };
                Referral referral = (new SetData()).MinRegister();

                var result = mq.Register(cr, referral);
                referral = (new SetData()).FullCancellation(result.IdMq);
                var resultCancel = mq.Cancellation(cr, referral);
            }
            if (Global.errors == "")
                Assert.Pass();
            else
                Assert.Fail(Global.errors);
        }
Пример #4
0
 public MqResult Cancellation(Credentials cr, Referral r)
 {
     try
     {
         TestReferral br = TestReferral.BuildReferralFromDataBaseData(r.ReferralInfo.IdMq);
         MqResult     x  = client.Cancellation(cr, r);
         br.UpdateTestReferral(r, cr.Organization);
         if (br != TestReferral.BuildReferralFromDataBaseData(x.IdMq))
         {
             Global.errors1.Add("Несовпадение");
             Global.errors1.AddRange(Global.errors2);
         }
         return(x);
     }
     catch (System.ServiceModel.FaultException <MqTests.WebReference.MqFault> e)
     {
         getErrors(e.Detail);
         Global.errors1.Add("ЭКСЕПШН");
         return(null);
     }
 }
Пример #5
0
        public void FullCancellation()
        {
            using (MqServiceClient mq = new MqServiceClient())
            {
                Credentials cr = new Credentials {
                    Organization = idLpu, Token = guid
                };
                Referral referral = (new SetData()).MinRegister();

                var result = mq.Register(cr, referral);
                referral = (new SetData()).FullCancellation(result.IdMq);
                var resultCancel = mq.Cancellation(cr, referral);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
Пример #6
0
        public void StatusCancellation_CurStat5()
        {
            using (MqServiceClient mq = new MqServiceClient())
            {
                //Задаём статус направления "Зарегистрировано в РЕГИЗ.УО"
                Referral    referral = (new SetData()).MinRegister();
                Credentials cr       = new Credentials {
                    Organization = idLpu, Token = guid
                };
                var result = mq.Register(cr, referral);

                //Задаём статус "Выдано пациенту"
                referral = (new SetData()).SetStatus_PatientDocumentIssue(result.IdMq);
                var res2 = mq.UpdateFromSourcedMo(cr, referral);

                //Задаём статус "Выделена единица ресурса, целевой МО назначена дата приема"
                referral = (new SetData()).MinChangePlannedResource(result.IdMq);
                var res3 = mq.ChangePlannedResource(cr, referral);

                //Задаём статус "Аннулировано"
                referral = (new SetData()).MinCancellation(result.IdMq);
                var res4 = mq.Cancellation(cr, referral);

                if (res4.MqReferralStatus.Code != "0")
                {
                    Global.errors1.Add("Неверный статус:" + res4.MqReferralStatus.Code + "");
                }
            }

            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
Пример #7
0
        public void MinCancellation()
        {
            using (MqServiceClient mq = new MqServiceClient())
            {
                Credentials cr = new Credentials { Organization = idLpu, Token = guid };
                Referral referral = (new SetData()).MinRegister();
                var result = mq.Register(cr, referral);

                referral = (new SetData()).MinCancellation(result.IdMq);
                try
                {
                    var resultCancel = mq.Cancellation(cr, referral);
                }
                catch (FaultException<MqTests.WebReference.MqFault> e)
                {
                    string s = e.Detail.MqFaults[0].Message;
                }
            }
            if (Global.errors == "")
                Assert.Pass();
            else
                Assert.Fail(Global.errors);
        }
Пример #8
0
        public void StatusCancellation_CurStat5()
        {
            using (MqServiceClient mq = new MqServiceClient())
            {
                //Задаём статус направления "Зарегистрировано в РЕГИЗ.УО"
                Referral referral = (new SetData()).MinRegister();
                Credentials cr = new Credentials { Organization = idLpu, Token = guid };
                var result = mq.Register(cr, referral);

                //Задаём статус "Выдано пациенту"
                referral = (new SetData()).SetStatus_PatientDocumentIssue(result.IdMq);
                var res2 = mq.UpdateFromSourcedMo(cr, referral);

                //Задаём статус "Выделена единица ресурса, целевой МО назначена дата приема"
                referral = (new SetData()).MinChangePlannedResource(result.IdMq);
                var res3 = mq.ChangePlannedResource(cr, referral);

                //Задаём статус "Аннулировано"
                referral = (new SetData()).MinCancellation(result.IdMq);
                var res4 = mq.Cancellation(cr, referral);

                if (res4.MqReferralStatus.Code != "0")
                    Global.errors1.Add("Неверный статус:" + res4.MqReferralStatus.Code + "");
            }

            if (Global.errors == "")
                Assert.Pass();
            else
                Assert.Fail(Global.errors);
        }