Skip to main content

An empty Visual Studio C# Unit Test class template.

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace MyTests
{
    [TestClass]
    public class MyClassTests
    {
        public MyClassTests()
        {
        }

        #region Test Attributes

        /// <summary>
        /// Use this method to run code before running the first test in the class.
        /// </summary>
        /// <param name="testContext">The test context.</param>
        [ClassInitialize]
        public static void ClassInitialize(TestContext testContext)
        {
        }

        /// <summary>
        /// Use this method to run code after all tests in a class have run.
        /// </summary>
        [ClassCleanup]
        public static void ClassCleanup()
        {
        }

        /// <summary>
        /// Use this method to run code before running each test.
        /// </summary>
        [TestInitialize]
        public void TestInitialize()
        {
        }

        /// <summary>
        /// Use this method to run code after each test has run.
        /// </summary>
        [TestCleanup]
        public void TestCleanup()
        {
        }

        #endregion

        /// <summary>
        /// Gets or sets the test context which provides
        /// information about and functionality for the
        /// current test run.
        ///</summary>
        public TestContext TestContext { get; set; }
    }
}