<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    love fish大鵬一曰同風起,扶搖直上九萬里

    常用鏈接

    統計

    積分與排名

    friends

    link

    最新評論

    junit assert() 使用實例

    package com.liyingcheng.netTest;


    import com.liyingcheng.net.Sort;

    import junit.framework.Test;
    import junit.framework.TestCase;
    import junit.framework.TestSuite;
    import junit.xiaoxuhui.Sum;


    public class SortTest extends TestCase
    {
    ?// Sort popObj = new Sort();

    ?public SortTest(String name)
    ?{
    ??super(name);
    ?}


    ?protected void setUp() throws Exception
    ?{
    ??super.setUp();
    ?}


    ?protected void tearDown() throws Exception
    ?{
    ??super.tearDown();
    ?}


    ?static public void assertEquals(int[] expected, int[] actual)
    ?{
    ??for(int i = 0; i < expected.length; i++)
    ??{
    ???assertEquals(null, expected[i], actual[i]);
    ??}
    ?}


    ?public void testPopSort()
    ?{
    ??int[] expected = new int[] {1, 2, 3, 4};
    ??assertEquals(expected, Sort.popSort(new int[] {1, 2, 4, 3}));
    ??assertEquals(expected, Sort.popSort(new int[] {1, 2, 3, 4}));
    ??assertEquals(expected, Sort.popSort(new int[] {1, 3, 4, 2}));
    ??assertEquals(expected, Sort.popSort(new int[] {1, 3, 2, 4}));
    ??assertEquals(expected, Sort.popSort(new int[] {2, 1, 4, 3}));
    ??assertEquals(expected, Sort.popSort(new int[] {2, 4, 1, 3}));
    ??assertEquals(expected, Sort.popSort(new int[] {3, 2, 4, 1}));
    ??assertEquals(new int[] {1, 2}, Sort.popSort(new int[] {2, 1}));
    ??// assertEquals(new int[]{1,3,2,4},popObj.popSort(new int[]{1,2,4,3}));
    ??// assertEquals(new int[]{1,2,3,4},popObj.popSort(new int[]{1,2,4,3}));
    ?}


    ?public void testCreateArray()
    ?{
    ??assertEquals(4, Sort.createArray(4).length);
    ?}


    ?public void testGetSum()
    ?{
    ??assertEquals(5050, Sum.getSum(1, 100));
    ?}


    ?public void testFalse()
    ?{
    ??assertFalse(false);
    ??assertTrue(true);
    ?}


    ?public void testIsNull()
    ?{
    ??String str1 = "";
    ??int[] arr1 = {};
    ??String str2 = null;
    ??int[] arr2 = null;
    ??assertNotNull(str1);
    ??assertNotNull(arr1);
    ??assertNull(str2);
    ??assertNull(arr2);
    ??// assertNull(str);
    ?}


    ?public void testNull()
    ?{
    ?}


    ?public void testNotSame()
    ?{
    ??String str1 = "123";
    ??String str2 = "123";
    ??String str3 = new String(str1);
    ??String str4 = new String("123");
    ??int one = 1;
    ??int first = 1;
    ??assertSame(one, first);
    ??assertSame(str1, str2);
    ??assertNotSame(str3, str4);
    ??//fail("hahahahahahahah");
    ??/*
    ?? * assertNotSame(one,first); assertNotSame(str1,str2);
    ?? */
    ?}


    ?public static Test suite()
    ?{
    ??TestSuite suite = new TestSuite("Test sort!");
    ??suite.addTestSuite(SortTest.class);
    ??return suite;
    ?}

    }

    posted on 2007-01-18 15:22 liaojiyong 閱讀(2269) 評論(0)  編輯  收藏 所屬分類: Testing

    主站蜘蛛池模板: 免费无码国产在线观国内自拍中文字幕 | 好爽…又高潮了毛片免费看| 亚洲Av无码专区国产乱码DVD| 一级免费黄色大片| 久久久久久亚洲精品不卡| 国产精品美女免费视频观看| 亚洲人成人网站在线观看| 国产免费福利体检区久久| 久久精品国产亚洲沈樵| 国产精品免费看久久久| 91嫩草私人成人亚洲影院| 亚洲一区免费在线观看| 天堂亚洲国产中文在线| 国产在线不卡免费播放| 深夜免费在线视频| 亚洲AV中文无码字幕色三| 免费无码毛片一区二区APP| 亚洲人成在线中文字幕| 国产不卡免费视频| 中文毛片无遮挡高清免费| 亚洲最大的成网4438| 在线观看日本免费a∨视频| 色噜噜噜噜亚洲第一| 毛茸茸bbw亚洲人| 久久久免费的精品| 亚洲av片不卡无码久久| 免费萌白酱国产一区二区| 最新国产乱人伦偷精品免费网站| 色噜噜综合亚洲av中文无码| 好爽…又高潮了毛片免费看| 一级做a爰性色毛片免费| 亚洲伊人久久大香线蕉苏妲己| 毛片免费观看的视频| 亚洲国产免费综合| 亚洲国产夜色在线观看| 亚洲国产精品一区二区九九| 日韩精品无码一区二区三区免费| 亚洲日韩一区二区一无码| 亚洲日产韩国一二三四区| 无码日韩精品一区二区免费| 国产精品永久免费视频|