Contents

  1. ./DVDTest.java
  2. ./MediaItemTest.java

./DVDTest.java 1/2

[
top][prev][next]
package media.tests;

import static org.junit.Assert.*;

import java.util.GregorianCalendar;

import media.DVD;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class DVDTest {
	
	DVD mydvd;
	
	@Before
	public void setUp() throws Exception {
		mydvd = new DVD("That Thing You Do!", 6480, new GregorianCalendar(
				1996, 9, 4), "PG", 3600);
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetLength() {
		assertEquals(10080, mydvd.getLength());
	}

	@Test
	public void testToString() {
		assertEquals("*** DVD\nCurrently in the library: true\nTitle: That Thing You Do!\nLength:  2:48:00\nCopyright Year: 1996\nRating: PG", mydvd.toString());
	}

	@Test
	public void testGetBonusLength() {
		assertEquals(3600, mydvd.getBonusLength());
	}

	@Test
	public void testGetRating() {
		assertEquals("PG", mydvd.getRating());
	}

}

./MediaItemTest.java 2/2

[
top][prev][next]
/**
 * 
 */
package media.tests;

import static org.junit.Assert.*;

import java.util.GregorianCalendar;

import media.DVD;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * @author sprenkle
 *
 */
public class MediaItemTest {

	DVD mydvd;
	
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		mydvd = new DVD("That Thing You Do!", 6480, new GregorianCalendar(
				1996, 9, 4), "PG", 3600);
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	}

	/**
	 * Test method for {@link media.MediaItem#getCopyrightDate()}.
	 */
	@Test
	public void testGetCopyrightDate() {
		assertEquals(new GregorianCalendar(1996, 9, 4), mydvd.getCopyrightDate());
	}

	/**
	 * Test method for {@link media.MediaItem#getCopyrightYear()}.
	 */
	@Test
	public void testGetCopyrightYear() {
		assertEquals(1996, mydvd.getCopyrightYear());
	}

	/**
	 * Test method for {@link media.MediaItem#getFormattedPlayTime()}.
	 */
	@Test
	public void testGetFormattedPlayTime() {
		assertEquals("02:48:00", mydvd.getFormattedPlayTime());
	}

}

Generated by GNU enscript 1.6.4.