package test.leecode.math; import org.junit.Assert; import org.junit.Test; import cn.fansunion.leecode.math.PowerOfFour; /** * @author wen.lei@brgroup.com * * 2022-2-19 */ public class PowerOfFourTest { @Test public void test() { PowerOfFour four = new PowerOfFour(); Assert.assertTrue(four.isPowerOfFour( 1 )); Assert.assertTrue(four.isPowerOfFour( 1 * 4 )); Assert.assertTrue(four.isPowerOfFour( 1 * 4 * 4 )); Assert.assertTrue(four.isPowerOfFour( 1 * 4 * 4 * 4 * 4 * 4 )); Assert.assertFalse(four.isPowerOfFour( 5 )); Assert.assertFalse(four.isPowerOfFour( 5 * 5 )); Assert.assertFalse(four.isPowerOfFour( 5 * 6 )); } } |