131132133134135136137138
Assert.assertTrue(like.passesFilter("id", item)); } @Test public void appliesToProperty_valueIsProperty_shouldBeTrue() { Like like = new Like("test", "%foo"); Assert.assertTrue(like.appliesToProperty("test")); }
137138139140141142143144
Assert.assertTrue(like.appliesToProperty("test")); } @Test public void appliesToProperty_valueIsNotProperty_shouldBeFalse() { Like like = new Like("test", "%foo"); Assert.assertFalse(like.appliesToProperty("bar")); }
143144145146147148149150151
Assert.assertFalse(like.appliesToProperty("bar")); } @Test public void equals_sameInstances_shouldBeTrue() { Like like1 = new Like("test", "%foo"); Like like2 = like1; Assert.assertTrue(like1.equals(like2)); }
150151152153154155156157158
Assert.assertTrue(like1.equals(like2)); } @Test public void equals_twoEqualInstances_shouldBeTrue() { Like like1 = new Like("test", "foo"); Like like2 = new Like("test", "foo"); Assert.assertTrue(like1.equals(like2)); }
157158159160161162163164165
Assert.assertTrue(like1.equals(like2)); } @Test public void equals_differentValues_shouldBeFalse() { Like like1 = new Like("test", "foo"); Like like2 = new Like("test", "bar"); Assert.assertFalse(like1.equals(like2)); }
164165166167168169170171172
Assert.assertFalse(like1.equals(like2)); } @Test public void equals_differentProperties_shouldBeFalse() { Like like1 = new Like("foo", "test"); Like like2 = new Like("bar", "test"); Assert.assertFalse(like1.equals(like2)); }
171172173174175176177178179
Assert.assertFalse(like1.equals(like2)); } @Test public void equals_differentPropertiesAndValues_shouldBeFalse() { Like like1 = new Like("foo", "bar"); Like like2 = new Like("baz", "zomg"); Assert.assertFalse(like1.equals(like2)); }
178179180181182183184185186
Assert.assertFalse(like1.equals(like2)); } @Test public void equals_differentClasses_shouldBeFalse() { Like like1 = new Like("foo", "bar"); Object obj = new Object(); Assert.assertFalse(like1.equals(obj)); }
185186187188189190191192193
Assert.assertFalse(like1.equals(obj)); } @Test public void equals_bothHaveNullProperties_shouldBeTrue() { Like like1 = new Like(null, "foo"); Like like2 = new Like(null, "foo"); Assert.assertTrue(like1.equals(like2)); }
192193194195196197198199200
Assert.assertTrue(like1.equals(like2)); } @Test public void equals_bothHaveNullValues_shouldBeTrue() { Like like1 = new Like("foo", null); Like like2 = new Like("foo", null); Assert.assertTrue(like1.equals(like2)); }