コード例 #1
0
 public static IEnumerable <TestCaseData> ToTestCaseData <T>(this MemberMultiSamples <T> samples) =>
 samples.SelectMany(s =>
                    s.Values.Select(v =>
                                    new TestCaseData(s.PropertyInfo, v)
                                    .SetArgDisplayNames(
                                        s.PropertyInfo.Name,
                                        v?.ToString() ?? NullRepresentation)));
コード例 #2
0
 public static IEnumerable <TestCaseData> ToValidationTestCaseData <T>(this MemberMultiSamples <T> samples) =>
 samples.SelectMany(s =>
                    s.Values.Select(v =>
                                    new TestCaseData(
                                        (Action <T, object>)((instance, value) => s.PropertyInfo.SetValue(instance, value)),
                                        v)
                                    .SetArgDisplayNames(
                                        s.PropertyInfo.Name,
                                        v?.ToString() ?? NullRepresentation)));