C
C#2mo ago
Faker

✅ why dotnet test command in rider doesn't run the unit tests

Hello guys, when I try to run the unit test in rider IDE using the command dotnet test, it seems only the project is build but the unit tests aren't executed. Can someone explain why please.
No description
5 Replies
ero
ero2mo ago
show code
Faker
FakerOP2mo ago
C#
using System;
using Xunit;

namespace SoftwareTesting.UnitTests
{
public class Tests
{
[Fact]
public void Test1()
{
Assert.True(true);
}
}
}
C#
using System;
using Xunit;

namespace SoftwareTesting.UnitTests
{
public class Tests
{
[Fact]
public void Test1()
{
Assert.True(true);
}
}
}
I think I found the issue
Faker
FakerOP2mo ago
Instead of choosing Unit Test Project, I choose unit test in project type; what's the difference ?
No description
FusedQyou
FusedQyou2mo ago
The project type sets up essential things to make it the project type. What you are talking about is the template of the project with generally includes more template code to start off with like tests and such. You can try making a new project with this and see if it works There's not a whole lot a test project does, but you might be missing an essential package or feature
Faker
FakerOP2mo ago
yeah, when I choose project type instead of the template, there are lot of things that doesn't really work as intended. For example, when I use the dotnet test, it just build the project but doesn't execute the test cases. Similarly, if I try to add a reference, it seems that the version of the SDK may differ, like one of my project has SDK 9.0 while the project type has something like v4.8 making it incompatible. But when I use the template, everything works fine, I will just stick with that for now

Did you find this page helpful?