亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-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
主站蜘蛛池模板: 特级做a爰片毛片免费看一区 | 欧美a级在线 | 国产成人精品视频免费大全 | 日本亚洲天堂 | 中文字幕精品一区二区日本大胸 | 日韩在线观看不卡 | 两个黑人一前一后好爽 | 一级夫妻录像 | 免费观看性欧美一级 | 99在线看 | 影音先锋日韩 | 久久网精品视频 | 伊人中文字幕在线观看 | 人人干美女 | 成年人色网站 | 97久久精品人人澡人人爽 | 成人抖音网站 | 特级毛片aaaa免费观看 | 久草免费在线播放 | 一级全黄视频 | 天天色操 | 久草三级 | 日本欧美一区二区三区 | 伦伦影院精品一区 | 在线三级网 | 在线观看深夜 | 日韩av线观看| 700av第一福利在线导航 | 美女视频黄a视频全免费网站色窝 | 亚洲性视频网站 | 女同志videos最新另 | 日韩在线不卡视频 | 成 黄 色 激 情视频网站 | 亚洲免费福利 | 成人网址在线观看 | 成人性欧美丨区二区三区 | 欧美一级特黄啪啪片免费看 | 一级毛片在线不卡直接观看 | 日一级片 | 91小视频在线观看免费版高清 | 最新亚洲精品国自产在线观看 |