paymentservicetest.java

来自「这个是完整的wap项目的源码 开发语言 Java 系统架构 Struts +」· Java 代码 · 共 41 行

JAVA
41
字号
package com.longtime.wap.module.cost.service;

import java.util.List;

import com.longtime.wap.common.util.BaseTestCase;
import com.longtime.wap.common.web.Page;
import com.longtime.wap.model.Payment;

public class PaymentServiceTest extends BaseTestCase {

	private PaymentService service;
	
	public PaymentServiceTest() {
		super();
		service = (PaymentService)context.getBean("paymentService");
	}

	/*
	 * Test method for 'com.longtime.wap.module.cost.service.PaymentService.getPaymentById(Long)'
	 */
	public void testGetPaymentById() {
		Payment payment = service.getPaymentById(Long.valueOf(361));
        assertEquals(31,payment.getUserId());
        assertEquals(487,payment.getInformationId());
        assertEquals("2007-11-29 00:00:00.0",payment.getPayDate().toString());
        assertEquals("小白",payment.getInformationTitle());
        assertEquals(5.0,payment.getInformationPrice());
        assertEquals("春泉通讯",payment.getCpName());
        assertEquals("bulingchen",payment.getUserName());
	}

	/*
	 * Test method for 'com.longtime.wap.module.cost.service.PaymentService.getPayments(Page)'
	 */
	public void testGetPayments() {
        Page page = new Page(2);
        List list = service.getPayments(page);
        assertEquals(4,list.size());
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?