title: Exclude MSTest tests from specific classes in TeamCity steps
body: <p>Because you <a href="https://stackoverflow.com/q/15810215/419956">can't</a> set a Test Category on a Test Class with MSTest, I've opted to do something similar in the name, postfixing test classes with <code>...IntegrationTests</code> whenever they contain slow running tests.</p>
  
  <p>In the Visual Studio Test Explorer I can exclude these tests by using:</p>
  
  <pre><code>-class:IntegrationTests
  </code></pre>
  
  <p>However, in TeamCity, this option doesn't work. I'm using the VSTest 2017 test engine version in the latest version of TeamCity. However, it seems it only has a <code>TestCaseFilter</code> option that seems to be missing the option to exclude tests in a certain class? </p>
  
  <p>I used <a href="https://msdn.microsoft.com/en-us/library/jj155796.aspx" rel="nofollow noreferrer">this VSTest.ConsoleRunner documentation</a> and <a href="https://blogs.msdn.microsoft.com/vikramagrawal/2012/07/23/running-selective-unit-tests-in-vs-2012-rc-using-testcasefilter/" rel="nofollow noreferrer">this post about the <code>TestCaseFilter</code></a> to reach that conclusion. I've also read through the <a href="https://msdn.microsoft.com/en-us/library/jj635153.aspx" rel="nofollow noreferrer">runsettings file documentation</a> to see if it contains any info, but no luck.</p>
  
  <p>My goal is to have 1 TeamCity step that runs all tests in classes that are <em>not</em> "marked" as being slow, and another followup step with the tests in classes that <em>are</em> marked.</p>
  
  <p>The only workaround I currently see would be to split <em>all</em> of my test projects into two projects, and move those integration test classes to separate assemblies. I'd rather not do that.</p>
  
  <p>Bottom line: <strong>how to exclude tests in classes where the class name contains a specific string?</strong></p>