MyTested.AspNetCore.Mvc
MyTested.AspNetCore.Mvc copied to clipboard
Writing test for .net 5 project using .net 6 runtime
It's always hard to write integrations tests and eventually, I found your project. This is an amazing solution. Thanks for your efforts on this. I setting up tests for a new project to which I sign up. And trying to use it. However when I execute test it throughs the exception "This version of MyTested.AspNetCore.Mvc only supports ASP.NET Core 5.0 applications but the 6.0.0 web framework was" The project is written with .net 5 and .net 6 able to run it without any issue. I can set up .net 5 but I'm already moved to new apple silicon and .net 5 works very slow on m1. Is there any way to disable runtime framework checks?
@ivaylokenov would it be this kind of code appropriate?
public static class TestFramework
{
public const string TestFrameworkName = "MyTested.AspNetCore.Mvc";
public const string ReleaseDate = "2021-07-01";
public const string VersionPrefix = "5.0";
internal static void EnsureCorrectVersion(DependencyContext dependencyContext)
{
if (!dependencyContext.Target.Framework.EndsWith(VersionPrefix))
{
throw new InvalidOperationException(
$"This version of {TestFrameworkName} only supports target framework ASP.NET Core {VersionPrefix}");
}
}
}
@grinay I will publish packages for .NET 6 in a week. Stay tuned!
@ivaylokenov thanks.)
Hi @ivaylokenov , first of all: great work on this super useful package that I have used in several projects already. I was wondering when the version for .NET 6 will be published since we're migrating to it and of course would like to migrate the unit tests for our controllers as well without rework ;) Thanks in advance!
Hi @ivaylokenov any update on .net 6 version?
@grinay I will publish packages for .NET 6 in a week. Stay tuned!
Any update on this? Can we expect a .net 6 version in the near future?
Hi Ivo, can we expect dotnet 6 soon, if money is needed we can also provide some? @ivaylokenov
@ivaylokenov Yeah, it will be highly appreciated (.NET 6)
+1