Skip to content

Instantly share code, notes, and snippets.

@Keboo
Last active October 19, 2018 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keboo/5fab54168be2f47397a050982a86afda to your computer and use it in GitHub Desktop.
Save Keboo/5fab54168be2f47397a050982a86afda to your computer and use it in GitHub Desktop.
Data driven unit test
Build started, please wait...
Build completed.
Test run for C:\Dev\unitTest\bin\Debug\netcoreapp2.1\unitTest.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 15.8.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Total tests: 2. Passed: 2. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 2.5293 Seconds
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace unitTest
{
[TestClass]
public class UnitTest1
{
private static TestContext Context;
[ClassInitialize]
public static void Init(TestContext context)
{
Context = context;
}
[DataTestMethod]
[DataRow("test 1")]
public void TestMethod1(string input)
{
Context.WriteLine(input);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment