Search in sources :

Example 11 with Some

use of org.qi4j.runtime.property.PropertyEqualityTest.Some in project qi4j-sdk by Qi4j.

the class ValueEqualityTest method givenValuesOfDifferentTypesAndSameStateWhenTestingValueStateEqualityExpectEquals.

@Test
public void givenValuesOfDifferentTypesAndSameStateWhenTestingValueStateEqualityExpectEquals() {
    Some some = buildSomeValue(module);
    AssociationStateHolder someState = qi4j.spi().stateOf((ValueComposite) some);
    AnotherSome anotherSome = buildAnotherSomeValue(module);
    AssociationStateHolder anotherSomeState = qi4j.spi().stateOf((ValueComposite) anotherSome);
    assertThat("ValueStates equal", someState, equalTo(anotherSomeState));
    assertThat("ValueStates hashcode equal", someState.hashCode(), equalTo(anotherSomeState.hashCode()));
}
Also used : AnotherSome(org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome) Some(org.qi4j.runtime.property.PropertyEqualityTest.Some) AnotherSome(org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome) AssociationStateHolder(org.qi4j.api.association.AssociationStateHolder) AbstractQi4jTest(org.qi4j.test.AbstractQi4jTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 AnotherSome (org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome)11 Some (org.qi4j.runtime.property.PropertyEqualityTest.Some)11 AbstractQi4jTest (org.qi4j.test.AbstractQi4jTest)11 AssociationStateHolder (org.qi4j.api.association.AssociationStateHolder)4 ValueDescriptor (org.qi4j.api.value.ValueDescriptor)3 Other (org.qi4j.runtime.property.PropertyEqualityTest.Other)1 PrimitivesValue (org.qi4j.runtime.property.PropertyEqualityTest.PrimitivesValue)1 PropertyEqualityTest.buildPrimitivesValue (org.qi4j.runtime.property.PropertyEqualityTest.buildPrimitivesValue)1