package test.leecode.math; import org.junit.Assert; import org.junit.Test; import cn.fansunion.leecode.math.PowerOfThree; /** * @author wen.lei@brgroup.com * * 2022-2-19 */ public class PowerOfThreeTest @Test public void test() PowerOfThree three = new PowerOfThree(); Assert.assertFalse(three.isPowerOfThree( 15 )); Assert.assertFalse(three.isPowerOfThree( 45 )); Assert.assertTrue(three.isPowerOfThree( 1 )); Assert.assertTrue(three.isPowerOfThree( 1 * 3 )); Assert.assertTrue(three.isPowerOfThree( 1 * 3 * 3 )); Assert.assertTrue(three.isPowerOfThree( 1 * 3 * 3 * 3 * 3 * 3 )); Assert.assertFalse(three.isPowerOfThree( 5 )); Assert.assertFalse(three.isPowerOfThree( 5 * 5 )); Assert.assertFalse(three.isPowerOfThree( 5 * 5 * 7 ));
|