mercredi 2 septembre 2015

VB.NET unit test project create an instance of another project

I have a built out project called MyProject that I want to start unit testing. I created a unit test project within the solution called MyProjectTest. There are multiple functions I want to test but my problem is that most functions refer to a global variable within a module in MyProject.

So when I call a function and pass it the required parameters everything is fine until it tries to reference this global variable which it thinks is empty. I can set this global variable in my test project, but it keeps looking at MyProject global variable instead of the one I made in MyProjectTest.

Can I create an instance of MyProject and then set this variable there ? How do i get the function to look at MyProjectTest variables.

Aucun commentaire:

Enregistrer un commentaire