Creative Commons Legal Code
Attribution-NonCommercial 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT C...
If you think the Android project AudioBook listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
* This work is licensed under the Creative Commons Attribution-NonCommercial-
* NoDerivs 3.0 Unported License. To view a copy of this license, visit
* http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to
* Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
* 94041, USA.//www.java2s.com
*
* Use of this work is permitted only in accordance with license rights granted.
* Materials provided "AS IS"; no representations or warranties provided.
*
* Copyright ? 2012 Marcus Parkkinen, Aki K?kel?, Fredrik ?hs.
**/package edu.chalmers.dat255.audiobookplayer.model;
import junit.framework.TestCase;
/**
* Test case for Tag.
*
* @author Aki K?kel?
* @version 0.1
*
*/publicclass TagTest extends TestCase {
private Tag tag;
privatestaticfinalint TIME = 21600000; // 6 hours
public TagTest(String name) {
super(name);
}
/*
* (non-Javadoc)
*
* @see junit.framework.TestCase#setUp()
*/
@Override
protectedvoid setUp() {
try {
super.setUp();
} catch (Exception e) {
// catch exceptions from super.setUp() and fail
fail("setUp failed + " + e.getMessage());
}
tag = new Tag(TIME);
}
publicvoid testGetTime() {
assertTrue(tag.getTime() == TIME);
}
publicvoid testEqualsObject() {
Tag dummy = new Tag(tag.getTime());
Tag otherDummy = new Tag(dummy.getTime());
// reflexive test
assertTrue(dummy.equals(dummy));
assertTrue(tag.equals(tag));
// symmetric test
assertTrue(tag.equals(dummy));
assertTrue(dummy.equals(tag));
// transitive test
assertTrue(tag.equals(otherDummy));
}
}