What Is A JUnit Test Fixture


  • 20 Jan, 2012

    A test fixture is a fixed state of a set of objects used as a baseline for running tests. The purpose of a test fixture 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 objectsIn other word, creating a test fixture is to create a set of objects initialized to certain states.If a group of tests requires diferent test fixtures, you can write code inside the test method to create its own test fixture.If a group of tests shares the same fixtures, you should write a separate setup code to create the common test fixture.

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.