@Test public void attributeValue_ToString() { AttributeValue attribute = AttributeValue.stringAttributeValue("MyStringAttributeValue"); assertThat(attribute.toString()).contains("MyStringAttributeValue"); attribute = AttributeValue.booleanAttributeValue(true); assertThat(attribute.toString()).contains("true"); attribute = AttributeValue.longAttributeValue(123456L); assertThat(attribute.toString()).contains("123456"); attribute = AttributeValue.doubleAttributeValue(1.23456); assertThat(attribute.toString()).contains("1.23456"); } }
@Test public void doubleAttributeValue_DeprecatedMatchFunction() { AttributeValue attribute = AttributeValue.doubleAttributeValue(1.23456); attribute.match( new Function<String, Object>() {
@Test public void doubleAttributeValue() { AttributeValue attribute = AttributeValue.doubleAttributeValue(1.23456); attribute.match( new Function<String, Object>() {
@Test public void attributeValue_EqualsAndHashCode() { EqualsTester tester = new EqualsTester(); tester.addEqualityGroup( AttributeValue.stringAttributeValue("MyStringAttributeValue"), AttributeValue.stringAttributeValue("MyStringAttributeValue")); tester.addEqualityGroup(AttributeValue.stringAttributeValue("MyStringAttributeDiffValue")); tester.addEqualityGroup( AttributeValue.booleanAttributeValue(true), AttributeValue.booleanAttributeValue(true)); tester.addEqualityGroup(AttributeValue.booleanAttributeValue(false)); tester.addEqualityGroup( AttributeValue.longAttributeValue(123456L), AttributeValue.longAttributeValue(123456L)); tester.addEqualityGroup(AttributeValue.longAttributeValue(1234567L)); tester.addEqualityGroup( AttributeValue.doubleAttributeValue(1.23456), AttributeValue.doubleAttributeValue(1.23456)); tester.addEqualityGroup(AttributeValue.doubleAttributeValue(1.234567)); tester.testEquals(); }