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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -