Commit bc8e98bc authored by Fjen Undso's avatar Fjen Undso
Browse files

test: add initial modeltest

parent 8c45e26c
import static org.junit.Assert.assertEquals;
import models.Session;
import models.Vote;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import play.test.FakeApplication;
import play.test.Helpers;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebeaninternal.server.ddl.DdlGenerator;
public class ModelTest {
public static FakeApplication app;
public static DdlGenerator ddl;
public static EbeanServer server;
public static void setup() {
app = Helpers.fakeApplication(Helpers.inMemoryDatabase());
public static void stopApp() {
public void testModel() {
// Sessions and votes
Session s1 = new Session("owner1", "Session1");
Vote v1 = new Vote(s1, "owner2", Vote.Type.SPEED, 1);
Vote v2 = new Vote(s1, "owner2", Vote.Type.UNDERSTANDABILITY, -1);
assertEquals(Session.find.all().size(), 1);
assertEquals(Vote.find.all().size(), 2);
assertEquals(Session.find.all().size(), 0);
assertEquals(Vote.find.all().size(), 0);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment