Första testet
This commit is contained in:
26
TagManagerKata/test/session4/EmptyEvent.java
Normal file
26
TagManagerKata/test/session4/EmptyEvent.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package session4;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.util.List;
|
||||
|
||||
import com.squeed.kata.nametag.entities.Attendee;
|
||||
import com.squeed.kata.nametag.entities.Event;
|
||||
|
||||
public class EmptyEvent implements Event {
|
||||
|
||||
public EmptyEvent(){
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Attendee> getExpectedAttendees() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getDefaultImage() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
20
TagManagerKata/test/session4/NameTagManagerImpl.java
Normal file
20
TagManagerKata/test/session4/NameTagManagerImpl.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package session4;
|
||||
|
||||
import com.squeed.kata.nametag.NameTagManager;
|
||||
import com.squeed.kata.nametag.entities.Event;
|
||||
import com.squeed.kata.nametag.services.PrintingService;
|
||||
|
||||
public class NameTagManagerImpl implements NameTagManager {
|
||||
|
||||
private PrintingService printingService;
|
||||
|
||||
public NameTagManagerImpl(PrintingService printingService) {
|
||||
this.printingService = printingService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printNameTagsForEvent(Event event) {
|
||||
//printingService.printNameTagFor(null, null);
|
||||
}
|
||||
|
||||
}
|
||||
20
TagManagerKata/test/session4/PrintingServiceStub.java
Normal file
20
TagManagerKata/test/session4/PrintingServiceStub.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package session4;
|
||||
|
||||
import java.awt.Image;
|
||||
|
||||
import com.squeed.kata.nametag.entities.Attendee;
|
||||
import com.squeed.kata.nametag.services.PrintingService;
|
||||
|
||||
public class PrintingServiceStub implements PrintingService {
|
||||
|
||||
private int count;
|
||||
|
||||
public void printNameTagFor(Attendee attendee, Image image){
|
||||
count++;
|
||||
}
|
||||
|
||||
public int printingCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,30 @@
|
||||
package session4;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TagManagerTest {
|
||||
import com.squeed.kata.nametag.NameTagManager;
|
||||
import com.squeed.kata.nametag.entities.Event;
|
||||
|
||||
public class TagManagerTest {
|
||||
@Test
|
||||
public void test() {
|
||||
fail("Not yet implemented");
|
||||
public void when_event_is_empty_nothing_is_printed() throws Exception {
|
||||
Event event = new EmptyEvent();
|
||||
PrintingServiceStub printingService = new PrintingServiceStub();
|
||||
NameTagManager testeee = new NameTagManagerImpl(printingService);
|
||||
|
||||
testeee.printNameTagsForEvent(event);
|
||||
|
||||
assertEquals(0, printingService.printingCount());
|
||||
}
|
||||
|
||||
}
|
||||
@Test
|
||||
@Ignore
|
||||
public void when_event_has_one_attendee_but_no_downloaders_available_then_print_default_image()
|
||||
throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user