<commit_before>﻿using System;
using Xunit;

namespace RimDev.Supurlative.Tests
{
    public class IgnoreAttributeTests
    {
        private class HasIgnoredParameters
        {
            public HasIgnoredParameters()
            {
                Id = 3;
                Foo = null;
                Bar = 300;
                Bar2 = null;
            }

            public int Id { get; set; }
            public int? Foo { get; set; }

            // Two ways of using the ignore attribute (with and without Attribute suffix)
            [Supurlative.IgnoreAttribute]
            public int? Bar { get; set; }
            [Supurlative.Ignore]
            public int? Bar2 { get; set; }
        }

        [Fact]
        public void Verify_that_Foo_is_visible()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Foo");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.False(hasIgnoreAttribute);
        }

        [Fact]
        public void Verify_that_Id_is_visible()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Id");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.False(hasIgnoreAttribute);
        }

        [Fact]
        public void Verify_that_Bar_is_ignored()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Bar");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.True(hasIgnoreAttribute);
        }

        [Fact]
        public void Verify_that_Bar2_is_ignored()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Bar2");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.True(hasIgnoreAttribute);
        }

        [Fact]
        public void Verify_that_Foo_is_visible_using_HasIgnoreAttribute()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            Assert.False(IgnoreAttribute.PropertyHasIgnoreAttribute(_sut,"Foo"));
        }

        [Fact]
        public void Verify_that_Id_is_visible_using_HasIgnoreAttribute()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            Assert.False(IgnoreAttribute.PropertyHasIgnoreAttribute(_sut,"Id"));
        }

        [Fact]
        public void Verify_that_Bar_is_ignored_using_HasIgnoreAttribute()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            Assert.True(IgnoreAttribute.PropertyHasIgnoreAttribute(_sut, "Bar"));
        }

        [Fact]
        public void Verify_that_Bar2_is_ignored_using_HasIgnoreAttribute()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            Assert.True(IgnoreAttribute.PropertyHasIgnoreAttribute(_sut, "Bar2"));
        }

        [Fact]
        public void Check_HasIgnoreAttribute_handles_invalid_property_name()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            Assert.False(IgnoreAttribute.PropertyHasIgnoreAttribute(_sut, "NOSUCHPROPERTY"));
        }

    }
}<commit_msg>remove tests that depended on old helper method<commit_after>﻿using System;
using Xunit;

namespace RimDev.Supurlative.Tests
{
    public class IgnoreAttributeTests
    {
        private class HasIgnoredParameters
        {
            public HasIgnoredParameters()
            {
                Id = 3;
                Foo = null;
                Bar = 300;
                Bar2 = null;
            }

            public int Id { get; set; }
            public int? Foo { get; set; }

            // Two ways of using the ignore attribute (with and without Attribute suffix)
            [Supurlative.IgnoreAttribute]
            public int? Bar { get; set; }
            [Supurlative.Ignore]
            public int? Bar2 { get; set; }
        }

        [Fact]
        public void Verify_that_Foo_is_visible()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Foo");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.False(hasIgnoreAttribute);
        }

        [Fact]
        public void Verify_that_Id_is_visible()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Id");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.False(hasIgnoreAttribute);
        }

        [Fact]
        public void Verify_that_Bar_is_ignored()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Bar");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.True(hasIgnoreAttribute);
        }

        [Fact]
        public void Verify_that_Bar2_is_ignored()
        {
            HasIgnoredParameters _sut = new HasIgnoredParameters();
            var t = typeof(HasIgnoredParameters);
            var pi = t.GetProperty("Bar2");
            bool hasIgnoreAttribute = Attribute.IsDefined(pi, typeof(IgnoreAttribute));
            Assert.True(hasIgnoreAttribute);
        }

    }
}
{'fraction_non_alphanumeric': 0.08137339055793992, 'fraction_numerical': 0.003090128755364807, 'mean_word_length': 1.9938335046248716, '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': '5616261', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1492, 'n_words': 319}