use of com.scalar.db.io.IntColumn in project scalardb by scalar-labs.
the class ValueBinderTest method visit_IntColumnAcceptCalled_ShouldCallSetInt.
@Test
public void visit_IntColumnAcceptCalled_ShouldCallSetInt() {
// Arrange
IntColumn column = IntColumn.of(ANY_NAME, ANY_INT);
ValueBinder binder = new ValueBinder(bound);
// Act
column.accept(binder);
// Assert
verify(bound).setInt(0, ANY_INT);
}
use of com.scalar.db.io.IntColumn in project scalardb by scalar-labs.
the class ValueBinderTest method visit_AcceptCalledMultipleTimes_ShouldCallSetWithIncremented.
@Test
public void visit_AcceptCalledMultipleTimes_ShouldCallSetWithIncremented() {
// Arrange
TextColumn column1 = TextColumn.of(ANY_NAME, ANY_STRING);
IntColumn column2 = IntColumn.of(ANY_NAME, ANY_INT);
ValueBinder binder = new ValueBinder(bound);
// Act
column1.accept(binder);
column2.accept(binder);
// Assert
verify(bound).setString(0, ANY_STRING);
verify(bound).setInt(1, ANY_INT);
}
use of com.scalar.db.io.IntColumn in project scalardb by scalar-labs.
the class ValueBinderTest method visit_AcceptCalledMultipleTimesWithNullValue_ShouldSetProperly.
@Test
public void visit_AcceptCalledMultipleTimesWithNullValue_ShouldSetProperly() {
// Arrange
IntColumn column1 = IntColumn.of(ANY_NAME, ANY_INT);
BlobColumn column2 = BlobColumn.ofNull(ANY_NAME);
TextColumn column3 = TextColumn.ofNull(ANY_NAME);
IntColumn column4 = IntColumn.of(ANY_NAME, ANY_INT);
ValueBinder binder = new ValueBinder(bound);
// Act
column1.accept(binder);
column2.accept(binder);
column3.accept(binder);
column4.accept(binder);
// Assert
verify(bound).setInt(0, ANY_INT);
verify(bound).setToNull(1);
verify(bound).setToNull(2);
verify(bound).setInt(3, ANY_INT);
}
use of com.scalar.db.io.IntColumn in project scalardb by scalar-labs.
the class ValueBinderTest method visit_IntColumnWithNullValueAcceptCalled_ShouldCallSetToNull.
@Test
public void visit_IntColumnWithNullValueAcceptCalled_ShouldCallSetToNull() {
// Arrange
IntColumn column = IntColumn.ofNull(ANY_NAME);
ValueBinder binder = new ValueBinder(bound);
// Act
column.accept(binder);
// Assert
verify(bound).setToNull(0);
}
Aggregations