@Test public void joeBuysStandardTicketForGizmoEvent() { EventOrganizer eventOrganizer = new EventOrganizer(); Event gizmoEvent = Fixtures.createEvent("Gizmo"); TicketType standardTicketType = Fixtures.createTicketType("Standard"); eventOrganizer.buyTicket(gizmoEvent, "Joe", standardTicketType); assertTrue(eventOrganizer.hasValidTicket("Joe", gizmoEvent)); }
@Test public void noValidTicket() { EventOrganizer eventOrganizer = new EventOrganizer(); Event gizmoEvent = Fixtures.createEvent("Gizmo"); assertFalse(eventOrganizer.hasValidTicket("Joe", gizmoEvent)); }
@Test public void findGizmoEvent() { EventOrganizer eventOrganizer = new EventOrganizer(); Event gizmoEvent = Fixtures.createEvent("Gizmo"); assertTrue(eventOrganizer.findAvailableEvents().contains(gizmoEvent)); }
@Test public void findGizmoEventByName() { EventOrganizer eventOrganizer = new EventOrganizer(); Event gizmoEvent = Fixtures.createEvent("Gizmo"); assertEquals(gizmoEvent, eventOrganizer.findEvent("Gizmo")); }
@Before public void setUp() { fixture = Fixtures.newGivenWhenThenFixture(StandardAggregate.class); fixture.registerAggregateFactory(new StandardAggregate.Factory()); }