private void UserBasicInfo_Gender()
        {
            var oldValuesMerged = HttpUtility.HtmlDecode(ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.gender.ToString()));
            var oldValues       = ParsingHelper.StringToList(oldValuesMerged, ',');

            var newValues = new HashSet <string>();

            if (this.newData.Gender != null)
            {
                switch (newData.Gender)
                {
                case "Male":
                    newValues.Add("M");
                    break;

                case "Female":
                    newValues.Add("F");
                    break;

                default:
                    newValues.Add("unknown");
                    break;
                }
            }

            this.CompareAndLog_Test(
                EnumTestUnitNames.UserBasicInfo_Gender,
                "Comparing Gender",
                oldValues,
                newValues);
        }
Exemplo n.º 2
0
        private void UserResearchCareInfo_Meshes()
        {
            var oldValuesMerged = HttpUtility.HtmlDecode(ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.mesh.ToString()));

            // data is originally in an HTML list
            oldValuesMerged = oldValuesMerged.Replace("</li><li>", ",");
            oldValuesMerged = oldValuesMerged.Replace("<ul><li>", "");
            oldValuesMerged = oldValuesMerged.Replace("</li></ul>", "");
            var oldValues = ParsingHelper.StringToList(oldValuesMerged, ',');

            var newValues = new HashSet <string>();

            if (newData != null && newData.Meshes != null && newData.Meshes.Count() > 0)
            {
                foreach (var entry in newData.Meshes)
                {
                    newValues.Add(entry.Keyword);
                }
            }

            this.CompareAndLog_Test(
                EnumTestUnitNames.UserResearchInfo_Meshes,
                "Comparing Research Meshes",
                oldValues,
                newValues);
        }
Exemplo n.º 3
0
        private void UserPatientCareInfo_IsSeeingPatientType()
        {
            var oldValuesMerged = HttpUtility.HtmlDecode(ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.patientsGroups.ToString()));
            var oldValues = ParsingHelper.StringToList(oldValuesMerged, ',');

            var newValues = new HashSet<string>();

            if (this.newDataPatientCare != null)
            {
                if (this.newDataPatientCare.IsSeeingAdults)
                {
                    newValues.Add("Adult");
                }
            }

            if (this.newDataPatientCare != null)
            {
                if (this.newDataPatientCare.IsSeeingChildren)
                {
                    newValues.Add("Child");
                }
            }

            if (this.newDataPatientCare != null)
            {
                if (this.newDataPatientCare.IsSeeingAdolescents)
                {
                    newValues.Add("Adolescent");
                }
            }

            if (this.newDataPatientCare != null)
            {
                if (this.newDataPatientCare.IsSeeingGeriatrics)
                {
                    newValues.Add("Geriatric");
                }
            }

            this.CompareAndLog_Test(
                EnumTestUnitNames.UserPatientCareInfo_IsSeeingPatientType, 
                "Comparing Patient Type(s)", 
                oldValues, 
                newValues);
        }
Exemplo n.º 4
0
        private void UserGeneralInfo_All_EduProfSuffixes()
        {
            string oldValuePart1 = ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.degree.ToString());
            string oldValuePart2 = ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.professionalSuffix.ToString());

            HashSet <string> oldValues = ParsingHelper.StringToList(oldValuePart1, ',');

            oldValues = ParsingHelper.StringToList(oldValuePart2, ',', oldValues);

            HashSet <string> oldValuesToExpectedNewValues = new HashSet <string>();

            foreach (var oldValue in oldValues)
            {
                // present old value as the value expected to be returned by the new service in order to pass the test: ticket #467
                var oldValueToExpectedNewValue = this.suffixMapping.Where(n => n.Key.ToUpper() == oldValue.Trim().ToUpper()).Select(n => n.Value);

                if (oldValueToExpectedNewValue != null && oldValueToExpectedNewValue.Count() > 0)
                {
                    oldValuesToExpectedNewValues.Add(oldValueToExpectedNewValue.First());
                }
                else
                {
                    // value not mapped
                    oldValuesToExpectedNewValues.Add(oldValue);
                }
            }

            HashSet <string> newValues = new HashSet <string>();

            try
            {
                if (newData.Titles.Count() > 0)
                {
                    foreach (var suffix in newData.Suffixes)
                    {
                        newValues.Add(HttpUtility.HtmlEncode(HttpUtility.HtmlDecode(suffix.Name)));
                    }
                }
            }
            catch (Exception) { }

            this.CompareAndLog_Test(EnumTestUnitNames.UserGeneralInfo_All_EduProfSuffixes, "Comparing list of Suffix(es)", oldValuesToExpectedNewValues, newValues);
        }
Exemplo n.º 5
0
        private void UserEducationTrainingInfo_CancersTreated()
        {
            var oldValuesMerged = ParsingHelper.ParseSingleValue(this.OldDataNodes, EnumOldServiceFieldsAsKeys.cancersTreated.ToString());
            var oldValues = ParsingHelper.StringToList(oldValuesMerged, ',');

            var newValues = new HashSet<string>();
            if (this.newDataPatientCare != null && this.newDataPatientCare.CancersTreated != null)
            {
                foreach (var newValueEntry in this.newDataPatientCare.CancersTreated)
                {
                    if (!string.IsNullOrEmpty(newValueEntry.Name))
                    {
                        newValues.Add(HttpUtility.HtmlEncode(HttpUtility.HtmlDecode(newValueEntry.Name)));
                    }
                }
            }

            this.CompareAndLog_Test(EnumTestUnitNames.UserPatientCareInfo_CancersTreated, "Comparing Cancer(s) Treated", oldValues, newValues);
        }