Math test code for elementary school students

Source: Internet
Author: User

That's so hard.

211606361 Ho Chenghua
211606377 Qin One PA

I. Unit Testing

1. Need to write test code using JUnit plugin

Two. Code
@Test//test whether the passed parameter is correct public void test () {string[] str = {"-grade", "3", "N", "10"}; Assertequals (True, Mathexam6361.jibu (str));          } @Test//test the incoming grade over the range is correct public void test1 () {string[] str = {"-grade", "0", "N", "10"};            Assertequals (False, Mathexam6361.jibu (str));          } @Test//test that the number of incoming questions exceeds the range correctly public void Test2 () {string[] str = {"-grade", "3", "N", "101"};            Assertequals (False, Mathexam6361.jibu (str)); } @Test//test if the passed in parameter exceeds the range correctly public void Test3 () {string[] str = {"-grade", "0", "N", "101"}                ;          Assertequals (False, Mathexam6361.jibu (str));            } @Test//test whether the passed parameter is negative if the public void Test4 () {string[] str= {"-grade", "1", "N", "10"};   Assertequals (False, Mathexam6361.jibu (str));    } @Test//test incoming grade for decimal is correct public void Test5 () {string[] str = {"-grade", "3.0", "N", "10"}; Assertequals (True, Mathexam6361.jiBu (str)); }

}

Three. Class diagram

Iv. Summary

This is the current progress of the operation, and then I will continue to finish the national day

Math test code for elementary school students

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.