mercredi 18 novembre 2020

How to write parameterized test in kotlin with testng framework?

I would like to write a parameterized test in Kotlin with test, similar to C# with NUnit:

[Test]
[TestCase(123)]
[TestCase(321)]
public void Test(int p) {
    Assert.IsTrue(p > 100);
}

But I don't know how to do it in Kotlin, I only know the @Test annotation, but there are no the analogy to [TestCase] attribute. How can I do this? Thanks.

Aucun commentaire:

Enregistrer un commentaire