美文网首页
单元测试基础

单元测试基础

作者: 别点了填写不了昵称 | 来源:发表于2020-08-06 11:35 被阅读0次

    随笔

    //        assertThat(1,is(1));
    //        assertThat(2,is(not(1)));
    //        assertThat(1,allOf(greaterThan(1),lessThan(1)));
    //        assertThat(1,anyOf(greaterThan(1),lessThan(1)));
    //        assertThat(1,anything());
    //
    //        assertThat(" ",containsString(" "));
    //        assertThat(" ",startsWith("123"));
    //        assertThat(" ",endsWith("123"));
    //        assertThat(1,equalTo(1));
    
    
            assertThat("",equalToIgnoringCase("developer works"));
            assertThat(" ",equalToIgnoringWhiteSpace("developer works"));
    
            assertThat(0.1,closeTo(3.0,0.3));
            assertThat(0.1,greaterThan(3.0));
            assertThat(0.1,lessThan(3.0));
            assertThat(0.1,greaterThanOrEqualTo(0.1));
            assertThat(0.1,lessThanOrEqualTo(0.1));
    
            Map<String,String> map = new HashMap<>();
            Iterator iterator = map.entrySet().iterator();
            assertThat(map,hasEntry("zhang","zhang"));
    //        assertThat(iterator,hasEntry("hello"));   // 暂时报错
    
    
    

    相关文章

      网友评论

          本文标题:单元测试基础

          本文链接:https://www.haomeiwen.com/subject/qdszrktx.html