Hello!
Got a problem.
Explanation:
1. My allTests test suite, i'm trying to call BookTest class dontCare method.
package upakovka;
import junit.extensions.ActiveTestSuite;
import junit.extensions.RepeatedTest;
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.runner.*;
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite( );
suite.addTest(new BookTest("dontCare"));
return suite;
}
}
package upakovka;
import junit.framework.TestCase;
public class BookTest extends TestCase {
public BookTest(String string) {
}
public void testMyBook()
{
Book bk = new Book("title","Aleks");
assertEquals("Nazvanije ne vazno",bk.getTitle());
assertEquals("Aleks", kniga.getAuthor());
}
}
If i test only BookTest class, all works fine, but if i'm trying to test fromAllTests class, tests dont pass.
it tells me junit.framework.AssertionFailedError
Can someone tell me why?
Thanks