Exemplo n.º 1
0
 public void Adding_tags_should_add_to_existing_tags()
 {
     Test test = new Test("test");
     List<string> tags = new List<string> { "tagged", "another" };
     tags.ForEach(x => test.AddTags(x));
     tags.ForEach(tag => test.GetTags().AllTags.Contains(tag));
 }
Exemplo n.º 2
0
 private void readFromChildNode(INode node, Test test)
 {
     if (node.IsComment())
     {
         test.AddComment(node.InnerText);
     }
     else if (node.IsTags())
     {
         test.AddTags(node.InnerText);
     }
     else
     {
         Section section = ReadSection(node);
         test.Add(section);
     }
 }
Exemplo n.º 3
0
        public void the_filter_should_match_tests_with_multiple_tags()
        {
            Test testing = new Test("testing");
            testing.AddTags("testing");
            Test tag = new Test("tagged");
            tag.AddTags("tag");

            filter.Tags = "tag, testing";

            filter.Matches(testing).ShouldBeTrue();
            filter.Matches(tag).ShouldBeTrue();
        }
Exemplo n.º 4
0
        public void the_filter_should_match_tests_with_matching_tags()
        {
            Test noTags = new Test("noTags");
            Test tagged = new Test("tagged");
            tagged.AddTags("tag");

            filter.Tags = "tag";

            filter.Matches(noTags).ShouldBeFalse();
            filter.Matches(tagged).ShouldBeTrue();
        }
Exemplo n.º 5
0
        public void the_filter_should_match_no_tests_when_using_tags_that_are_not_used()
        {
            Test noTags = new Test("noTags");
            Test tagged = new Test("tagged");
            tagged.AddTags("tag");

            filter.Tags = "nothing";

            filter.Matches(noTags).ShouldBeFalse();
            filter.Matches(tagged).ShouldBeFalse();
        }
Exemplo n.º 6
0
        public void the_filter_should_match_all_tests_when_no_tags_are_applied()
        {
            Test noTags = new Test("noTags");
            Test tagged = new Test("tagged");
            tagged.AddTags("tag");

            filter.Matches(noTags).ShouldBeTrue();
            filter.Matches(tagged).ShouldBeTrue();
        }