From f65d3f44ec44ae7d74b0f573c08ac076cfe37fe8 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 18 May 2025 23:05:43 +0000 Subject: [PATCH 1/3] chore(deps): update tunit to 0.20.16 --- Directory.Packages.props | 6 +++--- .../content/TUnit.AspNet/TestProject/TestProject.csproj | 2 +- .../ExampleNamespace.TestProject.csproj | 2 +- .../content/TUnit.Aspire.Test/ExampleNamespace.csproj | 2 +- TUnit.Templates/content/TUnit.Playwright/TestProject.csproj | 2 +- TUnit.Templates/content/TUnit/TestProject.csproj | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b99e36e249..28d9d9f647 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -76,9 +76,9 @@ - - - + + + diff --git a/TUnit.Templates/content/TUnit.AspNet/TestProject/TestProject.csproj b/TUnit.Templates/content/TUnit.AspNet/TestProject/TestProject.csproj index 2873c8295b..1e0e696ea2 100644 --- a/TUnit.Templates/content/TUnit.AspNet/TestProject/TestProject.csproj +++ b/TUnit.Templates/content/TUnit.AspNet/TestProject/TestProject.csproj @@ -9,7 +9,7 @@ - + diff --git a/TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.TestProject/ExampleNamespace.TestProject.csproj b/TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.TestProject/ExampleNamespace.TestProject.csproj index 5eda00a26b..1a713e368d 100644 --- a/TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.TestProject/ExampleNamespace.TestProject.csproj +++ b/TUnit.Templates/content/TUnit.Aspire.Starter/ExampleNamespace.TestProject/ExampleNamespace.TestProject.csproj @@ -11,7 +11,7 @@ - + diff --git a/TUnit.Templates/content/TUnit.Aspire.Test/ExampleNamespace.csproj b/TUnit.Templates/content/TUnit.Aspire.Test/ExampleNamespace.csproj index 7e4f6a9eeb..8db81eba19 100644 --- a/TUnit.Templates/content/TUnit.Aspire.Test/ExampleNamespace.csproj +++ b/TUnit.Templates/content/TUnit.Aspire.Test/ExampleNamespace.csproj @@ -10,7 +10,7 @@ - + diff --git a/TUnit.Templates/content/TUnit.Playwright/TestProject.csproj b/TUnit.Templates/content/TUnit.Playwright/TestProject.csproj index 6ece864c62..a500331266 100644 --- a/TUnit.Templates/content/TUnit.Playwright/TestProject.csproj +++ b/TUnit.Templates/content/TUnit.Playwright/TestProject.csproj @@ -8,7 +8,7 @@ - + diff --git a/TUnit.Templates/content/TUnit/TestProject.csproj b/TUnit.Templates/content/TUnit/TestProject.csproj index f8fc9457b0..a40d67e3e6 100644 --- a/TUnit.Templates/content/TUnit/TestProject.csproj +++ b/TUnit.Templates/content/TUnit/TestProject.csproj @@ -8,7 +8,7 @@ - + \ No newline at end of file From a83398bef4a15c829c34237668130c239b38da5e Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 19 May 2025 00:31:31 +0100 Subject: [PATCH 2/3] Fix --- .../TUnit/Data/DependencyInjectionClassConstructor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TUnit.Templates/content/TUnit/Data/DependencyInjectionClassConstructor.cs b/TUnit.Templates/content/TUnit/Data/DependencyInjectionClassConstructor.cs index dada41d13e..ee395ed351 100644 --- a/TUnit.Templates/content/TUnit/Data/DependencyInjectionClassConstructor.cs +++ b/TUnit.Templates/content/TUnit/Data/DependencyInjectionClassConstructor.cs @@ -4,13 +4,13 @@ namespace TestProject; public class DependencyInjectionClassConstructor : IClassConstructor { - public T Create(ClassConstructorMetadata classConstructorMetadata) where T : class + public object Create(Type type, ClassConstructorMetadata classConstructorMetadata) { Console.WriteLine(@"You can also control how your test classes are new'd up, giving you lots of power and the ability to utilise tools such as dependency injection"); - if (typeof(T) == typeof(AndEvenMoreTests)) + if (type == typeof(AndEvenMoreTests)) { - return (new AndEvenMoreTests(new DataClass()) as T)!; + return new AndEvenMoreTests(new DataClass()); } throw new NotImplementedException(); From 727536dfc6081e26045fa33edc50c53a55588aff Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 19 May 2025 00:57:38 +0100 Subject: [PATCH 3/3] Update snaps --- .../TUnit/Data/DependencyInjectionClassConstructor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/Data/DependencyInjectionClassConstructor.cs b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/Data/DependencyInjectionClassConstructor.cs index bc7bb3428b..1d72bb1ad3 100644 --- a/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/Data/DependencyInjectionClassConstructor.cs +++ b/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit._.verified/TUnit/Data/DependencyInjectionClassConstructor.cs @@ -4,13 +4,13 @@ namespace TUnit; public class DependencyInjectionClassConstructor : IClassConstructor { - public T Create(ClassConstructorMetadata classConstructorMetadata) where T : class + public object Create(Type type, ClassConstructorMetadata classConstructorMetadata) { Console.WriteLine(@"You can also control how your test classes are new'd up, giving you lots of power and the ability to utilise tools such as dependency injection"); - if (typeof(T) == typeof(AndEvenMoreTests)) + if (type == typeof(AndEvenMoreTests)) { - return (new AndEvenMoreTests(new DataClass()) as T)!; + return new AndEvenMoreTests(new DataClass()); } throw new NotImplementedException();