<commit_before>﻿using System.Linq;
using DataGen.Types.String;
using NUnit.Framework;

namespace Tests {
    [TestFixture]
    public class StringFilterTests {
        [Test]
        public void StringFilter_Contains_OneArg() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "foo", "foobar", "barfoo" };
            var result = new StringFilter(strings).Contains("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_Contains_TwoArgs() {
            string[] strings = { "bar", "foo", "foobar", "barfoo", "johnny", "doe" };
            string[] expected = { "foo", "foobar", "barfoo", "bar" };
            var result = new StringFilter(strings).Contains("foo", "bar");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_Contains_ThreeArgs() {
            string[] strings = { "bar", "foo", "foobar", "barfoo", "johnny", "doe" };
            string[] expected = { "foo", "foobar", "barfoo", "bar", "johnny" };
            var result = new StringFilter(strings).Contains("foo", "bar", "john");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_Contains_FourArgs() {
            string[] strings = { "bar", "foo", "foobar", "barfoo", "johnny", "doe" };
            string[] expected = { "foo", "foobar", "barfoo", "bar", "johnny", "doe" };
            var result = new StringFilter(strings).Contains("foo", "bar", "john", "do");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_DoesNotContain() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "bar" };
            var result = new StringFilter(strings).DoesNotContain("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_StartsWith() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "foo", "foobar" };
            var result = new StringFilter(strings).StartsWith("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_DoesNotStartWith() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "bar", "barfoo" };
            var result = new StringFilter(strings).DoesNotStartWith("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }
    }
}<commit_msg>added region<commit_after>﻿using System.Linq;
using DataGen.Types.String;
using NUnit.Framework;

namespace Tests {
    [TestFixture]
    public class StringFilterTests {
        #region Contains

        [Test]
        public void StringFilter_Contains_OneArg() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "foo", "foobar", "barfoo" };
            var result = new StringFilter(strings).Contains("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_Contains_TwoArgs() {
            string[] strings = { "bar", "foo", "foobar", "barfoo", "johnny", "doe" };
            string[] expected = { "foo", "foobar", "barfoo", "bar" };
            var result = new StringFilter(strings).Contains("foo", "bar");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_Contains_ThreeArgs() {
            string[] strings = { "bar", "foo", "foobar", "barfoo", "johnny", "doe" };
            string[] expected = { "foo", "foobar", "barfoo", "bar", "johnny" };
            var result = new StringFilter(strings).Contains("foo", "bar", "john");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_Contains_FourArgs() {
            string[] strings = { "bar", "foo", "foobar", "barfoo", "johnny", "doe" };
            string[] expected = { "foo", "foobar", "barfoo", "bar", "johnny", "doe" };
            var result = new StringFilter(strings).Contains("foo", "bar", "john", "do");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        #endregion

        [Test]
        public void StringFilter_DoesNotContain() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "bar" };
            var result = new StringFilter(strings).DoesNotContain("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }


        [Test]
        public void StringFilter_StartsWith() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "foo", "foobar" };
            var result = new StringFilter(strings).StartsWith("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }

        [Test]
        public void StringFilter_DoesNotStartWith() {
            string[] strings = { "bar", "foo", "foobar", "barfoo" };
            string[] expected = { "bar", "barfoo" };
            var result = new StringFilter(strings).DoesNotStartWith("foo");
            Assert.IsTrue(result.SequenceEqual(expected));
        }
    }
}
{'fraction_non_alphanumeric': 0.16046165301563664, 'fraction_numerical': 0.0, 'mean_word_length': 2.3920454545454546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '485785', 'n_tokens_mistral': 1555, 'n_tokens_neox': 1505, 'n_words': 336}