``` java
public class DateTimeUtilsTest {

    private void assertSameDateAndTime(LocalDateTime dateTime1, LocalDateTime dateTime2) {
        assertEquals(dateTime1, dateTime2);
    }

    private void assertSameDate(LocalDateTime dateTime1, LocalDateTime dateTime2) {
        LocalDateTime diff = dateTime1.minusHours(dateTime2.getHour()).minusMinutes(dateTime2.getMinute()).minusSeconds(dateTime2.getSecond());
        assertEquals(dateTime1, diff);
    }

    @Test
    public void parseNaturalLanguageDateTimeString_dateString_localDateTime() throws Exception {
        Optional<LocalDateTime> t = DateTimeUtils.parseNaturalLanguageDateTimeString("2016/01/01");
        assertSameDate(t.get(), LocalDateTime.of(2016,1,1,0,0));
    }

    @Test
    public void parseNaturalLanguageDateTimeString_dateStringWith24HRTime_localDateTime() throws Exception {
        Optional<LocalDateTime> t = DateTimeUtils.parseNaturalLanguageDateTimeString("2016/01/01 01:00");
        assertSameDateAndTime(t.get(), LocalDateTime.of(2016,1,1,1,0));
    }

    @Test
    public void parseNaturalLanguageDateTimeString_dateStringWithPMTime_localDateTime() throws Exception {
        Optional<LocalDateTime> t = DateTimeUtils.parseNaturalLanguageDateTimeString("2016/01/01 3pm");
        assertSameDateAndTime(t.get(), LocalDateTime.of(2016,1,1,15,0));
    }

    @Test
    public void parseNaturalLanguageDateTimeString_verboseDateString_localDateTime() throws Exception {
        Optional<LocalDateTime> t = DateTimeUtils.parseNaturalLanguageDateTimeString("january 10 2017");
        assertSameDate(t.get(), LocalDateTime.of(2017,1,10,0,0));
    }

    @Test
    public void parseNaturalLanguageDateTimeString_verboseDateStringWithTime_localDateTime() throws Exception {
        Optional<LocalDateTime> t = DateTimeUtils.parseNaturalLanguageDateTimeString("january 10 2017 5:15pm");
        assertSameDateAndTime(t.get(), LocalDateTime.of(2017,1,10,17,15));
    }

    @Test
    public void balanceStartEndDateTime_startDateAfterEndDate_startDateBeforeEndDate() throws Exception {
        LocalDateTime start = LocalDateTime.now();
        LocalDateTime end = start;

        start = start.plusDays(1);
        end = start.plusHours(1);

        end = DateTimeUtils.balanceStartAndEndDateTime(start, end);
        assertSameDateAndTime(end, start.plusHours(1));
    }
    
```
###### /java/seedu/agendum/logic/EditDistanceCalculatorTest.java
``` java
public class EditDistanceCalculatorTest {

    @Test
    public void closestCommandMatch_incorrectCommand_correctCommand() throws Exception {
        assertEquals(EditDistanceCalculator.closestCommandMatch("adr").get(), "add");
        assertEquals(EditDistanceCalculator.closestCommandMatch("marc").get(), "mark");
        assertEquals(EditDistanceCalculator.closestCommandMatch("markk").get(), "mark");
        assertEquals(EditDistanceCalculator.closestCommandMatch("storee").get(), "store");
        assertEquals(EditDistanceCalculator.closestCommandMatch("daletr").get(), "delete");
        assertEquals(EditDistanceCalculator.closestCommandMatch("hell").get(), "help");
        assertEquals(EditDistanceCalculator.closestCommandMatch("shdule").get(), "schedule");
        assertEquals(EditDistanceCalculator.closestCommandMatch("rname").get(), "rename");
    }

    @Test
    public void closestCommandMatch_incorrectCommand_invalidCommand() throws Exception {
        assertEquals(EditDistanceCalculator.closestCommandMatch("asdfohasdf"),  Optional.empty());
        assertEquals(EditDistanceCalculator.closestCommandMatch("poasdf"),  Optional.empty());
        assertEquals(EditDistanceCalculator.closestCommandMatch("teyu6578"),  Optional.empty());
    }

    @Test
    public void closestCommandMatch_incompleteCommand_fullCommand() throws Exception {
        assertEquals(EditDistanceCalculator.findCommandCompletion("ad").get(), "add");
        assertEquals(EditDistanceCalculator.findCommandCompletion("ma").get(), "mark");
        assertEquals(EditDistanceCalculator.findCommandCompletion("unm").get(), "unmark");
        assertEquals(EditDistanceCalculator.findCommandCompletion("und").get(), "undo");
        assertEquals(EditDistanceCalculator.findCommandCompletion("st").get(), "store");
        assertEquals(EditDistanceCalculator.findCommandCompletion("de").get(), "delete");
        assertEquals(EditDistanceCalculator.findCommandCompletion("he").get(), "help");
        assertEquals(EditDistanceCalculator.findCommandCompletion("sc").get(), "schedule");
        assertEquals(EditDistanceCalculator.findCommandCompletion("r").get(), "rename");
    }

    @Test
    public void closestCommandMatch_incompleteCommand_invalidCommand() throws Exception {
        assertEquals(EditDistanceCalculator.findCommandCompletion("un"), Optional.empty());
        assertEquals(EditDistanceCalculator.findCommandCompletion("iasdugfiasd"), Optional.empty());
    }

}
```
###### /java/seedu/agendum/sync/SyncManagerTests.java
``` java
public class SyncManagerTests {
    private SyncManager syncManager;
    private SyncProvider mockSyncProvider;

    @Before
    public void setUp() {
        mockSyncProvider = mock(SyncProvider.class);
        syncManager = new SyncManager(mockSyncProvider);
    }

    @Test
    public void syncManager_setStatusRunning_expectRunning() {
        syncManager.setSyncStatus(Sync.SyncStatus.RUNNING);
        assertEquals(syncManager.getSyncStatus(),Sync.SyncStatus.RUNNING);
    }

    @Test
    public void syncManager_setStatusNotRunning_expectNotRunning() {
        syncManager.setSyncStatus(Sync.SyncStatus.NOTRUNNING);
        assertEquals(syncManager.getSyncStatus(),Sync.SyncStatus.NOTRUNNING);
    }

    @Test
    public void syncManager_startSyncing_expectSyncProviderStart() {
        syncManager.startSyncing();
        verify(mockSyncProvider).start();
    }

    @Test
    public void syncManager_stopSyncing_expectSyncProviderStop() {
        syncManager.stopSyncing();
        verify(mockSyncProvider).stop();
    }

    @Test
    public void syncManager_addEventWithStartAndEndTime_expectSyncProviderAdd() {
        Task mockTask = mock(Task.class);
        Optional<LocalDateTime> fakeTime = Optional.of(LocalDateTime.now());

        when(mockTask.getStartDateTime()).thenReturn(fakeTime);
        when(mockTask.getEndDateTime()).thenReturn(fakeTime);

        syncManager.setSyncStatus(Sync.SyncStatus.RUNNING);
        syncManager.addNewEvent(mockTask);

        verify(mockSyncProvider).addNewEvent(mockTask);
    }

    @Test
    public void syncManager_addEventWithStartTime_expectNoSyncProviderAdd() {
        Task mockTask = mock(Task.class);
        Optional<LocalDateTime> fakeTime = Optional.of(LocalDateTime.now());
        Optional<LocalDateTime> empty = Optional.empty();

        when(mockTask.getStartDateTime()).thenReturn(empty);
        when(mockTask.getEndDateTime()).thenReturn(fakeTime);


        syncManager.setSyncStatus(Sync.SyncStatus.RUNNING);
        syncManager.addNewEvent(mockTask);

        verify(mockSyncProvider, never()).addNewEvent(mockTask);
    }

    @Test
    public void syncManager_addEventWithEndTime_expectNoSyncProviderAdd() {
        Task mockTask = mock(Task.class);
        Optional<LocalDateTime> fakeTime = Optional.of(LocalDateTime.now());
        Optional<LocalDateTime> empty = Optional.empty();

        when(mockTask.getStartDateTime()).thenReturn(fakeTime);
        when(mockTask.getEndDateTime()).thenReturn(empty);

        syncManager.setSyncStatus(Sync.SyncStatus.RUNNING);
        syncManager.addNewEvent(mockTask);

        verify(mockSyncProvider, never()).addNewEvent(mockTask);
    }

    @Test
    public void syncManager_addEventWithNoTime_expectNoSyncProviderAdd() {
        Task mockTask = mock(Task.class);
        Optional<LocalDateTime> empty = Optional.empty();

        when(mockTask.getStartDateTime()).thenReturn(empty);
        when(mockTask.getEndDateTime()).thenReturn(empty);

        syncManager.setSyncStatus(Sync.SyncStatus.RUNNING);
        syncManager.addNewEvent(mockTask);

        verify(mockSyncProvider, never()).addNewEvent(mockTask);
    }

    @Test
    public void syncManager_addEventWithSyncManagerNotRunning_expectNoSyncProviderAdd() {
        Task mockTask = mock(Task.class);

        syncManager.setSyncStatus(Sync.SyncStatus.NOTRUNNING);
        syncManager.addNewEvent(mockTask);

        verify(mockSyncProvider, never()).addNewEvent(mockTask);
    }

    @Test
    public void syncManager_deleteEventWithSyncManagerRunning_expectSyncProviderDelete() {
        Task mockTask = mock(Task.class);

        syncManager.setSyncStatus(Sync.SyncStatus.RUNNING);
        syncManager.deleteEvent(mockTask);

        verify(mockSyncProvider).deleteEvent(mockTask);
    }

    @Test
    public void syncManager_deleteEventWithSyncManagerNotRunning_expectNoSyncProviderDelete() {
        Task mockTask = mock(Task.class);

        syncManager.setSyncStatus(Sync.SyncStatus.NOTRUNNING);
        syncManager.deleteEvent(mockTask);

        verify(mockSyncProvider, never()).deleteEvent(mockTask);
    }
}
```
###### /java/seedu/agendum/sync/SyncProviderGoogleTests.java
``` java
public class SyncProviderGoogleTests {
    private static final File DATA_STORE_CREDENTIAL = new File(DEFAULT_DATA_DIR + "StoredCredential");

    private static final List<File> DATA_STORE_TEST_CREDENTIALS = Arrays.asList(
            new File("cal/StoredCredential_1"),
            new File("cal/StoredCredential_2"),
            new File("cal/StoredCredential_3")
            );

    private static final SyncProviderGoogle syncProviderGoogle = spy(new SyncProviderGoogle());
    private static final SyncManager mockSyncManager = mock(SyncManager.class);
    private static final Task mockTask = mock(Task.class);

    @BeforeClass
    public static void setUp() {
        copyTestCredentials();

        try {
            Optional<LocalDateTime> fakeTime = Optional.of(LocalDateTime.now());
            Name fakeName = new Name("AGENDUMTESTENGINE");
            int minId = 99999;
            int maxId = 9999999;
            Random r = new Random();

            when(mockTask.getStartDateTime()).thenReturn(fakeTime);
            when(mockTask.getEndDateTime()).thenReturn(fakeTime);
            when(mockTask.getName()).thenReturn(fakeName);
            when(mockTask.syncCode()).thenReturn(r.nextInt((maxId - minId) + 1) + minId);
        } catch (IllegalValueException e) {
            e.printStackTrace();
        }

        syncProviderGoogle.setManager(mockSyncManager);
        syncProviderGoogle.start();
    }

    @AfterClass
    public static void tearDown() {
        deleteCredential();
    }

    public static void copyTestCredentials() {
        try {
            deleteCredential();
            Files.copy(getRandomCredential().toPath(), DATA_STORE_CREDENTIAL.toPath());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void deleteCredential() {
        DATA_STORE_CREDENTIAL.delete();
    }

    private static File getRandomCredential() {
        int r = new Random().nextInt(DATA_STORE_TEST_CREDENTIALS.size());
        return DATA_STORE_TEST_CREDENTIALS.get(r);
    }

    @Test
    public void syncProviderGoogle_start_createCalendar() {
        reset(syncProviderGoogle);
        syncProviderGoogle.deleteAgendumCalendar();
        syncProviderGoogle.start();

        // Verify if Sync Manager's status was changed
        verify(mockSyncManager, atLeastOnce()).setSyncStatus(Sync.SyncStatus.RUNNING);
    }

    @Test
    public void syncProviderGoogle_startIfNeeded_credentialsFound() {
        reset(syncProviderGoogle);
        syncProviderGoogle.startIfNeeded();

        // Verify Sync Provider did start
        verify(syncProviderGoogle).start();
    }

    @Test
    public void syncProviderGoogle_startIfNeeded_credentialsNotFound() {
        reset(syncProviderGoogle);
        deleteCredential();
        syncProviderGoogle.startIfNeeded();

        // Verify Sync Provider should not start
        verify(syncProviderGoogle, never()).start();
    }

    @Test
    public void syncProviderGoogle_stop_successful() {
        reset(mockSyncManager);
        syncProviderGoogle.stop();

        // Verify sync status changed
        verify(mockSyncManager).setSyncStatus(Sync.SyncStatus.NOTRUNNING);
        assertFalse(DATA_STORE_CREDENTIAL.exists());
    }

    @Test
    public void syncProviderGoogle_addEvent_successful() {
        syncProviderGoogle.addNewEvent(mockTask);
    }

    @Test
    public void syncProviderGoogle_deleteEvent_successful() {
        syncProviderGoogle.deleteEvent(mockTask);
    }

}
```
