-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Template] Support for TUnit as testframework #1661
Comments
Hey @samtrion Besides that we don’t offer templates for TUnit - is there anything missing or not working? |
@linkdotnet Support as a template was meant when this issue was created. Switching to TUnit can be done in 3 simple steps after creation. Therefore, there is not much to consider.
After that it works without problems. |
It should also be noted that there is an ambiguous reference between |
We can add the template. And probably we will do this only for The whole |
We have to check how nice TUnit plays together with our templates, given that we use |
I was just able to run a few tests with both the latest stable and the current 2 preview version. No noticeable problems so far |
Did you use the "classic" C# tests or tests written in razor files? |
So far only |
Short test from my side:
Seems there is some work to do. |
|
Spicey! Thanks for the link |
One step further - have to try a bit more when I have more time. |
As mentioned here, or in my previous message
And you have to adjust your IDE ... |
No that does work indeed. The problem seems the generated C# file from the razor code. @using Bunit
@using TUnit.Core;
@inherits Bunit.BunitContext
@code
{
[Test]
public void CounterStartsAtZero()
{
var cut = Render(@<Counter />);
cut.Find("p").MarkupMatches(@<p>Current count: 0</p>);
}
} Will not have any discoverable test. |
PS: I am only using the CLI ATM |
The main issue with razor files is that they will be taken care of by the compiler, and C# files are generated. As of now, a source code generator can not see or use the output of another generator. Somewhere on the roslyn repo there is an issue addressing exactly that. So, therefore, if people want to use TUnit, they might be locked in "csharp" only. From the point of view of the template, that wouldn't be a big issue. And we have to document that somewhere in our docs. |
Using
While plain old cs files with
Basically a test is run |
I do have a version that might do the trick (C# only). @egil let's discuss this on Friday latest. |
With existing support for various testing frameworks, it would be great if the current offering could be extended with TUnit.
TUnit is a rising star that challenges existing test frameworks such as xUnit and NUnit. Especially in terms of simplified syntax and performance, it clearly stands out from the existing test frameworks without sacrificing familiar features.
The text was updated successfully, but these errors were encountered: