private boolean areIdentical(Plan one, Plan two) { return(one.id.equals(two.id) && one.title.equals(two.title) && one.duration==two.duration && one.priority==two.priority && areIdentical(one.startTime, two.startTime) && areIdentical(one.creationTime, two.creationTime) && areIdentical(one.updateTime, two.updateTime)); }
@Test public void basics() { assertEquals(0, store.singleAllTrips().blockingGet().size()); final Trip first=new Trip("Foo", 2880, Priority.LOW, new Date()); assertNotNull(first.id); assertNotEquals(0, first.id.length()); store.insert(first); assertTrip(store, first); final Trip updated= new Trip(first.id, "Foo!!!", 1440, Priority.MEDIUM, first.startTime, first.creationTime, first.updateTime); store.update(updated); assertTrip(store, updated); store.delete(updated); assertEquals(0, store.singleAllTrips().blockingGet().size()); }
@Test public void basics() { assertEquals(0, store.singleAllTrips().blockingGet().size()); final Trip first=new Trip("Foo", 2880, Priority.LOW, new Date()); assertNotNull(first.id); assertNotEquals(0, first.id.length()); store.insert(first); assertTrip(store, first); final Trip updated= new Trip(first.id, "Foo!!!", 1440, Priority.MEDIUM, first.startTime, first.creationTime, first.updateTime); store.update(updated); assertTrip(store, updated); store.delete(updated); assertEquals(0, store.singleAllTrips().blockingGet().size()); }
private boolean areIdentical(Plan one, Plan two) { return(one.id.equals(two.id) && one.title.equals(two.title) && one.duration==two.duration && one.priority==two.priority && areIdentical(one.startTime, two.startTime) && areIdentical(one.creationTime, two.creationTime) && areIdentical(one.updateTime, two.updateTime)); }
private void assertTrip(TripStore store, Trip trip) { List<Trip> results=store.singleAllTrips().blockingGet(); assertNotNull(results); assertEquals(1, results.size()); assertTrue(areIdentical(trip, results.get(0))); Trip result=store.singleTripById(trip.id).blockingGet(); assertNotNull(result); assertTrue(areIdentical(trip, result)); }
private void assertTrip(TripStore store, Trip trip) { List<Trip> results=store.singleAllTrips().blockingGet(); assertNotNull(results); assertEquals(1, results.size()); assertTrue(areIdentical(trip, results.get(0))); Trip result=store.singleTripById(trip.id).blockingGet(); assertNotNull(result); assertTrue(areIdentical(trip, result)); }