package at.ac.tuwien.inso.dto_tests;

import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import static org.junit.Assert.*;

import org.junit.Test;

import at.ac.tuwien.inso.dto.SemesterDto;

@RunWith(MockitoJUnitRunner.class)
public class SemesterDtoTests {

	private SemesterDto getA(){
		SemesterDto a = new SemesterDto("A");
		a.setId(1L);
		return a;
	}
	
	private SemesterDto getB(){
		SemesterDto b = new SemesterDto("B");
		b.setId(2L);
		return b;
	}
	
	private SemesterDto getANoId(){
		SemesterDto a = new SemesterDto("A");
		return a;
	}
	
	@Test
	public void testSemesterDtoEqualsisEqual(){
		assertTrue(getA().equals(getA()));
	}
	
	@Test
	public void testSemesterDtoEqualsisNotEqual(){
		assertFalse(getA().equals(getB()));
	}
	
	@Test
	public void testSemesterDtoisEqual(){
		assertFalse(getA().equals(getANoId()));
	}
}

@@ -212,16 +212,62 @@
 sterDto;
+%0Aimport at.ac.tuwien.inso.entity.SemesterType;
 %0A%0A@RunWi
@@ -356,30 +356,36 @@
  get
-A
+WS2016WithoutId
 ()
+ 
 %7B%0A%09%09
-SemesterDto a =
+return
  new
@@ -401,45 +401,47 @@
 Dto(
-%22A%22);%0A%09%09a.setId(1L);%0A%09%09return a
+2016, SemesterType.WinterSemester)
 ;%0A%09%7D%0A
-%09
 %0A%09pr
@@ -461,17 +461,22 @@
 rDto get
-B
+WS2016
 ()%7B%0A%09%09Se
@@ -489,45 +489,45 @@
 Dto 
-b = new SemesterDto(%22B%22
+a = getWS2016WithoutId(
 );%0A%09%09
-b
+a
 .setId(
-2
+1
 L);%0A
@@ -535,17 +535,17 @@
 %09return 
-b
+a
 ;%0A%09%7D%0A%09%0A%09
@@ -567,21 +567,22 @@
 rDto get
-ANoId
+SS2015
 ()%7B%0A%09%09Se
@@ -591,17 +591,17 @@
 sterDto 
-a
+b
  = new S
@@ -615,11 +615,56 @@
 Dto(
-%22A%22
+2015, SemesterType.SummerSemester);%0A%09%09b.setId(2L
 );%0A%09
@@ -671,22 +671,23 @@
 %09return 
-a
+b
 ;%0A%09%7D%0A
+%0A
 %09%0A%09@Test
@@ -708,34 +708,17 @@
 test
-SemesterDtoEqualsis
 Equal
+s
 ()
+ 
 %7B%0A%09%09
@@ -727,25 +727,30 @@
 sertTrue(get
-A
+WS2016
 ().equals(ge
@@ -750,17 +750,22 @@
 uals(get
-A
+WS2016
 ()));%0A%09%7D
@@ -795,37 +795,31 @@
 test
-SemesterDtoEqualsisNotEqual
+EqualsDifferntValues
 ()
+ 
 %7B%0A%09%09
@@ -825,33 +825,38 @@
 %09assertFalse(get
-A
+WS2016
 ().equals(getB()
@@ -856,9 +856,14 @@
 (get
-B
+SS2015
 ()))
@@ -897,28 +897,21 @@
 test
-SemesterDtois
 Equal
+sNoId
 ()
+ 
 %7B%0A%09%09
@@ -925,17 +925,22 @@
 alse(get
-A
+WS2016
 ().equal
@@ -948,11 +948,21 @@
 (get
-ANo
+WS2016Without
 Id()

Fix tests