Dear all,
I'm currently having a couple of questions with using custom code-behind code and the related process in getting it to run with MSTest.
First of all: having a normal Test Studio project, purely created with the built-in features, I can commit it to Git, and run it on TeamCity by doing mstest /testcontainer:.\foobar.tstest
But, as soon as we have custom code-behind we run into the following issues:
You need to export from Test Studio to Visual Studio. This is a one way, one time operation, meaning changes in folder structure and adding new tests are not reflected in the csproj. Worse, we cannot export again since the Studio tells me: hey, the csproj is already there. <full stop>. I need to go on disk, delete the csproj and regenerate it through Test Studio.
Second: when we change the folder structure inside an exported csproj, for example:
Say foo.tstest is a 'shared' test, thus we want to put it into a folder, we create a new folder and move the foo.tstest there:
This causes the project to fail at runtime when we run bar.tstest or baz.tstest since their internal reference to foo.tstest doesn't get updated. Only way to mitigate this is opening each test in Visual Studio and saving it again, or opening the project in Test Studio and then closing it again (which seems to detect the movement).
Both of these things are quite cumbersome if we want to use MSTest to run our tests.
Am I not using the correct options to mitigate this problems?
Thanks,
-Kristof
I'm currently having a couple of questions with using custom code-behind code and the related process in getting it to run with MSTest.
First of all: having a normal Test Studio project, purely created with the built-in features, I can commit it to Git, and run it on TeamCity by doing mstest /testcontainer:.\foobar.tstest
But, as soon as we have custom code-behind we run into the following issues:
You need to export from Test Studio to Visual Studio. This is a one way, one time operation, meaning changes in folder structure and adding new tests are not reflected in the csproj. Worse, we cannot export again since the Studio tells me: hey, the csproj is already there. <full stop>. I need to go on disk, delete the csproj and regenerate it through Test Studio.
Second: when we change the folder structure inside an exported csproj, for example:
<
root
>
- foo.tstest
- bar.tstest
- baz.tstest
Say foo.tstest is a 'shared' test, thus we want to put it into a folder, we create a new folder and move the foo.tstest there:
<
root
>
- Shared
- foo.tstest
- bar.tstest
- baz.tstest
This causes the project to fail at runtime when we run bar.tstest or baz.tstest since their internal reference to foo.tstest doesn't get updated. Only way to mitigate this is opening each test in Visual Studio and saving it again, or opening the project in Test Studio and then closing it again (which seems to detect the movement).
Both of these things are quite cumbersome if we want to use MSTest to run our tests.
Am I not using the correct options to mitigate this problems?
Thanks,
-Kristof