Search Results for

    Show / Hide Table of Contents

    Sequential

    The SequentialAttribute is used on a test to specify that NUnit should generate test cases by selecting individual data items provided for the parameters of the test, without generating additional combinations.

    Note

    If parameter data is provided by multiple attributes, the order in which NUnit uses the data items is not guaranteed. However, it can be expected to remain constant for a given runtime and operating system. For best results with SequentialAttribute use only one data attribute on each parameter.

    Example

    The following test will be executed three times.

    [Test, Sequential]
    public void MyTest(
        [Values(1, 2, 3)] int x,
        [Values("A", "B")] string s)
    {
        /* ... */
    }
    

    MyTest is called three times, as follows:

    MyTest(1, "A")
    MyTest(2, "B")
    MyTest(3, null)
    

    See also

    • Combinatorial Attribute
    • Pairwise Attribute
    • Edit this page
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0