利率计算v4.0--测试
package Test;

import Model.Interest;
import Service.CompoundInterestService;
import Service.OrInterestService;
import Service.PrincipalService;
import Service.SingleInterestService;
import org.junit.Test; /**
* Created by pc on 2016/3/28.
*/
public class TestInterest {
@Test
public void testInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(interest.getInterest() +" "+ interest.getPrincipal() +" "+ interest.getYear());
} @Test
public void testOrInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(new OrInterestService().orInterest("compound" , interest));
System.out.println(new OrInterestService().orInterest("single" , interest));
} @Test
public void testCompoundInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(new CompoundInterestService().calculate(interest));
} @Test
public void testSingleInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(new SingleInterestService().calculate(interest));
} @Test
public void testPrincipal(){
Interest interest = new Interest();
interest.setAmount(1000);
interest.setYear(10);
interest.setInterest(0.5);
System.out.println(new PrincipalService().calculate(interest));
} @Test
public void testYear(){
Interest interest = new Interest();
interest.setAmount(1000);
interest.setPrincipal(10000);
interest.setInterest(0.5);
System.out.println(new PrincipalService().calculate(interest));
} @Test
public void testLong(){
Interest interest = new Interest();
interest.setAmount(1000000000);
interest.setPrincipal(1000000000);
interest.setInterest(0.000000000001);
System.out.println(new PrincipalService().calculate(interest));
} @Test
public void test_01(){
Interest interest = new Interest();
interest.setAmount(1);
interest.setPrincipal(1);
interest.setInterest(1);
System.out.println(new PrincipalService().calculate(interest));
} }
<script type="text/javascript">
function check(form){
if (document.forms.compoundInterest.principal.value == ""){
alert("请输入本金 !");
document.forms.compoundInterest.principal.focus();
return false;
}
if (document.forms.compoundInterest.interestRate.value == ""){
alert("请输入利率 !");
document.forms.compoundInterest.interestRate.focus();
return false;
}
if (document.forms.compoundInterest.year.value == ""){
alert("请输入年份 !");
document.forms.compoundInterest.year.focus();
return false;
}
}
</script>

测试模块

测试数据

终值

 运行结果  bug跟踪

输入是否

正确

本金:(1000);

年限:(10);

利息:(0.5);

(0.5,1000,10)

 

单利/复利

选择

插入 字符串 选择
"compound" /"single"

复利

计算

本金:(1000);

年限:(10);

利息:(0.5);

57665.04

单利

计算

 本金:(1000);

年限:(10);

利息:(0.5);

 15000.00   √  

本金

计算

本利之和:(1000);
年限:(10);
利息: (0.5);
17.34  √  

年限

计算

本利之和:(1000);
本金:(10000);
利息: (0.5);
1000.00   

算法

有误

测试

数值

本利之和:(1000000000);
本金:(1000000000);
利息: (0.000000000001);

1000000000.00   

超出类型

上限

测试

数值

本利之和:(1);
本金:(1);
利息: (1);
1.00  

利息应为

浮点型

测试

数值

插入 空 数据
提交

提出警告

并且不能提交数据

 

