Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>EDIT 4</strong>: Looks like this is completed in MSTest V2 June 17, 2016: <a href="https://blogs.msdn.microsoft.com/visualstudioalm/2016/06/17/taking-the-mstest-framework-forward-with-mstest-v2/">https://blogs.msdn.microsoft.com/visualstudioalm/2016/06/17/taking-the-mstest-framework-forward-with-mstest-v2/</a></p> <p><strong>Original Answer</strong>:</p> <p>As of about a week ago in Visual Studio 2012 Update 1 something similar is now possible:</p> <pre><code>[DataTestMethod] [DataRow(12,3,4)] [DataRow(12,2,6)] [DataRow(12,4,3)] public void DivideTest(int n, int d, int q) { Assert.AreEqual( q, n / d ); } </code></pre> <p><strong>EDIT</strong>: It appears this is only available within the unit testing project for <strong>WinRT/Metro</strong>. Bummer</p> <p><strong>EDIT 2</strong>: The following is the metadata found using "Go To Definition" within Visual Studio:</p> <pre><code>#region Assembly Microsoft.VisualStudio.TestPlatform.UnitTestFramework.dll, v11.0.0.0 // C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\MSTestFramework\11.0\References\CommonConfiguration\neutral\Microsoft.VisualStudio.TestPlatform.UnitTestFramework.dll #endregion using System; namespace Microsoft.VisualStudio.TestPlatform.UnitTestFramework { [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class DataTestMethodAttribute : TestMethodAttribute { public DataTestMethodAttribute(); public override TestResult[] Execute(ITestMethod testMethod); } } </code></pre> <p><strong>EDIT 3</strong>: This issue was brought up in Visual Studio's UserVoice forums. Last Update states: </p> <blockquote> <p>STARTED · Visual Studio Team ADMIN Visual Studio Team (Product Team, Microsoft Visual Studio) responded · April 25, 2016 Thank you for the feedback. We have started working on this.</p> <p>Pratap Lakshman Visual Studio</p> </blockquote> <p><a href="https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/3865310-allow-use-of-datatestmethod-datarow-in-all-unit">https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/3865310-allow-use-of-datatestmethod-datarow-in-all-unit</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload