forked from nus-cs2103-AY1617S1/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
src/test/java/seedu/agendum/sync/SyncProviderGoogleTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package seedu.agendum.sync; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import seedu.agendum.model.task.Task; | ||
|
||
import java.io.File; | ||
import java.time.LocalDateTime; | ||
import java.util.Optional; | ||
|
||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
import static seedu.agendum.commons.core.Config.DEFAULT_DATA_DIR; | ||
|
||
public class SyncProviderGoogleTests { | ||
private SyncProviderGoogle syncProviderGoogle; | ||
private static final File DATA_STORE_CREDENTIAL = new File(DEFAULT_DATA_DIR + "StoredCredential"); | ||
|
||
@Before | ||
public void setUp() { | ||
syncProviderGoogle = new SyncProviderGoogle(); | ||
} | ||
|
||
@Test | ||
public void addevent() { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
Task mockTask = mock(Task.class); | ||
Optional<LocalDateTime> fakeTime = Optional.of(LocalDateTime.now()); | ||
|
||
when(mockTask.getStartDateTime()).thenReturn(fakeTime); | ||
when(mockTask.getEndDateTime()).thenReturn(fakeTime); | ||
|
||
syncProviderGoogle.addNewEvent(mockTask); | ||
} | ||
|
||
@Test | ||
public void deleteEvent() { | ||
Task mockTask = mock(Task.class); | ||
Optional<LocalDateTime> fakeTime = Optional.of(LocalDateTime.now()); | ||
|
||
when(mockTask.getStartDateTime()).thenReturn(fakeTime); | ||
when(mockTask.getEndDateTime()).thenReturn(fakeTime); | ||
|
||
syncProviderGoogle.deleteEvent(mockTask); | ||
} | ||
|
||
} |
addEvent