<commit_before>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using Ploeh.AutoFixture.Kernel;
using Ploeh.TestTypeFoundation;
using Xunit;
using Xunit.Extensions;

namespace Ploeh.AutoFixtureUnitTest.Kernel
{
    public class MemberInfoEqualityComparerTest
    {
        [Fact]
        public void SutIsStronglyTypedEqualityComparer()
        {
            // Fixture setup
            // Exercise system
            var sut = new MemberInfoEqualityComparer();
            // Verify outcome
            Assert.IsAssignableFrom<IEqualityComparer<MemberInfo>>(sut);
            // Teardown
        }

        [Fact]
        public void SutIsWeaklyTypedEqualityComparer()
        {
            // Fixture setup
            // Exercise system
            var sut = new MemberInfoEqualityComparer();
            // Verify outcome
            Assert.IsAssignableFrom<IEqualityComparer>(sut);
            // Teardown
        }

        [Theory]
        [InlineData(null, "", false)]
        [InlineData("", null, false)]
        [InlineData("", "", false)]
        [InlineData(1, 1, false)]
        [InlineData(null, null, true)]
        [InlineData(null, typeof(object), false)]
        [InlineData(typeof(object), null, false)]
        [InlineData(typeof(object), typeof(object), true)]
        [InlineData(typeof(string), typeof(object), false)]
        [InlineData(typeof(string), typeof(string), true)]
        public void WeaklyTypedEqualsReturnsCorrectResult(object x, object y, bool expectedResult)
        {
            // Fixture setup
            IEqualityComparer sut = new MemberInfoEqualityComparer();
            // Exercise system
            var result = sut.Equals(x, y);
            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }

        [Theory]
        [InlineData(null, null, true)]
        [InlineData(null, typeof(object), false)]
        [InlineData(typeof(object), null, false)]
        [InlineData(typeof(object), typeof(object), true)]
        [InlineData(typeof(string), typeof(object), false)]
        [InlineData(typeof(string), typeof(string), true)]
        public void StronglyTypeEqualsReturnsCorrectResult(MemberInfo x, MemberInfo y, bool expectedResult)
        {
            // Fixture setup
            var sut = new MemberInfoEqualityComparer();
            // Exercise system
            var result = sut.Equals(x, y);
            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }

        [Fact]
        public void EqualsOfDeclaredAndDerivedPropertyReturnsCorrectResult()
        {
            // Fixture setup
            var sut = new MemberInfoEqualityComparer();
            var declaredProperty = typeof(AbstractType).GetProperty("Property1");
            var derivedProperty = typeof(ConcreteType).GetProperty("Property1");
            // Exercise system
            var result = sut.Equals(declaredProperty, derivedProperty);<commit_msg>Corrected a typo.<commit_after>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using Ploeh.AutoFixture.Kernel;
using Ploeh.TestTypeFoundation;
using Xunit;
using Xunit.Extensions;

namespace Ploeh.AutoFixtureUnitTest.Kernel
{
    public class MemberInfoEqualityComparerTest
    {
        [Fact]
        public void SutIsStronglyTypedEqualityComparer()
        {
            // Fixture setup
            // Exercise system
            var sut = new MemberInfoEqualityComparer();
            // Verify outcome
            Assert.IsAssignableFrom<IEqualityComparer<MemberInfo>>(sut);
            // Teardown
        }

        [Fact]
        public void SutIsWeaklyTypedEqualityComparer()
        {
            // Fixture setup
            // Exercise system
            var sut = new MemberInfoEqualityComparer();
            // Verify outcome
            Assert.IsAssignableFrom<IEqualityComparer>(sut);
            // Teardown
        }

        [Theory]
        [InlineData(null, "", false)]
        [InlineData("", null, false)]
        [InlineData("", "", false)]
        [InlineData(1, 1, false)]
        [InlineData(null, null, true)]
        [InlineData(null, typeof(object), false)]
        [InlineData(typeof(object), null, false)]
        [InlineData(typeof(object), typeof(object), true)]
        [InlineData(typeof(string), typeof(object), false)]
        [InlineData(typeof(string), typeof(string), true)]
        public void WeaklyTypedEqualsReturnsCorrectResult(object x, object y, bool expectedResult)
        {
            // Fixture setup
            IEqualityComparer sut = new MemberInfoEqualityComparer();
            // Exercise system
            var result = sut.Equals(x, y);
            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }

        [Theory]
        [InlineData(null, null, true)]
        [InlineData(null, typeof(object), false)]
        [InlineData(typeof(object), null, false)]
        [InlineData(typeof(object), typeof(object), true)]
        [InlineData(typeof(string), typeof(object), false)]
        [InlineData(typeof(string), typeof(string), true)]
        public void StronglyTypedEqualsReturnsCorrectResult(MemberInfo x, MemberInfo y, bool expectedResult)
        {
            // Fixture setup
            var sut = new MemberInfoEqualityComparer();
            // Exercise system
            var result = sut.Equals(x, y);
            // Verify outcome
            Assert.Equal(expectedResult, result);
            // Teardown
        }

        [Fact]
        public void EqualsOfDeclaredAndDerivedPropertyReturnsCorrectResult()
        {
            // Fixture setup
            var sut = new MemberInfoEqualityComparer();
            var declaredProperty = typeof(AbstractType).GetProperty("Property1");
            var derivedProperty = typeof(ConcreteType).GetProperty("Property1");
            // Exercise system
            var result = sut.Equals(declaredProperty, derivedProperty);
{'fraction_non_alphanumeric': 0.1016921307704945, 'fraction_numerical': 0.0013142763265976672, 'mean_word_length': 2.214361140443506, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6719839', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1589, 'n_words': 347}