-
-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumble.TUnit.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="TUnit" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../CookieCrumble/CookieCrumble.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
9 changes: 9 additions & 0 deletions
9
src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumbleTUnit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace CookieCrumble.TUnit; | ||
|
||
public static class CookieCrumbleTUnit | ||
{ | ||
public static void Initialize() | ||
{ | ||
Snapshot.RegisterTestFramework(new TUnitFramework()); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/CookieCrumble/src/CookieCrumble.TUnit/TUnitFramework.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Reflection; | ||
using TUnit.Core.Exceptions; | ||
|
||
namespace CookieCrumble.TUnit; | ||
|
||
public class TUnitFramework : ITestFramework | ||
{ | ||
public bool IsValidTestMethod(MemberInfo? method) | ||
=> method?.GetCustomAttributes(typeof(TestAttribute)).Any() ?? false; | ||
|
||
public void ThrowTestException(string message) | ||
{ | ||
throw new TUnitException(message); | ||
} | ||
} |