1 package com.xtremelabs.robolectric.util; 2 3 import java.util.ArrayList; 4 import java.util.Arrays; 5 import java.util.List; 6 7 import static org.junit.Assert.assertEquals; 8 9 public class Transcript { 10 private List<String> events = new ArrayList<String>(); 11 add(String event)12 public void add(String event) { 13 events.add(event); 14 } 15 assertNoEventsSoFar()16 public void assertNoEventsSoFar() { 17 assertEquals("Expected no events but got " + events + ".", 0, events.size()); 18 } 19 assertEventsSoFar(String... expectedEvents)20 public void assertEventsSoFar(String... expectedEvents) { 21 assertEquals(Arrays.asList(expectedEvents), events); 22 events.clear(); 23 } 24 clear()25 public void clear() { 26 events.clear(); 27 } 28 getEvents()29 public List<String> getEvents() { 30 return events; 31 } 32 } 33