Package models.activity

Source Code of models.activity.NewTalkActivityTest

package models.activity;

import models.Talk;
import org.junit.*;

/**
* Unit tests for {@link UpdateSessionActivity} domain object
* @author Sryl <cyril.lacote@gmail.com>
*/
public class NewTalkActivityTest extends AbstractActivityTest {
   
    @Test
    public void validateSession() {
       
        Talk t = createTalk("test");
       
        // No activity for the talk
        assertEquals(0, Activity.count("session = ?", t));
        assertNull(Activity.find("session = ?", t).first());
       
        t.validate();
       
        // One activity for the session
        assertEquals(1, Activity.count("session = ?", t));
        Activity a = Activity.find("session = ?", t).first();
        assertActivity(a);
        assertTrue(a instanceof NewTalkActivity);
        NewTalkActivity nta = (NewTalkActivity) a;
        assertEquals(t, nta.session);
    }
}
TOP

Related Classes of models.activity.NewTalkActivityTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.