1

I am currently building a mutationtest framework for .NET. I want to run the unit tests from a project on an in-memory assembly. This way the mutated assembly won't have to be writen to disk and my framework will be faster to use.

Using the Roslyn compiler in .Net Core 2.0 I mutate (change) the syntaxtree and compile it into an in-memory assembly like this:

Assembly assembly = AssemblyLoadContext.Default.LoadFromStream(ms);

Does anyone know of a way to unit test this assembly without writing it to a disk?

The current way I am doing it is writing it to disk and invoke the dotnet test command on the directory

Ped7g
  • 16,236
  • 3
  • 26
  • 63
  • You could try to write a TestAdapter (which has a test discovery that could, maybe, "discover" your assembly be passing it in) - although I'm not sure it will work at all or even make sense. Google for "testadapter vstest" for many examples of "conventional" test adapters (xunit, nunit, google, etc.). – Christian.K Feb 26 '18 at 12:15

0 Answers0