0

I'm trying to have a test class for the VS test framework, that is derived from another test class and inherits all its test methods (so that each appears twice). This was suggested in a comment on another ticket.

When this is done within the same project, it works fine. When done across projects, everything compiles fine but the new tests don't show up.

In this minimal solution, the problem is demonstrated. Two projects, in each we derive from the same base class in the first project. But the new (duplicate) tests only show up for the same-project child class.

I suspect something is optimized away in someway, but don't know what or how top debug this. I tried adding a dummy TestMethod to the second-project test class, just so that something must happen with the class - then only this test method shows, without the derived methods. Suggestions would be appreciated.

  • I was curious because I never did that. Tested it with two new unit test projects and it works for me. Maybe you can prepare a [mcve] so we can spot where it went sideways? – nvoigt Dec 11 '18 at 14:22
  • Do you use .NET Core or full framework? – nvoigt Dec 11 '18 at 14:24
  • @novigt I provided a link to a minimal example. Is that not sufficient? FWIW, I use VS2013, .net full framework. – Yosef Meller Dec 11 '18 at 14:37
  • hm, I tested only with 2017, I don't have older versions available. The minimal solution is probably fine, but many people (including me) don't want or simply cannot download files from unknown sources. – nvoigt Dec 11 '18 at 14:39
  • Tested on 2017 and you're right - it works there. I guess it's just a VS2013 bug then. – Yosef Meller Dec 11 '18 at 15:27

0 Answers0