Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
<PackageVersion Include="Testcontainers.Redis" Version="4.4.0" />
<PackageVersion Include="trxparser" Version="0.5.0" />
<PackageVersion Include="Verify.NUnit" Version="30.1.0" />
<PackageVersion Include="TUnit" Version="0.19.148" />
<PackageVersion Include="TUnit.Core" Version="0.19.148" />
<PackageVersion Include="TUnit.Assertions" Version="0.19.148" />
<PackageVersion Include="TUnit" Version="0.20.16" />
<PackageVersion Include="TUnit.Core" Version="0.20.16" />
<PackageVersion Include="TUnit.Assertions" Version="0.20.16" />
<PackageVersion Include="Verify.TUnit" Version="30.1.0" />
<PackageVersion Include="Vogen" Version="7.0.3" />
<PackageVersion Include="xunit" Version="2.9.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ namespace TUnit;

public class DependencyInjectionClassConstructor : IClassConstructor
{
public T Create<T>(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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.5" />
<PackageReference Include="TUnit" Version="0.19.148" />
<PackageReference Include="TUnit" Version="0.20.16" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Aspire.Hosting.Testing" Version="9.2.1" />
<PackageReference Include="TUnit" Version="0.19.148" />
<PackageReference Include="TUnit" Version="0.20.16" />
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Aspire.Hosting.Testing" Version="9.2.1" />
<PackageReference Include="TUnit" Version="0.19.148" />
<PackageReference Include="TUnit" Version="0.20.16" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TUnit.Playwright" Version="0.19.148" />
<PackageReference Include="TUnit.Playwright" Version="0.20.16" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ namespace TestProject;

public class DependencyInjectionClassConstructor : IClassConstructor
{
public T Create<T>(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();
Expand Down
2 changes: 1 addition & 1 deletion TUnit.Templates/content/TUnit/TestProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TUnit" Version="0.19.148" />
<PackageReference Include="TUnit" Version="0.20.16" />
</ItemGroup>

</Project>
Loading