Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to specify order of test in c#

[TestClass]
public class OrderedTests
{
    public TestContext TestContext { get; set; }

    private const string _OrderedTestFilename = "TestList.csv";

    [TestMethod]
    [DeploymentItem(_OrderedTestFilename)]
    [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", _OrderedTestFilename, _OrderedTestFilename, DataAccessMethod.Sequential)]
    public void OrderedTests()
    {
        var methodName = (string)TestContext.DataRow[0];
        var method = GetType().GetMethod(methodName);
        method.Invoke(this, new object[] { });
    }

    public void Method_01()
    {
        Assert.IsTrue(true);
    }

    public void Method_02()
    {
        Assert.IsTrue(false);
    }

    public void Method_03()
    {
        Assert.IsTrue(true);
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to reset disk permission 
Csharp :: List picking records from database 
Csharp :: sqlsinifi.baglanti.open() 
Csharp :: @using System,System.Core 
Csharp :: c# generic type converter 
Csharp :: virtual properties and lazy loading in c# 
Csharp :: uity pause game 
Csharp :: you have the following c# code. stringbuilder sb = new stringbuilder(really long string); the really long string variable is a string in which a very long string is stored. 
Csharp :: read dxf file c# 
Csharp :: openiddect ef core table not creating 
Csharp :: query to linq converter online 
Csharp :: c# switch expression 8.0 
Csharp :: How to get 4 end len in string c# 
Csharp :: how to add the ssl certificate in vb.net application 
Csharp :: unity blender shadow messed up 
Csharp :: remove last character from stringbuilder c# 
Csharp :: radio buttons into database stackoverflow 
Csharp :: Options Pattern how to use 
Csharp :: if equal statement c# 
Csharp :: internal static object ds 
Csharp :: viewresolver cyrillic 
Csharp :: death transition unity 2d 
Csharp :: Open Windows Explorer to a certain directory from within a WPF app 
Csharp :: .net form binding why cant i skip index 
Csharp :: report background worker 
Csharp :: how to authorize token when consuming api in c# 
Csharp :: Nested objects with linq expression 
Csharp :: how to get the size of an array in c# 
Csharp :: c# convert string to datetime 
Csharp :: unity c# flip sprite 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =