@@ -0,0 +1,2629 @@
+package com.google.sps.objects;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.google.appengine.api.datastore.DatastoreService;%0Aimport com.google.appengine.api.datastore.DatastoreServiceFactory;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;%0Aimport com.google.appengine.tools.development.testing.LocalServiceTestHelper;%0Aimport com.google.sps.Objects.Option;%0A%0A/**%0A * This class tests the methods in the Option class.%0A *%0A * @author lucyqu%0A */%0Apublic class OptionTest %7B%0A%0A  private final LocalServiceTestHelper helper =%0A      new LocalServiceTestHelper(%0A          new LocalDatastoreServiceTestConfig()%0A              .setDefaultHighRepJobPolicyUnappliedJobPercentage(0));%0A%0A  private Option option;%0A%0A  @Before%0A  public void setUp() %7B%0A    helper.setUp();%0A    option = new Option(100, %22Swim%22, new ArrayList%3CString%3E());%0A  %7D%0A%0A  @After%0A  public void tearDown() %7B%0A    helper.tearDown();%0A    option = null;%0A  %7D%0A%0A  @Test%0A  public void getTextTest() %7B%0A    assertEquals(option.getText(), %22Swim%22);%0A  %7D%0A%0A  @Test%0A  public void addVoteGetVotesTest() %7B%0A    option.addVote(%221%22);%0A    option.addVote(%222%22);%0A    assert option.getVotes().size() == 2;%0A    assertEquals(option.getVotes().get(0), %221%22);%0A    assertEquals(option.getVotes().get(1), %222%22);%0A  %7D%0A%0A  @Test%0A  public void getIdTest() %7B%0A    assert option.getId() == 100;%0A  %7D%0A%0A  @Test%0A  public void toEntityTest() %7B%0A    Entity entity = option.toEntity();%0A    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();%0A    datastore.put(entity);%0A    assertEquals(entity.getProperty(%22text%22), %22Swim%22);%0A    ArrayList%3CString%3E votes = (ArrayList%3CString%3E) entity.getProperty(%22votes%22);%0A    assert votes.size() == 0;%0A  %7D%0A%0A  @Test%0A  public void fromEntityTest() %7B%0A    Entity entity = new Entity(%22Option%22);%0A    entity.setProperty(%22text%22, %22Run%22);%0A    List%3CString%3E votes = new ArrayList%3CString%3E();%0A    votes.add(%221%22);%0A    votes.add(%222%22);%0A    votes.add(%223%22);%0A    entity.setProperty(%22votes%22, votes);%0A%0A    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();%0A    datastore.put(entity);%0A%0A    Option returnedOption = Option.fromEntity(entity);%0A    assertEquals(returnedOption.getText(), %22Run%22);%0A    List%3CString%3E returnedVotes = (ArrayList%3CString%3E) entity.getProperty(%22votes%22);%0A    assert returnedVotes.size() == 3;%0A    assertEquals(returnedVotes.get(0), %221%22);%0A    assertEquals(returnedVotes.get(1), %222%22);%0A    assertEquals(returnedVotes.get(2), %223%22);%0A  %7D%0A%7D%0A

add OptionTest class