public void Contains_Tag_ReturnsFalseIfCollectionDoesNotContainTag()
        {
            TagsCollection target = new TagsCollection(_tags);

            Tag testTag = new Tag("test-key-1", "other-value");

            Assert.False(target.Contains(testTag));
        }
Exemple #2
0
 /// <summary>
 /// Compares two tags collections.
 /// </summary>
 /// <param name="reference"></param>
 /// <param name="collection"></param>
 private void CompareTagsCollections(TagsCollection reference, TagsCollection collection)
 {
     Assert.AreEqual(reference.Count, collection.Count);
     foreach (Tag tag in reference)
     {
         Assert.IsTrue(collection.Contains(tag));
     }
 }
        private void CompareTags(TagsCollection expected, TagsCollection actual)
        {
            if (expected == null && actual == null)
            {
                return;
            }

            Assert.Equal(expected.Count, actual.Count);
            Assert.True(expected.All(tag => actual.Contains(tag)));
        }
        private void CompareTags(TagsCollection expected, TagsCollection actual)
        {
            if (expected == null && actual == null) {
                return;
            }

            Assert.Equal(expected.Count, actual.Count);
            Assert.True(expected.All(tag => actual.Contains(tag)));
        }
        public void Contains_string_ReturnsFalseIfCollectionDoesNotContainTag()
        {
            TagsCollection target = new TagsCollection(_tags);

            Assert.False(target.Contains("non-existing-key"));
        }
        public void Contains_string_ReturnsFalseForEmptyCollection()
        {
            TagsCollection target = new TagsCollection();

            Assert.False(target.Contains("key"));
        }
        public void Contains_Tag_ReturnsTrueIfCollectionContainsTag()
        {
            TagsCollection target = new TagsCollection(_tags);

            Assert.True(target.Contains(_tags[0]));
        }
        public void Contains_Tag_ReturnsFalseIfCollectionDoesNotContainTag()
        {
            TagsCollection target = new TagsCollection(_tags);

            Tag testTag = new Tag("test-key-1", "other-value");
            Assert.False(target.Contains(testTag));
        }
        public void Contains_Tag_ReturnsFalseForEmptyCollection()
        {
            TagsCollection target = new TagsCollection();

            Assert.False(target.Contains(new Tag("key", "value")));
        }
        public void Contains_string_ReturnsTrueIfCollectionContainsTag()
        {
            TagsCollection target = new TagsCollection(_tags);

            Assert.True(target.Contains(_tags[0].Key));
        }
        public void Contains_string_ReturnsFalseIfCollectionDoesNotContainTag()
        {
            TagsCollection target = new TagsCollection(_tags);

            Assert.False(target.Contains("non-existing-key"));
        }
        public void Contains_string_ReturnsFalseForEmptyCollection()
        {
            TagsCollection target = new TagsCollection();

            Assert.False(target.Contains("key"));
        }
        public void Contains_Tag_ReturnsFalseForEmptyCollection()
        {
            TagsCollection target = new TagsCollection();

            Assert.False(target.Contains(new Tag("key", "value")));
        }