diff --git a/src/Conjecture.Xunit.V3/Internal/PropertyTestCase.cs b/src/Conjecture.Xunit.V3/Internal/PropertyTestCase.cs index 34cd80d..8111895 100644 --- a/src/Conjecture.Xunit.V3/Internal/PropertyTestCase.cs +++ b/src/Conjecture.Xunit.V3/Internal/PropertyTestCase.cs @@ -88,7 +88,7 @@ public async ValueTask Run( IReadOnlyDictionary> traits = Traits.ToDictionary(kvp => kvp.Key, kvp => (IReadOnlyCollection)kvp.Value.ToList()); - XunitTest test = new(this, TestMethod, null, null, TestCaseDisplayName, 0, traits, null, Array.Empty()); + XunitTest test = new(this, TestMethod, null, null, null, null, null, TestCaseDisplayName, 0, traits, null, Array.Empty()); string assemblyID = TestMethod.TestClass.TestCollection.TestAssembly.UniqueID; string collectionID = TestMethod.TestClass.TestCollection.UniqueID; diff --git a/src/Conjecture.Xunit.V3/Internal/PropertyTestCaseDiscoverer.cs b/src/Conjecture.Xunit.V3/Internal/PropertyTestCaseDiscoverer.cs index 2775d2a..581f7b4 100644 --- a/src/Conjecture.Xunit.V3/Internal/PropertyTestCaseDiscoverer.cs +++ b/src/Conjecture.Xunit.V3/Internal/PropertyTestCaseDiscoverer.cs @@ -21,7 +21,7 @@ public ValueTask> Discover( int maxStrategyRejections = attr.MaxStrategyRejections > 0 ? attr.MaxStrategyRejections : 5; int deadlineMs = attr.DeadlineMs; - string displayName = testMethod.GetDisplayName(attr.DisplayName ?? testMethod.Method.Name, null, null); + string displayName = testMethod.GetDisplayName(attr.DisplayName ?? testMethod.Method.Name, null, null, null); string uniqueID = testMethod.UniqueID; IReadOnlyCollection testCases = [new PropertyTestCase( diff --git a/src/Conjecture.Xunit.V3/PropertyAttribute.cs b/src/Conjecture.Xunit.V3/PropertyAttribute.cs index 2febfdd..866b24f 100644 --- a/src/Conjecture.Xunit.V3/PropertyAttribute.cs +++ b/src/Conjecture.Xunit.V3/PropertyAttribute.cs @@ -1,6 +1,7 @@ // Copyright (c) 2026 Kim Ommundsen. Licensed under the MPL-2.0. // See LICENSE.txt in the project root or https://mozilla.org/MPL/2.0/ +using System.Runtime.CompilerServices; using Xunit; using Xunit.v3; @@ -9,7 +10,9 @@ namespace Conjecture.Xunit.V3; /// Marks a method as a Conjecture property-based test (xUnit v3). [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [XunitTestCaseDiscovererAttribute(typeof(Internal.PropertyTestCaseDiscoverer))] -public sealed class PropertyAttribute : FactAttribute +public sealed class PropertyAttribute( + [CallerFilePath] string? sourceFilePath = null, + [CallerLineNumber] int sourceLineNumber = -1) : FactAttribute(sourceFilePath, sourceLineNumber) { /// Maximum number of examples to generate. Defaults to 100. public int MaxExamples { get; set; } = 100; diff --git a/src/Conjecture.Xunit.V3/PublicAPI.Unshipped.txt b/src/Conjecture.Xunit.V3/PublicAPI.Unshipped.txt index ee3a74c..bf22d45 100644 --- a/src/Conjecture.Xunit.V3/PublicAPI.Unshipped.txt +++ b/src/Conjecture.Xunit.V3/PublicAPI.Unshipped.txt @@ -1,6 +1,6 @@ #nullable enable Conjecture.Xunit.V3.PropertyAttribute -Conjecture.Xunit.V3.PropertyAttribute.PropertyAttribute() -> void +Conjecture.Xunit.V3.PropertyAttribute.PropertyAttribute(string? sourceFilePath = null, int sourceLineNumber = -1) -> void Conjecture.Xunit.V3.PropertyAttribute.MaxExamples.get -> int Conjecture.Xunit.V3.PropertyAttribute.MaxExamples.set -> void Conjecture.Xunit.V3.PropertyAttribute.Seed.get -> ulong diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 82ae88f..2e8959b 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -33,8 +33,8 @@ - - + +