亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-99久久99久久-99久久99久久精品国产

您的位置:軟件測試 > 開源軟件測試 > 開源單元測試工具 > cppUnit
CPPUnit實例Simple class
作者:網絡轉載 發布時間:[ 2013/3/15 14:10:45 ] 推薦標簽:

        1. CppUnit是xUnit系列中的c++實現版本,它是從JUnit移植過來的,第一個移植版本由Michael Feathers完成,安裝cppunit,你可以在此下載cppunit的新版本,新版本是CppUnit release 1.12.0,安裝方法,現解壓,然后到文件夾下找到INSTALL-WIN32.txt(windows平臺)

        2.打開examples下的examples.dsw,編譯鏈接即可完成。

        3.分析所要測試的類class

class Money
{
public:
  Money( double amount, std::string currency )
    : m_amount( amount )
    , m_currency( currency )
  {
  }

  double getAmount() const
  {
    return m_amount;
  }

  std::string getCurrency() const
  {
    return m_currency;
  }

  bool operator ==( const Money &other ) const
  {
    return m_amount == other.m_amount  &&
           m_currency == other.m_currency;
  }

  bool operator !=( const Money &other ) const
  {
    return !(*this == other);
  }

  Money &operator +=( const Money &other )
  {
    if ( m_currency != other.m_currency )
      throw IncompatibleMoneyError();

    m_amount += other.m_amount;
    return *this;
  }

private:
  double m_amount;
  std::string m_currency;
};

        4. 所要測試的有哪些接口呢?

        我們分析一下這個類的公開的屬性和方法。這些都是我們要測試的接口。

構造函數
Money( double amount, std::string currency )
接口函數有
double getAmount() const
std::string getCurrency() const
bool operator ==( const Money &other ) const
bool operator !=( const Money &other ) const
Money &operator +=( const Money &other )

上一頁123下一頁
軟件測試工具 | 聯系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 伊人天伊人天天网综合视频 | 亚洲福利一区二区三区 | 手机看片高清日韩精品 | 国产成人18黄禁网站免费观看 | 亚洲欧美专区精品久久 | 国产在线精品一区二区中文 | 天天爱天天干天天 | 欧美黄a | 免费在线观看黄 | 男女边摸边吃奶边做视频在线 | 国产婷婷色一区二区三区深爱网 | 永久免费看黄 | 性猛交xxxxx按摩 | 久热久草| 影音先锋在线亚洲精品推荐 | 白洁的性荡生活全文 | 国产在线爱做人成小视频 | 久久窝窝国产精品午夜看15 | qvod激情视频在线观看 | 日批视频免费在线观看 | 国产精品免费大片 | 成人高辣h视频一区二区在线观看 | 影音先锋国产精品 | 成人人观看的免费毛片 | 午夜视频免费在线播放 | 一级做a爰片毛片 | 伊人精品线视天天综合 | 免费涩涩漫画大全 | 免费日本在线 | 嗯啊视频在线 | 亚洲国产精品综合久久2007 | 欧美精品专区免费观看 | 狠狠操2018 | awyy爱我影院午夜 | 国产91在线 | 亚洲 | 中文字幕免费 | 亚欧色视频在线观看免费 | 免费一级欧美片片线观看 | 色老头在线观看精品 | 欧美三级一区二区三区 | 国内黄色片 |