コード例 #1
0
            public void Get_Valid_Response_Test()
            {
                IAuditUtil           audit = new StubAuditUtil();
                INGManager           ngm   = new StubNGManager();
                ISecurityManager     sm    = new StubSecurityManager();
                ICommonFormatterUtil cf    = new StubCommonFormatterUtil();

                NGService ngs = new NGService
                {
                    AuditUtil           = audit,
                    NGManager           = ngm,
                    Security            = sm,
                    CommonFormatterUtil = cf
                };
                GetPatientProgramDetailsSummaryRequest request = new GetPatientProgramDetailsSummaryRequest
                {
                    ContractNumber = "NG",
                    PatientId      = "",
                    Token          = "dsafgsdfgdafg",
                    UserId         = "",
                    Version        = 1.0
                };
                GetPatientProgramDetailsSummaryResponse response = ngs.Get(request);

                Assert.IsNotNull(response);
            }
コード例 #2
0
            public void Get_AssignById_Test()
            {
                IAuditUtil           audit = new StubAuditUtil();
                INGManager           ngm   = new StubNGManager();
                ISecurityManager     sm    = new StubSecurityManager();
                ICommonFormatterUtil cf    = new StubCommonFormatterUtil();
                string userid = "000000000000000000000000";

                NGService ngs = new NGService
                {
                    AuditUtil           = audit,
                    NGManager           = ngm,
                    Security            = sm,
                    CommonFormatterUtil = cf
                };
                GetPatientProgramDetailsSummaryRequest request = new GetPatientProgramDetailsSummaryRequest
                {
                    ContractNumber = "NG",
                    PatientId      = "",
                    Token          = "dsafgsdfgdafg",
                    UserId         = userid,
                    Version        = 1.0
                };

                GetPatientProgramDetailsSummaryResponse response = ngs.Get(request);
                string result = response.Program.AssignById;

                Assert.AreEqual(userid, result);
            }
コード例 #3
0
            public void Post()
            {
                IAuditUtil           audit = new StubAuditUtil();
                INGManager           ngm   = new StubNGManager();
                ISecurityManager     sm    = new StubSecurityManager();
                ICommonFormatterUtil cf    = new StubCommonFormatterUtil();

                NGService ngs = new NGService
                {
                    AuditUtil           = audit,
                    NGManager           = ngm,
                    Security            = sm,
                    CommonFormatterUtil = cf
                };

                PostProgramAttributesChangeRequest request = new PostProgramAttributesChangeRequest
                {
                    ContractNumber = "NG",
                    PatientId      = "",
                    Token          = "dsafgsdfgdafg",
                    UserId         = "",
                    Version        = 1.0
                };

                PostProgramAttributesChangeResponse response = ngs.Post(request);

                Assert.IsNotNull(response);
            }
コード例 #4
0
            public void AD_Get_With_Module_Description_Test()
            {
                string               desc  = "BSHSI - Outreach & Enrollment";
                IAuditUtil           audit = new StubAuditUtil();
                INGManager           ngm   = new StubNGManager();
                ISecurityManager     sm    = new StubSecurityManager();
                ICommonFormatterUtil cf    = new StubCommonFormatterUtil();

                NGService ngs = new NGService
                {
                    AuditUtil           = audit,
                    NGManager           = ngm,
                    Security            = sm,
                    CommonFormatterUtil = cf
                };
                GetPatientProgramDetailsSummaryRequest request = new GetPatientProgramDetailsSummaryRequest
                {
                    ContractNumber = "NG",
                    PatientId      = "",
                    Token          = "dsafgsdfgdafg",
                    UserId         = "",
                    Version        = 1.0
                };
                GetPatientProgramDetailsSummaryResponse response = ngs.Get(request);

                Module module = response.Program.Modules.Find(m => m.SourceId == "532b5585a381168abe00042c");
                string mDesc  = module.Description.Trim();

                Assert.AreEqual(desc, mDesc, true);
            }
