@Test public void thereAreTwoValuesButAllOfThemAreGreaterThanDesired() throws Exception { final HGRandomAccessResult.GotoResult expected = HGRandomAccessResult.GotoResult.nothing; TestUtils.putKeyValuePair(environment, database, 1, 10); TestUtils.putKeyValuePair(environment, database, 2, 20); startupCursor(); createMocksForTheGoTo(); final HGRandomAccessResult.GotoResult actual = resultSet.goTo(-10, EXACT_MATCH); assertEquals(actual, expected); shutdownCursor(); }
@Test(enabled = false) public void thereAreTwoValuesAndOneOfThemIsEqualToDesired() throws Exception { final HGRandomAccessResult.GotoResult expected = HGRandomAccessResult.GotoResult.found; TestUtils.putKeyValuePair(environment, database, 1, 10); TestUtils.putKeyValuePair(environment, database, 2, 20); startupCursor(); createMocksForTheGoTo(); final HGRandomAccessResult.GotoResult actual = resultSet.goTo(10, EXACT_MATCH); assertEquals(actual, expected); shutdownCursor(); }
@Test public void anotherCaseWhenThereAreThreeValuesAndOneOfThemIsEqualToDesired() throws Exception { final HGRandomAccessResult.GotoResult expected = HGRandomAccessResult.GotoResult.nothing; TestUtils.putKeyValuePair(environment, database, 1, 10); TestUtils.putKeyValuePair(environment, database, 2, 20); TestUtils.putKeyValuePair(environment, database, 3, 30); startupCursor(); createMocksForTheGoTo(); final HGRandomAccessResult.GotoResult actual = resultSet.goTo(30, EXACT_MATCH); assertEquals(actual, expected); shutdownCursor(); }