Code inspection: NUnit. Test case source must be field, property, or method.Last modified: 11 February 2024Category: NUnitID: NUnit.TestCaseSourceMustBeFieldPropertyMethodEditorConfig: resharper_n_unit_test_case_source_must_be_field_property_method_highlighting=[error|warning|suggestion|hint|none]Default severity: WarningLanguage: C#Requires SWA: NotipYou can suppress this inspection to ignore specific issues, change its severity level to make the issues less or more noticeable, or disable it altogether.NUnit's TestCaseSource and ValueSource attributes require data source members to be static field, property, or method.[TestFixture] public sealed class TestCaseSourceTest { static IEnumerable<int> _fieldSource = new[] {1, 2, 3}; static IEnumerable<int> PropertySource => new[] {4, 5, 6}; static IEnumerable<int> MethodSource() => new[] {7, 8, 9}; public event UnhandledExceptionEventHandler OnError { add => throw new NotImplementedException(); remove => throw new NotImplementedException(); } [TestCaseSource(nameof(_fieldSource))] // ok [TestCaseSource(nameof(PropertySource))] // ok [TestCaseSource(nameof(MethodSource))] // ok [TestCaseSource(nameof(OnError))] // Warning: expected field/property/method public void Test1(int x) { Console.WriteLine(x); } }