コード例 #1
0
        public void op_Contains_string()
        {
            var obj = new SynonymCollection(NormalityComparer.Ordinal)
            {
                "Example"
            };

            Assert.False(obj.Contains("EXAMPLE"));
        }
コード例 #2
0
        public void op_Contains_string_whenOrdinalIgnoreCase()
        {
            var obj = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase)
            {
                "Example"
            };

            Assert.True(obj.Contains("EXAMPLE"));
        }
コード例 #3
0
        public void prop_Count()
        {
            var obj = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase);

            Assert.Equal(0, obj.Count);

            obj.Add("Example");

            Assert.Equal(1, obj.Count);
        }
コード例 #4
0
        public void op_Contains_string_whenOrdinal()
        {
            const string expected = "Example";

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

            Assert.True(obj.Contains(expected));
        }
コード例 #5
0
        public void op_Add_string_whenAlreadyExists()
        {
            const string synonym = "Example";
            var          obj     = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase)
            {
                synonym,
                synonym
            };

            Assert.Equal(1, obj.Count);
        }
コード例 #6
0
        public void op_Clear()
        {
            var obj = new SynonymCollection(NormalityComparer.OrdinalIgnoreCase)
            {
                "Example"
            };

            Assert.Equal(1, obj.Count);

            obj.Clear();

            Assert.Equal(0, obj.Count);
        }
コード例 #7
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);
            }
        }