package twitter;

import com.vividsolutions.jts.geom.Coordinate;
import org.junit.Before;
import org.junit.Test;
import structure.Agent;

import java.util.Date;

import static org.junit.Assert.assertEquals;

/**
 * Created by gijspeters on 03-10-16.
 */
public class TweetTest {

    Tweet tweet;

    @Before
    public void setUp() throws Exception {
        TwitterUser user = new TwitterUser("Gijs", "123");
        Agent agent = new Agent(456);
        agent.add(user);
        Coordinate coord = new Coordinate(4.889, 52.37);
        Date date = new Date(1449316800000L);
        tweet = new Tweet(coord, date, agent, user, "bla");
    }

    @Test
    public void getMessage() throws Exception {
        assertEquals("bla", tweet.getMessage());
    }

    @Test
    public void getLocation() throws Exception {
        assertEquals(4.889, tweet.getLocation().x, 0);
    }

    @Test
    public void getDate() throws Exception {
        assertEquals(1449316800000L, tweet.getDate().getTime());
    }

    @Test
    public void getAgent() throws Exception {
        assertEquals(456, tweet.getAgent().getAgentId());
    }

    @Test
    public void getUser() throws Exception {
        assertEquals("Gijs", tweet.getUser().getName());
    }

}
@@ -199,16 +199,53 @@
 tEquals;
+%0Aimport static org.junit.Assert.fail;
 %0A%0A/**%0A *
@@ -1277,9 +1277,448 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void constructorTest() throws Exception %7B%0A        TwitterUser user = new TwitterUser(%22Gijs%22, %22123%22);%0A        Agent agent = new Agent(456);%0A        Coordinate coord = new Coordinate(4.889, 52.37);%0A        Date date = new Date(1449316800000L);%0A%0A        try %7B%0A            Tweet tweet = new Tweet(coord, date, agent, user, %22bla%22);%0A%0A        %7D catch (AssertionError e) %7B%0A            return;%0A        %7D%0A        fail();%0A    %7D%0A%0A
 %7D

Add test to check assertion of agent containing user in constructor Anchor