[ must do 1] for the triangle given in Appendix 1 to Judge Java code, the use of equivalent class partitioning method to design test cases, tabular form of the design of the test cases, written to the blog.
Test Case ordinal |
Three sides |
Test prophecy |
1 |
( -1,-2,-3) |
Illegal |
2 |
(1,1,3) |
Illegal |
3 |
(3,0,5) |
No equilateral triangle. |
4 |
(9,9,11) |
Isosceles Triangle |
5 |
(5,7,10) |
No equilateral triangle. |
6 |
(10,10,10) |
Equilateral triangle |
[ must do 2] imitate Appendix 2 gives the triangle judgment junit test Code, Design Unit test script, test [ must do 1] design of the test case. Note the order in which the test cases appear in the test script is consistent with the order listed in the [ required title 1] table. Run the resulting test script, truncate the result graph, write to the blog, and push the source code to your own github.
Package Triangle1;import static Org.junit.assert.*;import Org.junit.test;public class test1{ @Test Public void TestlsTringle1 () { Triangle1 t=new Triangle1 ( -1,-2,-3); Assertfalse (T.istriangle1 (t)); } @Test public void TestlsTringle2 () { Triangle1 t=new Triangle1 (1,1,3); Assertfalse (T.istriangle1 (t)); } @Test public void TestlsTringle3 () { Triangle1 t=new Triangle1 (3,0,5); Assertfalse (T.istriangle1 (t)); } @Test public void TestlsTringle4 () { Triangle1 t=new Triangle1 (9,9,11); Assertfalse (T.istriangle1 (t)); } @Test public void TestlsTringle5 () { Triangle1 t=new Triangle1 (5,7,10); Assertfalse (T.istriangle1 (t)); } @Test public void TestlsTringle6 () { Triangle1 t=new Triangle1 (10,10,10); Assertfalse (T.istriangle1 (t)); } }
5.16 of Jobs