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

您的位置:軟件測試 > 開源軟件測試 > 開源單元測試工具 > cppUnit
CPPUnit實例Simple class
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2013/3/15 14:10:45 ] 推薦標(biāo)簽:

        1. CppUnit是xUnit系列中的c++實現(xiàn)版本,它是從JUnit移植過來的,第一個移植版本由Michael Feathers完成,安裝cppunit,你可以在此下載cppunit的新版本,新版本是CppUnit release 1.12.0,安裝方法,現(xiàn)解壓,然后到文件夾下找到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. 所要測試的有哪些接口呢?

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

構(gòu)造函數(shù)
Money( double amount, std::string currency )
接口函數(shù)有
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下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 黑人操日本人视频 | 一级做a爰片欧美一区 | 好男人www社区视频在线 | 一级毛片免费在线观看网站 | 性xxxxbbbb免费播放视频 | 青青草国拍| 国产亚洲欧美成人久久片 | 一级毛片在线完整免费观看 | 狠狠综合久久久久综合 | 欧美黄色一级片免费看 | 欧美激情在线观看一区二区三区 | 国产在线视频专区 | 免费网站看v片在线播放器 免费无毒片在线观看 | 国产视频精品免费 | 亚洲欧洲国产视频 | 亚洲春色第一页 | 欧美日韩国产一区二区三区欧 | 国产成人欧美一区二区三区vr | 午夜国产精品视频 | 天天色天天色 | www小视频| 欧美日本一道高清免费3区 欧美日本一二三区 | 91在线精品麻豆欧美在线 | 欧美日韩在线视频 | 亚洲激情综合 | 91中文字幕网 | 免费簧网站永久在线播放国产 | 免费观看成人毛片 | 久久亚洲综合 | 毛片a级毛片免费播放100 | 日韩一级精品视频在线观看 | 手机免费看伦理片 | 亚洲免费国产 | 全部免费特黄特色大片视频 | 中文字幕在线观看第一页 | 亚洲精品第一国产综合野 | 欧美系列第一页 | 久久婷婷午色综合夜啪 | 成人十八影院在线观看 | 成人小视频在线播放 | 日韩在线观 |