Mid Testing

How do you organize test classes and test collections in xUnit?

  • Group related tests in the same class.
  • Use Collection attribute to group classes that share setup/teardown or should not

run in parallel.

[Collection("Database collection")]

public class TestClass1 { }

[Collection("Database collection")]

public class TestClass2 { }

More from C# Programming Tutorial

All questions for this course