Last active
October 19, 2018 15:23
-
-
Save Keboo/5fab54168be2f47397a050982a86afda to your computer and use it in GitHub Desktop.
Data driven unit test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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