利率计算v4.0--测试--软件工程的更多相关文章

  1. 利率计算v5.0--结对--软件工程

    利率计算v5.--测试--软件工程 1.任务结对同伴: 名字:王昕明 学号: 博客地址 :http://home.cnblogs.com/u/xinmingwang/ Git : https://gi ...

  2. 利率计算v2.0--web版--软件工程

    .客户说:帮我开发一个复利计算软件. .如果按照单利计算,本息又是多少呢? .假如30年之后要筹措到300万元的养老金,平均的年回报率是3%,那么,现在必须投入的本金是多少呢? .利率这么低,复利计算 ...

  3. 复利计算--4.0 单元测试之JAVA版-软件工程

    复利计算--4.0 单元测试-软件工程 前言:由于本人之前做的是C语言版的复利计算,所以为了更好地学习单元测试,于是将C语言版的复利计算修改为JAVA版的. 一.主要的功能需求细分: 1.本金为100 ...

  4. <更新日期03-31-2016> 复利计算5.0 <已改进>

    作业要求: 1.客户说:帮我开发一个复利计算软件. 完成复利公式计算程序,并成功PUSH到github上. 客户提出: 2.如果按照单利计算,本息又是多少呢? 3.假如30年之后要筹措到300万元的养 ...

  5. 没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限 的解决方案

    问题情况: 在64位机器上运行Web服务,然后在配置好之后测试访问的时候出现如下提示:

  6. 在 Ubuntu 14.04/15.04 上配置 Node JS v4.0.0

    大家好,Node.JS 4.0 发布了,这个流行的服务器端 JS 平台合并了 Node.js 和 io.js 的代码,4.0 版就是这两个项目结合的产物——现在合并为一个代码库.这次最主要的变化是 N ...

  7. [Bug]没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限

    问题 环境WIN8.1 x64,新安装的vs与iis,在部署网站时,出现该异常信息.本地机作为测试机,就部署一个站点进行测试,没想到出现这个错误. 解决方案 如果你访问上面的那个路径,你会发现并没有那 ...

  8. 小蔡计算器 V4.0新版全新发布上线啦~欢迎大家下载使用哈~

    小蔡计算器4.0新版全新发布上线啦~欢迎大家下载使用哦~ 立即下载:http://www.zhentiyuan.com/windows/index.aspx 软件介绍:小蔡计算器4.0是一款界面优美的 ...

  9. 最新安全狗 apache v4.0 sql注入 bypass

    前言 最近没事学习一下 waf 的 bypass , 本文介绍下 bypass 安全狗的笔记.个人感觉 bypass 的总思路(正则匹配型 waf)就是利用各种语法特性来逃避正则(当然要保证语法正确性 ...

随机推荐

  1. 在VS2008中使用WSE 3.0【转】

    原文:http://www.cnblogs.com/chenxizhang/archive/2008/07/25/1251626.html 在VS2008中使用WSE 3.0 WSE 是微软推出的一套 ...

  2. [Luogu4609][FJOI2016]建筑师

    luogu description 一个\(1...n\)的排列,其前缀最大值有\(A\)个,后缀最大值有\(B\)个,求满足要求的排列数. 一个位置\(i\)满足前缀最大当且仅当不存在\(j< ...

  3. CH1807 Necklace

    题意 背景 有一天,袁☆同学绵了一条价值连城宝石项链,但是,一个严重的问题是,他竟然忘记了项链的主人是谁!在得知此事后,很多人向☆同学发来了很多邮件,都说项链是自己的,要求他归还(显然其中最多只有一个 ...

  4. lerna基本试用

    安装 yarn global add lerna or npm install -g lerna 基本项目 初始化 git init platform cd platform lerna init 效 ...

  5. nexus bower 集成使用

    创建nexus bower proxy host 比较简单,如下图: 安装bower && bower-nexus resolver npm install -g bower-nexu ...

  6. 转 HTTP/2: The Long-Awaited Sequel

    HTTP/2: The Long-Awaited Sequel Thursday, October 9, 2014 2:01 AM 6 Ready to speed things up? Here a ...

  7. mysql中distinct

    1.Distinct 位置 单独的distinct只能放在开头,否则报错,语法错误,与其他函数使用时候,没有位置限制如下 Select player_id,count(distinct(task_id ...

  8. [CLPR]BP神经网络的C++实现

    文章翻译自: http://www.codeproject.com/Articles/16650/Neural-Network-for-Recognition-of-Handwritten-Digi ...

  9. Oracle本地网络服务名配置

    1.安装Oracle 11G Client后可以在开始菜单中找到 选择NETCA->本地网络服务名配置 选择添加本地网服务名配置 这里的服务名:指的是也就是数据库名 在网络中架设C/S 客户端选 ...

  10. [正经分析] DAG上dp两种做法的区别——拓扑序与SPFA

    在下最近刷了几道DAG图上dp的题目. 要提到的第一道是NOIP原题<最优贸易>.这是一个缩点后带点权的DAG上dp,它同时规定了起点和终点. 第二道是洛谷上的NOI导刊题目<最长路 ...