Skip to content

Commit 730420b

Browse files
authored
chore(tests): file path and line number fallback methods (#3228)
1 parent 9633730 commit 730420b

19 files changed

+127
-131
lines changed

TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete1.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal sealed class ConcreteClass1_AssertClassName_TestSource_GUID : global::T
2424
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
2525
InheritanceDepth = 1,
2626
FilePath = @"",
27-
LineNumber = 5,
27+
LineNumber = 3,
2828
MethodMetadata = new global::TUnit.Core.MethodMetadata
2929
{
3030
Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),

TUnit.Core.SourceGenerator.Tests/AbstractTests.Concrete2.verified.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ internal sealed class ConcreteClass2_AssertClassName_TestSource_GUID : global::T
113113
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
114114
InheritanceDepth = 2,
115115
FilePath = @"",
116-
LineNumber = 5,
116+
LineNumber = 3,
117117
MethodMetadata = new global::TUnit.Core.MethodMetadata
118118
{
119119
Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),
@@ -199,7 +199,7 @@ internal sealed class ConcreteClass2_SecondTest_TestSource_GUID : global::TUnit.
199199
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
200200
InheritanceDepth = 0,
201201
FilePath = @"",
202-
LineNumber = 11,
202+
LineNumber = 3,
203203
MethodMetadata = new global::TUnit.Core.MethodMetadata
204204
{
205205
Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
@@ -286,7 +286,7 @@ internal sealed class ConcreteClass1_AssertClassName_TestSource_GUID : global::T
286286
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
287287
InheritanceDepth = 1,
288288
FilePath = @"",
289-
LineNumber = 5,
289+
LineNumber = 3,
290290
MethodMetadata = new global::TUnit.Core.MethodMetadata
291291
{
292292
Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),

TUnit.Core.SourceGenerator.Tests/ConcreteClassTests.Test.verified.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ internal sealed class ConcreteClass2_AssertClassName_TestSource_GUID : global::T
113113
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
114114
InheritanceDepth = 2,
115115
FilePath = @"",
116-
LineNumber = 5,
116+
LineNumber = 3,
117117
MethodMetadata = new global::TUnit.Core.MethodMetadata
118118
{
119119
Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),
@@ -199,7 +199,7 @@ internal sealed class ConcreteClass2_SecondTest_TestSource_GUID : global::TUnit.
199199
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
200200
InheritanceDepth = 0,
201201
FilePath = @"",
202-
LineNumber = 11,
202+
LineNumber = 3,
203203
MethodMetadata = new global::TUnit.Core.MethodMetadata
204204
{
205205
Type = typeof(global::TUnit.TestProject.AbstractTests.ConcreteClass2),
@@ -286,7 +286,7 @@ internal sealed class ConcreteClass1_AssertClassName_TestSource_GUID : global::T
286286
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
287287
InheritanceDepth = 1,
288288
FilePath = @"",
289-
LineNumber = 5,
289+
LineNumber = 3,
290290
MethodMetadata = new global::TUnit.Core.MethodMetadata
291291
{
292292
Type = typeof(global::TUnit.TestProject.AbstractTests.AbstractBaseClass),

TUnit.Core.SourceGenerator.Tests/GenericMethodTests.Test.verified.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ internal sealed class GenericMethodTests_AggregateBy_HasExpectedOutput_TestSourc
134134
method = method.MakeGenericMethod(typeArgs);
135135
}
136136
}
137-
// Prepare method arguments
138137
var methodArgs = new object?[args.Length];
139138
args.CopyTo(methodArgs, 0);
140139
// Invoke the method

TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericConstraints_WithInstantiation.verified.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ internal sealed class ConstrainedGenericTestClass_TestMethod_TestSource_GUID : g
7575
{
7676
throw new global::System.InvalidOperationException($"Method 'TestMethod' not found on type {instanceType.FullName}");
7777
}
78-
// Prepare method arguments
7978
var methodArgs = new object?[args.Length];
8079
args.CopyTo(methodArgs, 0);
8180
// Invoke the method

TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestClass_WithExplicitInstantiation.verified.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ internal sealed class GenericTestClass_TestMethod_TestSource_GUID : global::TUni
7575
{
7676
throw new global::System.InvalidOperationException($"Method 'TestMethod' not found on type {instanceType.FullName}");
7777
}
78-
// Prepare method arguments
7978
var methodArgs = new object?[args.Length];
8079
args.CopyTo(methodArgs, 0);
8180
// Invoke the method

TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_GenericTestMethod_WithExplicitInstantiation.verified.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ internal sealed class TestClass_GenericTestMethod_TestSource_GUID : global::TUni
9191
method = method.MakeGenericMethod(typeArgs);
9292
}
9393
}
94-
// Prepare method arguments
9594
var methodArgs = new object?[args.Length];
9695
args.CopyTo(methodArgs, 0);
9796
// Invoke the method

TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_MultipleGenericParameters.verified.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ internal sealed class MultiGenericTestClass_TestMethod_TestSource_GUID : global:
7575
{
7676
throw new global::System.InvalidOperationException($"Method 'TestMethod' not found on type {instanceType.FullName}");
7777
}
78-
// Prepare method arguments
7978
var methodArgs = new object?[args.Length];
8079
args.CopyTo(methodArgs, 0);
8180
// Invoke the method

TUnit.Core.SourceGenerator.Tests/GenericTypeResolverTests.Test_NestedGenericTypes.verified.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ internal sealed class NestedGenericTestClass_TestMethod_TestSource_GUID : global
7575
{
7676
throw new global::System.InvalidOperationException($"Method 'TestMethod' not found on type {instanceType.FullName}");
7777
}
78-
// Prepare method arguments
7978
var methodArgs = new object?[args.Length];
8079
args.CopyTo(methodArgs, 0);
8180
// Invoke the method

TUnit.Core.SourceGenerator.Tests/InheritedPropertySetterTests.Test.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ internal sealed class InheritedPropertySetterTests_Test_TestSource_GUID : global
528528
},
529529
InheritanceDepth = 1,
530530
FilePath = @"",
531-
LineNumber = 69,
531+
LineNumber = 3,
532532
MethodMetadata = new global::TUnit.Core.MethodMetadata
533533
{
534534
Type = typeof(global::TUnit.TestProject.PropertySetterTests),

0 commit comments

Comments
 (0)