Exemplo n.º 1
0
        public void FullTest2()
        {
            Glossary g = new Glossary();

            g.AddGlossaryItem(new GlossaryItem("Person", "PRSN", true));
            g.AddGlossaryItem(new GlossaryItem("First Name", "FNM", true));

            string logicalName  = "Person First Name";
            string physicalName = "PRSN_FNM";

            GlossaryComplianceResult result = g.CheckCompliance(logicalName, physicalName);

            Console.WriteLine(g.ExpandAbbreviation("PRSN_FNM").Output);
            Assert.Equal(result.Term, logicalName);
            Assert.Equal(result.Abbreviation, physicalName);
            Assert.Equal(logicalName, result.AbbreviationToTerm);
            Assert.Equal(physicalName, result.TermToAbbreviation);
            Assert.Equal(result.TermToAbbreviation, result.AbbreviationToTermToAbbreviation);
            Assert.Equal(result.AbbreviationToTerm, result.TermToAbbreviationToTerm);
            Assert.True(result.PreferredTermIsUsed);
            Assert.False(result.CompoundAvailable);
            Assert.False(result.Mismatch);
            Assert.False(result.HyphenNeededForTerm);
            Assert.True(result.TermAbbreviatesCorrectly);
            Assert.True(result.AbbreviationExpandsToTermCorrectly);
            Assert.True(result.EvaluationTimeSpan.TotalMilliseconds > 0);
        }
Exemplo n.º 2
0
        public void RunRuleAgainstObject_Column_ClassWord()
        {
            Glossary  nsg          = TestData.GetTestGlossary();
            DataTable dt           = new DataTable();
            string    logicalName  = "Hearing Office Code";
            string    physicalName = "HOFC";

            GlossaryComplianceResult nsResult = nsg.CheckCompliance(logicalName, physicalName);
        }
Exemplo n.º 3
0
        public void RunRuleAgainstObject_Column_HyphenNeeded()
        {
            Glossary  nsg          = TestData.GetTestGlossary();
            DataTable dt           = new DataTable();
            string    logicalName  = "Hearing Office";
            string    physicalName = "HRG_OFC";

            GlossaryComplianceResult nsResult = nsg.CheckCompliance(logicalName, physicalName);

            Assert.Empty(nsResult.TermToAbbreviationResult.NodesNotFound);
            Assert.Empty(nsResult.AbbreviationToTermResult.NodesNotFound);
            Assert.Equal(2, nsResult.AbbreviationToTermResult.NodesFound.Count);
            Assert.Single(nsResult.TermToAbbreviationResult.NodesFound);
            Assert.True(nsResult.CompoundAvailable);
            Assert.True(nsResult.HyphenNeededForTerm);
        }
Exemplo n.º 4
0
        public void RunRuleAgainstObject_Column_NoClassWord()
        {
            Glossary  nsg          = TestData.GetTestGlossary();
            DataTable dt           = new DataTable();
            string    logicalName  = "Hearing Office Donkey Monkey";
            string    physicalName = "HOFC";

            GlossaryComplianceResult nsResult = nsg.CheckCompliance(logicalName, physicalName);

            Assert.Equal(2, nsResult.TermToAbbreviationResult.NodesNotFound.Count);
            Assert.Empty(nsResult.AbbreviationToTermResult.NodesNotFound);
            Assert.Single(nsResult.AbbreviationToTermResult.NodesFound);
            Assert.Single(nsResult.TermToAbbreviationResult.NodesFound);
            Assert.False(nsResult.CompoundAvailable);
            Assert.False(nsResult.HyphenNeededForTerm);
            Assert.False(nsResult.TermAbbreviatesCorrectly);
            Assert.False(nsResult.AbbreviationExpandsToTermCorrectly);
        }
Exemplo n.º 5
0
        public void ReadMeExample2()
        {
            Glossary g = new Glossary();

            g.AddGlossaryItem(new GlossaryItem("Person", "PRSN", true));
            g.AddGlossaryItem(new GlossaryItem("First Name", "FNM", true));

            string term         = "Person First name";
            string abbreviation = "PRSN_FNM";

            GlossaryComplianceResult result = g.CheckCompliance(term, abbreviation);

            Console.WriteLine(result.PreferredTermIsUsed);
            //true

            Console.WriteLine(result.TermAbbreviatesCorrectly);
            //true

            Console.WriteLine(result.AbbreviationExpandsToTermCorrectly);
            //true
        }
Exemplo n.º 6
0
        public void FullTest()
        {
            Glossary g = TestData.GetTestGlossary();

            string term         = "Hearing Office Code";
            string abbreviation = "HOCD";

            GlossaryComplianceResult result = g.CheckCompliance(term, abbreviation);

            Assert.Equal(result.Term, term);
            Assert.Equal(result.Abbreviation, abbreviation);
            Assert.Equal(term, result.AbbreviationToTerm);
            Assert.Equal(abbreviation, result.TermToAbbreviation);
            Assert.Equal(result.TermToAbbreviation, result.AbbreviationToTermToAbbreviation);
            Assert.Equal(result.AbbreviationToTerm, result.TermToAbbreviationToTerm);
            Assert.True(result.PreferredTermIsUsed);
            Assert.False(result.CompoundAvailable);
            Assert.False(result.Mismatch);
            Assert.False(result.HyphenNeededForTerm);
            Assert.True(result.TermAbbreviatesCorrectly);
            Assert.True(result.AbbreviationExpandsToTermCorrectly);
            Assert.True(result.EvaluationTimeSpan.TotalMilliseconds > 0);
        }