Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created May 6, 2018 15:13
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 angelovstanton/96f836c8c3cfad96c546adce0490b7b4 to your computer and use it in GitHub Desktop.
Save angelovstanton/96f836c8c3cfad96c546adce0490b7b4 to your computer and use it in GitHub Desktop.
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MSTestUnitTests
{
// A class that contains MSTest unit tests. (Required)
[TestClass]
public class YourUnitTests
{
[AssemblyInitialize]
public static void AssemblyInit(TestContext context)
{
// Executes once before the test run. (Optional)
}
[ClassInitialize]
public static void TestFixtureSetup(TestContext context)
{
// Executes once for the test class. (Optional)
}
[TestInitialize]
public void Setup()
{
// Runs before each test. (Optional)
}
[AssemblyCleanup]
public static void AssemblyCleanup()
{
// Executes once after the test run. (Optional)
}
[ClassCleanup]
public static void TestFixtureTearDown()
{
// Runs once after all tests in this class are executed. (Optional)
// Not guaranteed that it executes instantly after all tests from the class.
}
[TestCleanup]
public void TearDown()
{
// Runs after each test. (Optional)
}
// Mark that this is a unit test method. (Required)
[TestMethod]
public void YouTestMethod()
{
// Your test code goes here.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment