//@@author A0139961U
package seedu.tache.ui;

import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;

import java.awt.SystemTray;
import java.util.ArrayList;
import java.util.Date;
import java.util.Optional;
import java.util.Timer;

import org.junit.Test;

import seedu.tache.commons.exceptions.IllegalValueException;
import seedu.tache.model.recurstate.RecurState.RecurInterval;
import seedu.tache.model.tag.UniqueTagList;
import seedu.tache.model.task.DateTime;
import seedu.tache.model.task.Name;
import seedu.tache.model.task.Task;

public class NotificationManagerTest {

    @Test
    public void showSystemTrayNotification_validInput_success() throws IllegalValueException {
        if (SystemTray.isSupported()) {
            NotificationManager testNotification = new NotificationManager();
            Timer initialTimer = testNotification.getNotificationTimer();
            Task event = new Task(new Name("Event"), Optional.of(new DateTime("2 hours later")),
                    Optional.of(new DateTime("2 days later")), new UniqueTagList("TestTag"), true,
                    RecurInterval.NONE, new ArrayList<Date>());
            Task deadline = new Task(new Name("Deadline"), null,
                    Optional.of(new DateTime("2 hours later")), new UniqueTagList("TestTag"), true,
                    RecurInterval.NONE, new ArrayList<Date>());
            testNotification.showSystemTrayNotification(event, 0);
            testNotification.showSystemTrayNotification(deadline, 1);
            assertNotSame(testNotification.getNotificationTimer().toString(), initialTimer.toString());
            testNotification.stop();
            assertNotSame(testNotification.getNotificationTimer().toString(), initialTimer.toString());
        } else {
            assertTrue(NotificationManager.SYSTEM_TRAY_NOT_SUPPORTED_MESSAGE, true);
        }
    }

}

@@ -713,52 +713,8 @@
 n %7B%0A
-        if (SystemTray.isSupported()) %7B%0A    
     
@@ -791,20 +791,16 @@
         
-    
 Timer in
@@ -857,28 +857,24 @@
 ();%0A        
- 
-   
 Task event =
@@ -946,20 +946,16 @@
 ter%22)),%0A
-    
         
@@ -1049,36 +1049,32 @@
                 
-    
 RecurInterval.NO
@@ -1105,28 +1105,24 @@
 ));%0A        
-   
- 
 Task deadlin
@@ -1162,20 +1162,16 @@
 , null,%0A
-    
         
@@ -1266,36 +1266,32 @@
                 
-  
-  
 RecurInterval.NO
@@ -1310,32 +1310,72 @@
 yList%3CDate%3E());%0A
+        if (SystemTray.isSupported()) %7B%0A
             test

Update Unit Test for NotificationManagerTest