use of org.qi4j.runtime.property.PropertyEqualityTest.Some in project qi4j-sdk by Qi4j.
the class ValueEqualityTest method givenValuesOfTheSameTypeWithDifferentStateWhenTestingValueEqualityExpectNotEquals.
@Test
public void givenValuesOfTheSameTypeWithDifferentStateWhenTestingValueEqualityExpectNotEquals() {
Some some = buildSomeValue(module);
Some some2 = buildSomeValueWithDifferentState(module);
assertThat("Values not equals", some, not(equalTo(some2)));
assertThat("Values hashcode not equals", some.hashCode(), not(equalTo(some2.hashCode())));
}
use of org.qi4j.runtime.property.PropertyEqualityTest.Some in project qi4j-sdk by Qi4j.
the class ValueEqualityTest method givenValuesOfDifferentTypesWhenTestingValueDescriptorEqualityExpectNotEquals.
@Test
public void givenValuesOfDifferentTypesWhenTestingValueDescriptorEqualityExpectNotEquals() {
Some some = buildSomeValue(module);
ValueDescriptor someDescriptor = qi4j.api().valueDescriptorFor(some);
Other other = buildOtherValue(module);
ValueDescriptor otherDescriptor = qi4j.api().valueDescriptorFor(other);
assertThat("ValueDescriptors not equal", someDescriptor, not(equalTo(otherDescriptor)));
assertThat("ValueDescriptors hashcode not equal", someDescriptor.hashCode(), not(equalTo(otherDescriptor.hashCode())));
}
use of org.qi4j.runtime.property.PropertyEqualityTest.Some in project qi4j-sdk by Qi4j.
the class ValueEqualityTest method givenValuesOfCommonTypesWhenTestingValueDescriptorEqualityExpectNotEquals.
@Test
public void givenValuesOfCommonTypesWhenTestingValueDescriptorEqualityExpectNotEquals() {
Some some = buildSomeValue(module);
ValueDescriptor someDescriptor = qi4j.api().valueDescriptorFor(some);
PrimitivesValue primitive = buildPrimitivesValue(module);
ValueDescriptor primitiveDescriptor = qi4j.api().valueDescriptorFor(primitive);
assertThat("ValueDescriptors not equal", someDescriptor, not(equalTo(primitiveDescriptor)));
assertThat("ValueDescriptors hashcode not equal", someDescriptor.hashCode(), not(equalTo(primitiveDescriptor.hashCode())));
}
use of org.qi4j.runtime.property.PropertyEqualityTest.Some in project qi4j-sdk by Qi4j.
the class ValueEqualityTest method givenValuesOfDifferentTypesAndDifferentStateWhenTestingValueStateEqualityExpectNotEquals.
@Test
public void givenValuesOfDifferentTypesAndDifferentStateWhenTestingValueStateEqualityExpectNotEquals() {
Some some = buildSomeValue(module);
AssociationStateHolder someState = qi4j.spi().stateOf((ValueComposite) some);
AnotherSome anotherSome = buildAnotherSomeValueWithDifferentState(module);
AssociationStateHolder anotherSomeState = qi4j.spi().stateOf((ValueComposite) anotherSome);
assertThat("ValueStates not equal", someState, not(equalTo(anotherSomeState)));
assertThat("ValueStates hashcode not equal", someState.hashCode(), not(equalTo(anotherSomeState.hashCode())));
}
use of org.qi4j.runtime.property.PropertyEqualityTest.Some in project qi4j-sdk by Qi4j.
the class ValueEqualityTest method givenValuesOfDifferentTypesAndDifferentStateWhenTestingValueEqualityExpectNotEquals.
@Test
public void givenValuesOfDifferentTypesAndDifferentStateWhenTestingValueEqualityExpectNotEquals() {
Some some = buildSomeValue(module);
Some anotherSome = buildAnotherSomeValueWithDifferentState(module);
assertThat("Values not equal", some, not(equalTo(anotherSome)));
assertThat("Values hashcode not equal", some.hashCode(), not(equalTo(anotherSome.hashCode())));
}
Aggregations