musicprofiletest.java

来自「We intend to develop a wifi enabled p2p 」· Java 代码 · 共 86 行

JAVA
86
字号
/**
* Filename: FileInfoTest.java
*
* Test Type: Blackbox Unit Test
*
* Description: Tests all setter methods in MusicProfile Class
*
* Project: Linux-WIFI Project (Group 38 - CS 329)
* Submitted by: Faisal Razzaq (razzaq) and Srinivas Kattragadda (kattraga)
*
* Last Updated On: 3/11/03
*/
package edu.uiuc.cs.cs327.linuxwifi.services;

import java.lang.String;
import junit.framework.*;


/**
* This class should test the MusicProfile Class
*/
public class MusicProfileTest extends TestCase {

	private	MusicProfile musicProfile = new MusicProfile();

	/**
	* This method tests the setFileFormat() method
	*/
	public void testSetFileFormatMethod() {
		musicProfile.setFileFormat("mpeg");

		String expectedFileFormat = "mpeg";
		String musicProfileFileFormat = musicProfile.getFileFormat();

		Assert.assertTrue(expectedFileFormat.equals(musicProfileFileFormat));
	}

	/**
	* This method tests the setMaxFileSize() method
	*/
	public void testSetMaxFileSizeMethod() {
		musicProfile.setMaxFileSize(50000);

		int expectedMaxFileSize = 50000;
		int musicProfileMaxFileSize = musicProfile.getMaxFileSize();

		Assert.assertTrue(expectedMaxFileSize == musicProfileMaxFileSize);
	}

	/**
	* This method tests the setArtist() method
	*/
	public void testSetArtistMethod() {
		musicProfile.setArtist("Srini");

		String expectedArtist = "Srini";
		String musicProfileArtist = musicProfile.getArtist();

		Assert.assertTrue(expectedArtist.equals(musicProfileArtist));
	}

	/**
	* This method tests the setSong() method
	*/
	public void testSetSongMethod() {
		musicProfile.setSong("ILU ILU");

		String expectedSong = "ILU ILU";
		String musicProfileSong = musicProfile.getSong();

		Assert.assertTrue(expectedSong.equals(musicProfileSong));
	}

	/**
	* This method tests the setGenre() method
	*/
	public void testSetGenreMethod() {
		musicProfile.setGenre("pop");

		String expectedGenre = "pop";
		String musicProfileGenre = musicProfile.getGenre();

		Assert.assertTrue(expectedGenre.equals(musicProfileGenre));
	}

}

⌨️ 快捷键说明

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