1 package com.puppycrawl.tools.checkstyle.filters; 2 3 import junit.framework.TestCase; 4 5 6 public class IntMatchFilterTest extends TestCase 7 { 8 public void testDecide() 9 { 10 final IntFilter filter = new IntMatchFilter(0); 11 assertFalse("less than", filter.accept(new Integer (-1))); 12 assertTrue("equal", filter.accept(new Integer (0))); 13 assertFalse("greater than", filter.accept(new Integer (1))); 14 } 15 16 public void testEquals() 17 { 18 final IntFilter filter = new IntMatchFilter(0); 19 final IntFilter filter2 = new IntMatchFilter(0); 20 final IntFilter filter3 = new IntMatchFilter(1); 21 assertEquals("0", filter, filter2); 22 assertFalse("0 != 1", filter.equals(filter3)); 23 assertFalse("0 != this", filter.equals(this)); 24 assertFalse("0 != null", filter.equals(null)); 25 } 26 } 27 | Popular Tags |