1.

What Is Junit Test Fixture?

Answer»

A test fixture is a fixed state of a set of objects used as a baseline for running tests. Their purpose is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. Examples of fixtures:

  • Loading a database with a SPECIFIC, known set of data
  • Copying a specific known set of files
  • Preparation of input data and setup/creation of FAKE or mock objects

If a group of tests shares the same fixtures, you should WRITE a SEPARATE setup code to create the common test fixture. If a group of tests REQUIRES different test fixtures, you can write code inside the test method to create its own test fixture.

A test fixture is a fixed state of a set of objects used as a baseline for running tests. Their purpose is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. Examples of fixtures:

If a group of tests shares the same fixtures, you should write a separate setup code to create the common test fixture. If a group of tests requires different test fixtures, you can write code inside the test method to create its own test fixture.



Discussion

No Comment Found