<commit_before>using NUnit.Framework;
using System.Linq;

namespace LinUnit.Tests
{
    [TestFixture]
    public class ExpressionTests
    {
        [Test]
        public void Equal()
        {
            1.Should(x => x == 1);
        }

        [Test, ExpectedException(ExpectedMessage = "2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void EqualFails()
        {
            1.Should(x => x == 2);
        }

        [Test]
        public void NotEqual()
        {
            1.Should(x => x != 2);
        }

        [Test, ExpectedException(ExpectedMessage = "not 1\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void NotEqualFails()
        {
            1.Should(x => x != 1);
        }

        [Test]
        public void And()
        {
            1.Should(x => x == 1 && x != 2);
        }


        [Test, ExpectedException(ExpectedMessage = "1 and 2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void AndFails()
        {
            1.Should(x => x == 1 && x == 2);
        }

        [Test]
        public void Or()
        {
            1.Should(x => x == 1 || x == 2);
        }

        [Test, ExpectedException(ExpectedMessage = "2 or 3\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void OrFails()
        {
            1.Should(x => x == 2 || x == 3);
        }

        [Test]
        public void Greater()
        {
            1.Should(x => x > 0);
        }

        [Test, ExpectedException(ExpectedMessage = "greater than 2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void GreaterFails()
        {
            1.Should(x => x > 2);
        }

        [Test]
        public void GreaterOrEqual()
        {
            1.Should(x => x >= 1);
        }

        [Test, ExpectedException(ExpectedMessage = "greater than or equal to 2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void GreaterOrEqualFails()
        {
            1.Should(x => x >= 2);
        }

        [Test]
        public void Less()
        {
            1.Should(x => x < 2);
        }

        [Test, ExpectedException(ExpectedMessage = "less than 1\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void LessFails()
        {
            1.Should(x => x < 1);
        }

        [Test]
        public void LessOrEqual()
        {
            1.Should(x => x <= 1);
        }

        [Test, ExpectedException(ExpectedMessage = "less than or equal to 0\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void LessOrEqualFails()
        {
            1.Should(x => x <= 0);
        }

        [Test]
        public void OperationsOnRightSide()
        {
            var y = 2;
            var z = 4;

            4.Should(x => x == y*y);
            2.Should(x => x == z/y);
            4.Should(x => x == y+y);
            2.Should(x => x == z-y);
        }

        [Test]
        public void StaticMethodWithoutArgumentsOnParameter()
        {
            "a".Should(x => x.Any());
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.Any()\"\r\n  But was:  <string.Empty>", MatchType = MessageMatch.Contains)]
        public void StaticMethodWithoutArgumentsOnParameterFailing()
        {
            "".Should(x => x.Any());
        }

        [Test]
        public void StaticMethodOnParameter()
        {
            new[] {1, 2}.Should(x => x.Contains(1));
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.Contains(3)\"\r\n  But was:  < 1, 2 >", MatchType = MessageMatch.Contains)]
        public void StaticMethodOnParameterFailing()
        {
            new[] {1, 2}.Should(x => x.Contains(3));
        }

        [Test]
        public void InstanceMethodOnParameter()
        {
            "abc".Should(x => x.Contains("a"));
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.Contains(\"d\")\"\r\n  But was:  \"abc\"", MatchType = MessageMatch.Contains)]
        public void InstanceMethodOnParameterFailing()
        {
            "abc".Should(x => x.Contains("d"));
        }

        [Test]
        public void Not()
        {
            "abc".Should(x => !x.Contains("d"));            
        }

        [Test, ExpectedException(ExpectedMessage = "not \"x.Contains(\"a\")\"\r\n  But was:  \"abc\"", MatchType = MessageMatch.Contains)]
        public void NotFailing()
        {
            "abc".Should(x => !x.Contains("a"));
        }

        [Test]
        public void ShouldReturnsBoolean()
        {
            new[] {1, 2, 3}.All(x => x.Should(y => y > 1));
        }

        [Test]
        public void ButCanBetWrittenLikeThisAsWell()
        {
            new[] {1, 2, 3}.Should(x => x.All(y => y > 0));
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.All(y => (y > 1))\"\r\n  But was:  < 1, 2, 3 >", MatchType = MessageMatch.Contains)]
        public void AndFailsConsistently()
        {
            new[] {1, 2, 3}.Should(x => x.All(y => y > 1));
        }

        [Test]
        public void StaticMethodOnLiteral()
        {
            1.Should(x => x == int.Parse("1"));
        }

        [Test, ExpectedException(ExpectedMessage = "2\r\n  But was:  1", MatchType = MessageMatch.Contains)]<commit_msg>Fixed test.<commit_after>using NUnit.Framework;
using System.Linq;

namespace LinUnit.Tests
{
    [TestFixture]
    public class ExpressionTests
    {
        [Test]
        public void Equal()
        {
            1.Should(x => x == 1);
        }

        [Test, ExpectedException(ExpectedMessage = "2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void EqualFails()
        {
            1.Should(x => x == 2);
        }

        [Test]
        public void NotEqual()
        {
            1.Should(x => x != 2);
        }

        [Test, ExpectedException(ExpectedMessage = "not 1\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void NotEqualFails()
        {
            1.Should(x => x != 1);
        }

        [Test]
        public void And()
        {
            1.Should(x => x == 1 && x != 2);
        }


        [Test, ExpectedException(ExpectedMessage = "1 and 2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void AndFails()
        {
            1.Should(x => x == 1 && x == 2);
        }

        [Test]
        public void Or()
        {
            1.Should(x => x == 1 || x == 2);
        }

        [Test, ExpectedException(ExpectedMessage = "2 or 3\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void OrFails()
        {
            1.Should(x => x == 2 || x == 3);
        }

        [Test]
        public void Greater()
        {
            1.Should(x => x > 0);
        }

        [Test, ExpectedException(ExpectedMessage = "greater than 2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void GreaterFails()
        {
            1.Should(x => x > 2);
        }

        [Test]
        public void GreaterOrEqual()
        {
            1.Should(x => x >= 1);
        }

        [Test, ExpectedException(ExpectedMessage = "greater than or equal to 2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void GreaterOrEqualFails()
        {
            1.Should(x => x >= 2);
        }

        [Test]
        public void Less()
        {
            1.Should(x => x < 2);
        }

        [Test, ExpectedException(ExpectedMessage = "less than 1\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void LessFails()
        {
            1.Should(x => x < 1);
        }

        [Test]
        public void LessOrEqual()
        {
            1.Should(x => x <= 1);
        }

        [Test, ExpectedException(ExpectedMessage = "less than or equal to 0\r\n  But was:  1", MatchType = MessageMatch.Contains)]
        public void LessOrEqualFails()
        {
            1.Should(x => x <= 0);
        }

        [Test]
        public void OperationsOnRightSide()
        {
            var y = 2;
            var z = 4;

            4.Should(x => x == y*y);
            2.Should(x => x == z/y);
            4.Should(x => x == y+y);
            2.Should(x => x == z-y);
        }

        [Test]
        public void StaticMethodWithoutArgumentsOnParameter()
        {
            "a".Should(x => x.Any());
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.Any()\"\r\n  But was:  <string.Empty>", MatchType = MessageMatch.Contains)]
        public void StaticMethodWithoutArgumentsOnParameterFailing()
        {
            "".Should(x => x.Any());
        }

        [Test]
        public void StaticMethodOnParameter()
        {
            new[] {1, 2}.Should(x => x.Contains(1));
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.Contains(3)\"\r\n  But was:  < 1, 2 >", MatchType = MessageMatch.Contains)]
        public void StaticMethodOnParameterFailing()
        {
            new[] {1, 2}.Should(x => x.Contains(3));
        }

        [Test]
        public void InstanceMethodOnParameter()
        {
            "abc".Should(x => x.Contains("a"));
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.Contains(\"d\")\"\r\n  But was:  \"abc\"", MatchType = MessageMatch.Contains)]
        public void InstanceMethodOnParameterFailing()
        {
            "abc".Should(x => x.Contains("d"));
        }

        [Test]
        public void Not()
        {
            "abc".Should(x => !x.Contains("d"));            
        }

        [Test, ExpectedException(ExpectedMessage = "not \"x.Contains(\"a\")\"\r\n  But was:  \"abc\"", MatchType = MessageMatch.Contains)]
        public void NotFailing()
        {
            "abc".Should(x => !x.Contains("a"));
        }

        [Test]
        public void ShouldReturnsBoolean()
        {
            new[] {1, 2, 3}.All(x => x.Should(y => y > 0));
        }

        [Test]
        public void ButCanBetWrittenLikeThisAsWell()
        {
            new[] {1, 2, 3}.Should(x => x.All(y => y > 0));
        }

        [Test, ExpectedException(ExpectedMessage = "\"x.All(y => (y > 1))\"\r\n  But was:  < 1, 2, 3 >", MatchType = MessageMatch.Contains)]
        public void AndFailsConsistently()
        {
            new[] {1, 2, 3}.Should(x => x.All(y => y > 1));
        }

        [Test]
        public void StaticMethodOnLiteral()
        {
            1.Should(x => x == int.Parse("1"));
        }

        [Test, ExpectedException(ExpectedMessage = "2\r\n  But was:  1", MatchType = MessageMatch.Contains)]
{'fraction_non_alphanumeric': 0.14630225080385853, 'fraction_numerical': 0.016833743143559676, 'mean_word_length': 1.5488069414316703, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 97, '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': '2960578', 'n_tokens_mistral': 3352, 'n_tokens_neox': 3171, 'n_words': 736}