jeudi 10 novembre 2016

NUnit How will I get two data sources for my single testcase

I have test data in LocationTestData class

public static IEnumerable ValidLoc
  {
        get
        {
            yield return new TestCaseData("AAA", "QQQQ"); //LocationID and Postal Code               
        }
    }

    public static IEnumerable ValidPass
    {
        get
        {
            yield return new TestCaseData("BBBB", "WWWW"); //LocationID and Postal Code               
        }
    }

And here is my Test Case

 [Test, TestCaseSource(typeof(LocationTestdata),"ValidLoc")]    
    public void Return(string value1, string value2, string value3, string value4)
    {


    }

the error is Not enough arguments provided.

I have tried in this way, but no luck

[Test, TestCaseSource(typeof(LocationTestdata),"ValidLoc")]
[Test, TestCaseSource(typeof(LocationTestdata),"ValidPass")]     
    public void Return(string value1, string value2, string value3, string value4)
    {


    }

Any Ideas around?

Aucun commentaire:

Enregistrer un commentaire