@Test public void shouldAddShortColumnForInsert() { final short value = 2; assertThat(sqlInsertRequest() .table(TABLE) .column(COLUMN, value) .compile().contentValues.getAsShort(COLUMN), is(value)); }
@Test public void shouldAddNullShortColumnForInsert() { final Short nullValue = null; assertThat(sqlInsertRequest() .table(TABLE) .column(COLUMN, nullValue) .compile().contentValues.getAsShort(COLUMN), is(nullValue)); }
@Override public Short getAsShort(String key) { return contentValues.getAsShort(key); }
public Short getAsShort(String key) { return values.getAsShort(escape(key)); }
break; case TYPE_SHORT: setIfNotNull(field, object, values.getAsShort(columnName)); break; case TYPE_INT:
private static void assertContentValuesEquals(ContentValues expected, ContentValues actual) { assertNotNull(actual); assertEquals(expected.getAsString("COL_STRING"), actual.getAsString("COL_STRING")); assertEquals(expected.getAsString("COL_STRING_NULL"), actual.getAsString("COL_STRING_NULL")); assertEquals(expected.getAsByte("COL_BYTE"), actual.getAsByte("COL_BYTE")); assertEquals(expected.getAsShort("COL_SHORT"), actual.getAsShort("COL_SHORT")); assertEquals(expected.getAsInteger("COL_INTEGER"), actual.getAsInteger("COL_INTEGER")); assertEquals(expected.getAsLong("COL_LONG"), actual.getAsLong("COL_LONG")); assertEquals(expected.getAsFloat("COL_FLOAT"), actual.getAsFloat("COL_FLOAT")); assertEquals(expected.getAsDouble("COL_DOUBLE"), actual.getAsDouble("COL_DOUBLE")); assertEquals(expected.getAsBoolean("COL_BOOLEAN"), actual.getAsBoolean("COL_BOOLEAN")); assertArrayEquals(expected.getAsByteArray("COL_BYTE_ARRAY"), actual.getAsByteArray("COL_BYTE_ARRAY")); }