public void GivenIgnoreVirtualMembers_WhenGetDataIsInvoked_ThenFixtureIsCustomizedCorrectly(bool ignoreVirtualMembers)
        {
            // Arrange
            var fixture        = Substitute.For <IFixture>();
            var customizations = new List <ICustomization>();

            fixture.Customize(Arg.Do <ICustomization>(customization => customizations.Add(customization)))
            .Returns(fixture);

            var attribute = new MemberAutoMockDataAttribute(fixture, nameof(TestData))
            {
                IgnoreVirtualMembers = ignoreVirtualMembers
            };
            var methodInfo = typeof(MemberAutoMockDataAttributeTests).GetMethod(nameof(this.TestMethod));

            // Act
            attribute.GetData(methodInfo);

            // Assert
            customizations.Count.Should().Be(2);
            customizations[0]
            .Should()
            .BeOfType <AutoDataCommonCustomization>()
            .Which.IgnoreVirtualMembers.Should()
            .Be(ignoreVirtualMembers);
            customizations[1].Should().BeOfType <AutoNSubstituteCustomization>();
        }
        public void GivenExistingMemberName_WhenGetDataIsInvoked_ThenAppropriateDataIsReturned()
        {
            // Arrange
            var attribute          = new MemberAutoMockDataAttribute(nameof(TestData));
            var methodInfo         = typeof(MemberAutoMockDataAttributeTests).GetMethod(nameof(this.TestMethod));
            var numberOfParameters = methodInfo.GetParameters().Length;

            // Act
            var data = attribute.GetData(methodInfo).ToList();

            // Assert
            data.Should().HaveSameCount(TestData);
            for (var i = data.Count - 1; i >= 0; i--)
            {
                var source = TestData.ElementAt(i);
                var result = data.ElementAt(i);

                result.Should().HaveCount(numberOfParameters);
                result.Should().ContainInOrder(source);
                result[numberOfParameters - 1].GetType().Name.Should().StartWith("ObjectProxy", "that way we know it was mocked.");
            }
        }