public void ExtractPhenotypeAndComments_AsExpected(string input, string expectedPhenotype, string commentsEnumString) { (string phenotype, var comments) = OmimUtilities.ExtractPhenotypeAndComments(input); var expectedComments = commentsEnumString.Split(',').Select(x => (OmimItem.Comment) byte.Parse(x)).Where(x => x != OmimItem.Comment.unknown).ToArray(); Assert.Equal(expectedPhenotype, phenotype); Assert.Equal(expectedComments, comments); }
public void ExtractAndProcessItemDescription_AsExpected() { const string textSectionJson = "{\"textSection\":{\"textSectionName\": \"description\",\"textSectionTitle\": \"Description\",\"textSectionContent\": \"Constitutional mismatch repair deficiency is a rare childhood cancer predisposition syndrome with 4 main tumor types: hematologic malignancies, brain/central nervous system tumors, colorectal tumors and multiple intestinal polyps, and other malignancies including embryonic tumors and rhabdomyosarcoma. Many patients show signs reminiscent of neurofibromatosis type I (NF1; {162200}), particularly multiple cafe-au-lait macules (summary by {2:Baas et al., 2013}).\n\n'Turcot syndrome' classically refers to the combination of colorectal polyposis and primary tumors of the central nervous system ({13:Hamilton et al., 1995}).\"}}"; var textSection = JsonConvert.DeserializeObject <TextSection>(textSectionJson); var entryItem = new EntryItem { textSectionList = new [] { textSection } }; var description = OmimUtilities.ExtractAndProcessItemDescription(entryItem); const string expected = "Constitutional mismatch repair deficiency is a rare childhood cancer predisposition syndrome with 4 main tumor types: hematologic malignancies, brain/central nervous system tumors, colorectal tumors and multiple intestinal polyps, and other malignancies including embryonic tumors and rhabdomyosarcoma. Many patients show signs reminiscent of neurofibromatosis type I (NF1), particularly multiple cafe-au-lait macules (summary by Baas et al., 2013).\n\n'Turcot syndrome' classically refers to the combination of colorectal polyposis and primary tumors of the central nervous system (Hamilton et al., 1995)."; Assert.Equal(expected, description); }
public void ExtractPhenotypeAndComments_AsExpected(string input, string phenotype) { Assert.Equal(phenotype, OmimUtilities.ExtractPhenotypeAndComments(input).Phenotype); }
public void RemoveLinksInText_AsExpected(string input, string output) { Assert.Equal(output, OmimUtilities.RemoveLinksInText(input)); }