@Test public void testInputEqualsOnEqualObjectsWithDifferentReferences() { TestObject object1 = new TestObject("Hello world!"); TestObject object2 = new TestObject("Hello world!"); Input<TestObject> input1 = Input.fromNullable(object1); Input<TestObject> input2 = Input.fromNullable(object2); assertEquals(input1, input2); }
@Test public void testInputEqualsOnNotNullObjects() { TestObject object = new TestObject("Hello world!"); Input<TestObject> aInput = Input.fromNullable(object); Input<TestObject> anotherInput = Input.fromNullable(object); assertEquals(aInput, anotherInput); }
@Test public void testInputNotEqualsWhenAnObjectIsNull() { TestObject object = new TestObject(null); Input<TestObject> aInput = Input.fromNullable(object); Input<TestObject> anotherInput = Input.fromNullable(null); assertNotEquals(aInput, anotherInput); }
@Test public void testInputNotEqualsOnDifferentObjects() { TestObject object = new TestObject("Hello world!"); TestObject anotherObject = new TestObject("Bye world!"); Input<TestObject> aInput = Input.fromNullable(object); Input<TestObject> anotherInput = Input.fromNullable(anotherObject); assertNotEquals(aInput, anotherInput); }
@Test public void testInputEqualsOnObjectsWithNullValue() { TestObject object = new TestObject(null); Input<TestObject> aInput = Input.fromNullable(object); Input<TestObject> anotherInput = Input.fromNullable(object); assertEquals(aInput, anotherInput); }