Ejemplo n.º 1
0
        public void ToString_should_return_expected_result_when_tagSets_is_set(int[] tagSetSizes, string expectedTagSetsString)
        {
            var tagSets = new List <TagSet>();

            foreach (var size in tagSetSizes)
            {
                var tags = new List <Tag>();
                for (var i = 0; i < size; i++)
                {
                    var name  = new string((char)('x' + i), 1);
                    var value = new string((char)('a' + i), 1);
                    var tag   = new Tag(name, value);
                    tags.Add(tag);
                }
                var tagSet = new TagSet(tags);
                tagSets.Add(tagSet);
            }
            var subject = new ReadPreference(ReadPreferenceMode.Secondary, tagSets: tagSets);

            var result = subject.ToString();

            result.Should().Be($"{{ Mode : Secondary, TagSets : {expectedTagSetsString} }}");
        }
Ejemplo n.º 2
0
        public void Constructor_with_no_arguments_should_create_empty_tag_set()
        {
            var tagSet = new TagSet();

            tagSet.Tags.Count.Should().Be(0);
        }
Ejemplo n.º 3
0
        public void Equals_should_return_false_if_rhs_is_not_a_TagSet()
        {
            var tagSet1 = new TagSet(new[] { new Tag("name", "value") });

            tagSet1.Equals((object)"abc").Should().BeFalse();
        }