c# - Running Tests in different Assemblies -
when tried run tests vs shows message: "no tests found run."
this code:
public abstract class mybaseclasstests { protected irepository repository; [testmethod] public void test1 () { var x = this.repository.get("id); assert.areequal(x.id, "id"); } } [testclass] public class implementation1tests : mybaseclasstests { [testinitialize] public void setup() { this.repository= new memoryrepository(); } } [testclass] public class implementation2tests : mybaseclasstests { [testinitialize] public void setup() { this.repository= new sqlrepository("connectionstring..."); } }
all implementations in different test projects. (different assemblies)
any suggestion? or vs limitation?
apparently limitation in visual studio test runner mstest. issue test classes in different assemblies base fixture.
my test shows long base test fixture located in same assembly.
edit: no, nunit doesn't solve it. wrong.
the solution can offer not inherit tests. can have test helpers, each test must typed out each fixture.
edit2: this stack overflow duplicate suggests can link base class file each depending test assembly works around issue.
Comments
Post a Comment