TestName Rule

TestName是用来测试方法名的

    public class NameRuleTest {
      @Rule
      public TestName name = new TestName();

      @Test
      public void testA() {
        assertEquals("testA", name.getMethodName());
      }

      @Test
      public void testB() {
        assertEquals("testB", name.getMethodName());
      }
    }
Copyright © www.gitbook.com/@herryZ 2016 all right reserved,powered by Gitbook该文件修订时间: 2017-03-13 05:37:11

results matching ""

    No results matching ""