コード例 #5
0
            public void Get_StateChangeDate_Test()
            {
                IAuditUtil           audit = new StubAuditUtil();
                INGManager           ngm   = new StubNGManager();
                ISecurityManager     sm    = new StubSecurityManager();
                ICommonFormatterUtil cf    = new StubCommonFormatterUtil();
                string   userid            = "000000000000000000000000";
                DateTime now = System.DateTime.UtcNow.Date;

                NGService ngs = new NGService
                {
                    AuditUtil           = audit,
                    NGManager           = ngm,
                    Security            = sm,
                    CommonFormatterUtil = cf
                };
                GetPatientProgramDetailsSummaryRequest request = new GetPatientProgramDetailsSummaryRequest
                {
                    ContractNumber = "NG",
                    PatientId      = "",
                    Token          = "dsafgsdfgdafg",
                    UserId         = userid,
                    Version        = 1.0
                };

                GetPatientProgramDetailsSummaryResponse response = ngs.Get(request);
                DateTime statechangedate = ((DateTime)response.Program.StateUpdatedOn).Date;

                Assert.AreEqual(now, statechangedate);
            }
コード例 #6
0
ファイル: LookUps_Test.cs プロジェクト: rotovibe/engage
        public void GetObjectives()
        {
            // Arrange
            StubNGManager           ngManager = new StubNGManager();
            GetAllObjectivesRequest request   = new GetAllObjectivesRequest
            {
                ContractNumber = _contractNumber,
                Token          = _token,
                Version        = _version,
            };
            // Act
            List <ObjectivesLookUp> response = ngManager.GetAllObjectives(request);

            //Assert
            Assert.IsTrue(response.Count > 0);
        }
コード例 #7
0
ファイル: Contact_Test.cs プロジェクト: rotovibe/engage
        public void GetRecentPatients_Limit_Test()
        {
            INGManager ngm = new StubNGManager(); // { PlanElementUtils = new StubPlanElementUtils(), EndPointUtils = new StubPlanElementEndpointUtils() };

            GetRecentPatientsRequest request = new GetRecentPatientsRequest
            {
                Version        = version,
                ContractNumber = contractNumber,
                UserId         = userId,
                Context        = context,
                ContactId      = contactId
            };

            GetRecentPatientsResponse response = ngm.GetRecentPatients(request);

            Assert.IsTrue(response.Limit >= response.Patients.Count);
        }
コード例 #8
0
ファイル: Contact_Test.cs プロジェクト: rotovibe/engage
        public void GetRecentPatientsForAContact_Test()
        {
            INGManager ngm = new StubNGManager(); // { PlanElementUtils = new StubPlanElementUtils(), EndPointUtils = new StubPlanElementEndpointUtils() };

            GetRecentPatientsRequest request = new GetRecentPatientsRequest
            {
                Version        = version,
                ContractNumber = contractNumber,
                UserId         = userId,
                Context        = context,
                ContactId      = contactId
            };

            GetRecentPatientsResponse response = ngm.GetRecentPatients(request);

            Assert.AreEqual(response.ContactId, request.ContactId);
        }
コード例 #9
0
        public void InsertContact_ShouldNotReturnNull_Test()
        {
            InsertContactRequest request = new InsertContactRequest()
            {
                ContractNumber = "InHealth001",
                UserId         = "5325c821072ef705080d3488",
                Token          = ObjectId.GenerateNewId().ToString(),
                Version        = 1.0,
                Contact        = new Contact()
                {
                    FirstName = "Carl",
                    LastName  = "Lewis",
                }
            };
            INGManager ngManager = new StubNGManager();
            var        response  = ngManager.InsertContact(request);

            Assert.IsNotNull(response);
        }
コード例 #10
0
        private INGManager GetNGManager()
        {
            INGManager ngManager = new StubNGManager();

            return(ngManager);
        }