I'm starting research for my new C# WPF project with unit tests, decided to use MSTest for long-term and flexible lib developing (via this comparison), which I'll use for setting database to known state. I was wondering if there are more differences in MSTest .Core and .Framework then "usual" ones, like multiplatform solutions etc.
Second questions is also important, because my earlier projects are written on both types of .NET, but uses same database (same data logic), so developing two very similar test projects might be pointless at this point, I can use other framework like xUnit, which probably would be more flexible for such thing.
Actual answer is pretty obvious, although I had to test it myself
To test it out I created sample test with .Framework:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Answer;
using System.Runtime.InteropServices;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
Console.WriteLine(AnswerClass.SomeMethod());
}
}
}
and referenced my application .Core at Solution Explorer.
When I tried to build test project, compiler returned warning:
The project 'Answer' cannot be referenced. The referenced project is targeted to a different framework family (.NETCoreApp)
VS didn't inform me about such fact on test project creation, either Intellisense wasn't able to diagnose why is the project content unreferencable.
At this point I used xUnit, which can handle testing .Framework WPF with some .Core dependencies.