public void InitializeWithNullFieldSpecificationThrows()
        {
            // Fixture setup
            var dummyComparer      = new DelegatingEqualityComparer();
            var dummySpecification = new DelegatingSpecification <PropertyInfo>();

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  new MemberComparer(
                                                      dummyComparer,
                                                      dummySpecification,
                                                      null));
            // Teardown
        }
        public void FieldSpecificationIsCorrect()
        {
            // Fixture setup
            var dummyComparer      = new DelegatingEqualityComparer();
            var expected           = new DelegatingSpecification <FieldInfo>();
            var dummySpecification = new DelegatingSpecification <PropertyInfo>();

            var sut = new MemberComparer(
                dummyComparer,
                dummySpecification,
                expected);
            // Exercise system
            var result = sut.FieldSpecification;

            // Verify outcome
            Assert.Equal(expected, result);
            // Teardown
        }
        public void IsSatisfiedByForFieldReturnsCorrectResult(bool expected)
        {
            // Fixture setup
            var field              = typeof(FieldHolder <int>).GetField("Field");
            var dummyComparer      = new DelegatingEqualityComparer();
            var dummySpecification = new DelegatingSpecification <PropertyInfo>();

            var fieldSpecificationStub =
                new DelegatingSpecification <FieldInfo>
            {
                OnIsSatisfiedBy = x => expected
            };

            var sut = new MemberComparer(
                dummyComparer,
                dummySpecification,
                fieldSpecificationStub);
            // Exercise system
            var result = sut.IsSatisfiedBy(field);

            // Verify outcome
            Assert.Equal(expected, result);
            // Teardown
        }