Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What Is JUnit TestCase?
What Is JUnit TestCase?
✍: FYICenter.com QA Team
JUnit TestCase is the base class, junit.framework.TestCase, used in JUnit 3.8 that allows you to create a test case. TestCase class is no longer supported in JUnit 4.4.
A test case defines the fixture to run multiple tests. To define a test case
Each test runs in its own fixture so there can be no side effects among test runs. Here is an example:
import junit.framework.*;
// by FYICenter.com
public class MathTest extends TestCase {
protected double fValue1;
protected double fValue2;
protected void setUp() {
fValue1= 2.0;
fValue2= 3.0;
}
public void testAdd() {
double result= fValue1 + fValue2;
assertTrue(result == 5.0);
}
}
2008-02-26, 6256👍, 0💬
Popular Posts:
What is V model in testing? V model map’s the type of test to the stage of development in a project....
How To Decrement Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...
How To Call a Sub Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions To...
What Happens If One Row Has Missing Columns? - XHTML 1.0 Tutorials - Understanding Tables and Table ...
What is the difference between Session State and ViewState? ViewState is specific to a page in a ses...