This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package net.micode.notes;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* 示例本地单元测试类
* 功能:演示JUnit框架在Android项目中的基本用法
* 运行环境:开发主机(非Android设备)
* 测试范围:不依赖Android系统API的纯Java逻辑
*/
public class ExampleUnitTest {
* 加法运算测试方法
* 测试目标:验证2 + 2的结果是否等于4
* 断言类型:assertEquals(预期值,实际值)
@Test
public void addition_isCorrect() {
// 验证整数加法运算的正确性
// 若2 + 2不等于4,测试将失败并抛出AssertionError
assertEquals(4, 2 + 2);
}