예제 #1
0
 public LexicalItem(INormalityComparer comparer,
                    string canonicalForm)
     : this()
 {
     Comparer      = comparer;
     Synonyms      = new SynonymCollection(comparer);
     CanonicalForm = canonicalForm;
 }
예제 #2
0
 public LexicalItem(INormalityComparer comparer,
                    string canonicalForm)
     : this()
 {
     Comparer = comparer;
     Synonyms = new SynonymCollection(comparer);
     CanonicalForm = canonicalForm;
 }
예제 #3
0
        public void op_Contains_string()
        {
            var obj = new SynonymCollection(NormalityComparer.Ordinal)
                          {
                              "Example"
                          };

            Assert.False(obj.Contains("EXAMPLE"));
        }
예제 #4
0
        public void op_Add_string_whenAlreadyExists()
        {
            const string synonym = "Example";
            var obj = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase)
                          {
                              synonym,
                              synonym
                          };

            Assert.Equal(1, obj.Count);
        }
예제 #5
0
        public void op_Clear()
        {
            var obj = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase)
                          {
                              "Example"
                          };

            Assert.Equal(1, obj.Count);

            obj.Clear();

            Assert.Equal(0, obj.Count);
        }
 private void OnListSynonyms(SynonymCollection response, Dictionary <string, object> customData)
 {
     Log.Debug("ExampleAssistant.OnListSynonyms()", "Response: {0}", customData["json"].ToString());
     _listSynonymsTested = true;
 }
예제 #7
0
        public void op_Contains_string_whenOrdinalIgnoreCase()
        {
            var obj = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase)
                          {
                              "Example"
                          };

            Assert.True(obj.Contains("EXAMPLE"));
        }
예제 #8
0
        public void op_Contains_string_whenOrdinal()
        {
            const string expected = "Example";

            var obj = new SynonymCollection(NormalityComparer.Ordinal)
                          {
                              expected
                          };

            Assert.True(obj.Contains(expected));
        }
예제 #9
0
        public void prop_Count()
        {
            var obj = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase);

            Assert.Equal(0, obj.Count);

            obj.Add("Example");

            Assert.Equal(1, obj.Count);
        }
예제 #10
0
        public void op_GetEnumerator()
        {
            const string expected = "Example";

            var obj = new SynonymCollection(NormalityComparer.Ordinal)
                          {
                              expected
                          };

            foreach (var actual in obj)
            {
                Assert.Equal(expected, actual);
            }
        }