package Tests;

import project.*;

import static org.junit.Assert.*;

import java.util.Calendar;

import org.junit.Test;

public class TestSysApp extends TestBasis{


	@Test
	public void SysApp() throws IllegalOperationException {
		//setup
		setup();
		
		// Test that no employee is logged in
		assertFalse(sysApp.loggedIn());
		
		//Tests if addEmployee works
		
		assertTrue(sysApp.addEmployee("Jens"));
		
		//Test if login now works
		boolean login = sysApp.login("Jens");
		assertTrue(login);
		
		//Testing if logoff works
		sysApp.logoff();
		
		assertFalse(sysApp.loggedIn());
		
		//Test add project random ID
		
		//assertTrue(sysApp.addProject("143D92"));
		
		//Test add activity random ID
		
		//assertTrue(sysApp.addActicity("143A33"));
	}
}

@@ -59,24 +59,85 @@
 .Assert.*;%0A%0A
+import java.io.IOException;%0Aimport java.lang.reflect.Method;%0A
 import java.
@@ -282,16 +282,71 @@
 xception
+, NoSuchMethodException, SecurityException, IOException
  %7B%0A%09%09//s
@@ -360,24 +360,30 @@
 setup();%0A%09%09%0A
+%09%09%0A%09%09%0A
 %09%09// Test th
@@ -439,32 +439,35 @@
 loggedIn());%0A%09%09%0A
+%09%09%0A
 %09%09//Tests if add
@@ -516,22 +516,18 @@
 mployee(
-%22Jens%22
+e1
 ));%0A%09%09%0A%09
@@ -588,14 +588,10 @@
 gin(
-%22Jens%22
+e1
 );%0A%09
@@ -704,46 +704,100 @@
 %0A%09%09%0A
+%09%0A%09%09%0A
 %09%09//
-T
+ t
 est 
+if 
 ad
-d
  proje
-ct random ID
+kt works and if it is possible to add the same project twice
 %0A%09%09%0A%09%09
-//
 asse
@@ -825,17 +825,206 @@
 ect(
-%22143D92%22)
+p1));%0A%09%09assertFalse(sysApp.addProject(p1));%0A%09%09%0A%09%09// test if get projekt by name works%0A%09%09%0A%09//%09Project p = sysApp.projectByName(%22ID1%22);       ------   The Test for porject by name%0A%09//%09assertTrue(p==p1
 );%0A%09
@@ -1034,16 +1034,19 @@
 %09//Test 
+if 
 add acti
@@ -1054,25 +1054,53 @@
 ity 
-random ID
+works and if you can add the same twice
 %0A%09%09%0A%09%09
-//
 asse
@@ -1129,19 +1129,311 @@
 ity(
-%22143A33%22));
+a1));%0A%09%09assertFalse(sysApp.addActicity(a1));%0A%09%09%0A%09%09//Test if get activity by name works%0A%09%09%0A%09%09Activity a = sysApp.activityByName(%2201xxx%22);%0A%09%09assertTrue(a==a1);%0A%09%09%0A%09%09%0A%09%09//System log, test?%0A%09%09%0A%09%09%0A%09%09//String s = %22Hey this is a report%22;%0A%09%09//assertTrue(sysApp.setWeekReport(s));%0A%09%09//(sysApp.getSystemLog());%0A%09%09
 %0A%09%7D%0A

test sysapp