Esempio n. 1
0
        public void Given_PRSN_Expect_Person()
        {
            Glossary nsg = TestData.GetTestGlossary();

            nsg.TermConverterConfiguration.TermDelimeter = "|";
            nsg.TermConverterConfiguration.AbbreviationCaseConvention = CaseConvention.lowercase;

            string term                  = "Person|First|Name";
            string abbreviation          = "prsn_frst_nm";
            string convertedAbbreviation = nsg.AbbreviateTerm(term).Output;

            Assert.Equal(abbreviation, convertedAbbreviation);
        }
Esempio n. 2
0
        public void NoAbbreviationDelimeter_camelCase_Glossary()
        {
            Glossary nsg = TestData.GetTestGlossary();

            nsg.TermConverterConfiguration.AbbreviationDelimeter      = "";
            nsg.TermConverterConfiguration.AbbreviationCaseConvention = CaseConvention.camelCase;
            nsg.TermConverterConfiguration.DelimeterForNotFound_Left  = "";
            nsg.TermConverterConfiguration.DelimeterForNotFound_Right = "";

            string term                  = "Person First Name";
            string abbreviation          = "prsnFnm";
            string convertedAbbreviation = nsg.AbbreviateTerm(term).Output;

            Assert.Equal(abbreviation, convertedAbbreviation);
        }
Esempio n. 3
0
        public void NoAbbreviationDelimeter_camelCase_EmptyGlossary_ExclamationNotFound()
        {
            Glossary nsg = new Glossary();

            nsg.TermConverterConfiguration.AbbreviationDelimeter      = "";
            nsg.TermConverterConfiguration.AbbreviationCaseConvention = CaseConvention.camelCase;
            nsg.TermConverterConfiguration.DelimeterForNotFound_Left  = "!";
            nsg.TermConverterConfiguration.DelimeterForNotFound_Right = "!";

            string term                  = "Person First Name";
            string abbreviation          = "!person!!First!!Name!";
            string convertedAbbreviation = nsg.AbbreviateTerm(term).Output;

            Assert.Equal(abbreviation, convertedAbbreviation);
        }
Esempio n. 4
0
        public void Given_Hearing_OfficeCode_Expect_HRG_OCD()
        {
            //Arrange
            Glossary nsg = TestData.GetTestGlossary();

            nsg.TermConverterConfiguration.TreatHyphenAsTermDelimeter = true;

            //Act
            string abbreviation          = "HRG_OCD";
            string term                  = "Hearing-Office Code";
            string convertedabbreviation = nsg.AbbreviateTerm(term).Output;

            //Assert
            Assert.Equal(abbreviation, convertedabbreviation);
        }
Esempio n. 5
0
        public void Given_Hearing_Office_Code_Expect_HRG_OFC_CD()
        {
            //Arrange
            Glossary nsg = TestData.GetTestGlossary();

            nsg.TermConverterConfiguration.TreatHyphenAsTermDelimeter = true;

            //Act
            string abbreviatedTerm             = "HRG_OFC_CD";
            string term                        = "Hearing-Office-Code";
            TermConversionResult result        = nsg.AbbreviateTerm(term);
            string convertedAbbreviationResult = result.Output;

            //Assert
            Assert.Equal(abbreviatedTerm, convertedAbbreviationResult);
        }
Esempio n. 6
0
        public void HyphenDelimeter_BadInput_Output()
        {
            //Arrange
            Glossary nsg = TestData.GetTestGlossary();

            nsg.TermConverterConfiguration.AbbreviationDelimeter      = "-";
            nsg.TermConverterConfiguration.TermDelimeter              = "-";
            nsg.TermConverterConfiguration.AbbreviationCaseConvention = CaseConvention.lowercase;

            //Act
            string term                     = "nopenope-Office-Code";
            string abbreviatedTerm          = "<nopenope>-ofc-cd";
            string convertedAbbreviatedTerm = nsg.AbbreviateTerm(term).Output;

            //Assert
            Assert.Equal(abbreviatedTerm, convertedAbbreviatedTerm);
        }
Esempio n. 7
0
        public void no_delimter_camelCase()
        {
            //Arrange
            Glossary nsg = TestData.GetTestGlossary();

            nsg.TermConverterConfiguration.AbbreviationDelimeter      = "";
            nsg.TermConverterConfiguration.TermDelimeter              = "|";
            nsg.TermConverterConfiguration.AbbreviationCaseConvention = CaseConvention.camelCase;

            //Act
            string term                     = "Hearing|Office|Code";
            string abbreviatedTerm          = "hrgOfcCd";
            string convertedAbbreviatedTerm = nsg.AbbreviateTerm(term).Output;

            //Assert
            Assert.Equal(abbreviatedTerm, convertedAbbreviatedTerm);
        }