songstringtest.java
来自「mp3播放功能」· Java 代码 · 共 45 行
JAVA
45 行
package Function;
import java.io.File;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class SongStringTest {
public SongString song1;
private File mp3 = new File("cry on my shoulder.mp3");
private String nameExpected = "cry on my shoulder.mp3";
private String pathExpected = "C:\\Documents and Settings\\sony\\workspace\\" +
"OurMp3\\cry on my shoulder.mp3";
@Before
public void setUp() throws Exception {
song1 = new SongString("cry on my shoulder.mp3", mp3.getAbsolutePath());
}
@After
public void tearDown() throws Exception {
}
@Test
public void testGetName(){
assertEquals(nameExpected, song1.getName());
}
@Test
public void testGetPath(){
assertEquals(pathExpected, song1.getPath());
}
@Test
public void testToString(){
assertEquals(nameExpected, song1.getName());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?