Closed remcoros closed 5 years ago
Thanks for contacting us, @remcoros. @javiercn, can you please look into this? Thanks!
@remcoros I'm not sure there's an alternative way for us to infer the test assembly automatically other than the approach we take here. If I'm missing something feel free to suggest and alternative (we will take suggestions/PRs here as long as they are not runner specific).
Alternatively, the recommended way is to extend WebApplicationFactory and override the GetTestAssemblies method to manually provide the test assembly.
@javiercn I couldn't think of anything either, but wanted to report it. In case someone has a suggestion. Let's see what Jetbrains can do, else I'll have to use GetTestAssemblies.
@remcoros That's the main reason there's an extensibility point defined there.
Closing as it seems there is no good way to achieve this. Per @javiercn's point, there is an extensibility point to provide custom implementation, if necessary.
👍 thanks for looking at it.
Is this a Bug or Feature request?
A bug report for AspNetCore.Mvc.Testing package
Steps to reproduce:
Example project: https://github.com/remcoros/MvcTestingReSharper
It's the default file new -> asp core template.
Description of the problem:
When using MS.AspNetCore.Mvc.Testing on .net framework, I get the following exception when using the ReSharper test runner:
I've tracked the cause of this down to: https://github.com/aspnet/Mvc/blob/master/src/Microsoft.AspNetCore.Mvc.Testing/WebApplicationFactory.cs#L218 where the location of the web project is determined.
It uses AppDomain.FriendlyName, but this turns out to be not so consistent. E.g. ReSharper domains are called "Entryway", and when disabling appdomains, it's called "Tests: {AssemblyName}".
I reported this to JetBrains here: https://youtrack.jetbrains.com/issue/RSRP-472316?replyTo=27-3174095
As seen in the comments there, using FriendlyName might not always work.
Version of
Microsoft.AspNetCore.Mvc
orMicrosoft.AspNetCore.App
orMicrosoft.AspNetCore.All
:2.1.6