Search in sources :

Example 1 with AnotherSome

use of org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome 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())));
}
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)

Example 2 with AnotherSome

use of org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome 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())));
}
Also used : AnotherSome(org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome) Some(org.qi4j.runtime.property.PropertyEqualityTest.Some) AbstractQi4jTest(org.qi4j.test.AbstractQi4jTest) Test(org.junit.Test)

Example 3 with AnotherSome

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

the class ValueEqualityTest method givenValuesOfDifferentTypesAndSameStateWhenTestingValueEqualityExpectNotEquals.

@Test
public void givenValuesOfDifferentTypesAndSameStateWhenTestingValueEqualityExpectNotEquals() {
    Some some = buildSomeValue(module);
    Some anotherSome = buildAnotherSomeValue(module);
    assertThat("Values not equal", some, not(equalTo(anotherSome)));
    assertThat("Values hashcode not equal", some.hashCode(), not(equalTo(anotherSome.hashCode())));
}
Also used : AnotherSome(org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome) Some(org.qi4j.runtime.property.PropertyEqualityTest.Some) AbstractQi4jTest(org.qi4j.test.AbstractQi4jTest) Test(org.junit.Test)

Example 4 with AnotherSome

use of org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome 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)4 AnotherSome (org.qi4j.runtime.property.PropertyEqualityTest.AnotherSome)4 Some (org.qi4j.runtime.property.PropertyEqualityTest.Some)4 AbstractQi4jTest (org.qi4j.test.AbstractQi4jTest)4 AssociationStateHolder (org.qi4j.api.association.AssociationStateHolder)2