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 12 public void add(String event) { 13 events.add(event); 14 } 15 16 public void assertNoEventsSoFar() { 17 assertEquals("Expected no events but got " + events + ".", 0, events.size()); 18 } 19 20 public void assertEventsSoFar(String... expectedEvents) { 21 assertEquals(Arrays.asList(expectedEvents), events); 22 events.clear(); 23 } 24 25 public void clear() { 26 events.clear(); 27 } 28 29 public List<String> getEvents() { 30 return events; 31 } 32 } 33