Answers for "check multiple parameters in same line c# unit testing"

C#
0

check multiple parameters in same line c# unit testing

[Test]
public void Test_with_many_parameters (

    // this will generate 2 values: true, false
    [Values] bool flag,

    // this will generate 3 values: Monday, Wednesday, Friday
    [Values(DayOfWeek.Monday, DayOfWeek.Wednesday, DayOfWeek.Friday)] DayOfWeek dayOfWeek,

    // this will generate 2 values: X, Y
    [Values("X", "Y")] string testLetter,

    // this will generate 3 random values between -10 and 10
    [Random(-10, 10, 3)] int randomValue,

    // this will generate 7 values: -3, -2, -1, 0, 1, 2, 3
    [Range(-3, 1, 3)] int rangeValue,
    )
{
    Console.WriteLine($"{flag} {dayOfWeek} {testLetter} {randomValue} {rangeValue}");
    Assert.Pass();
}
Posted by: Guest on October-07-2021

Code answers related to "check multiple parameters in same line c# unit testing"

C# Answers by Framework

Browse Popular Code Answers by Language