mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
41 lines
848 B
Java
41 lines
848 B
Java
package com.avaje.ebeaninternal.server.expression;
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.junit.Test;
|
|
|
|
import static org.assertj.core.api.StrictAssertions.assertThat;
|
|
|
|
public class IdExpressionTest {
|
|
|
|
|
|
@NotNull
|
|
private IdExpression exp(Object value) {
|
|
return new IdExpression(value);
|
|
}
|
|
|
|
@Test
|
|
public void isSameByPlan_when_same() {
|
|
|
|
assertThat(exp(10).isSameByPlan(exp(10))).isTrue();
|
|
}
|
|
|
|
@Test
|
|
public void isSameByPlan_when_diffBind_same() {
|
|
|
|
assertThat(exp(10).isSameByPlan(exp(20))).isTrue();
|
|
}
|
|
|
|
@Test
|
|
public void isSameByBind_when_sameBindValues() {
|
|
|
|
assertThat(exp(10).isSameByBind(exp(10))).isTrue();
|
|
}
|
|
|
|
@Test
|
|
public void isSameByBind_when_diffBindValues() {
|
|
|
|
assertThat(exp(10).isSameByBind(exp(20))).isFalse();
|
|
assertThat(exp(10).isSameByBind(exp("junk"))).isFalse();
|
|
}
|
|
} |