亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-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
主站蜘蛛池模板: 欧美中文小说在线观看 | www.一级片| 日韩美女一级毛片 | 天天狠天天透天天伊人 | 欧美freehdvideos性 | 国产一级免费片 | 亚欧洲精品bb | 精品欧美日韩一区二区三区 | 男女一起www免费高清视频 | 欧美一区二区三区香蕉视 | 露脸国产自产拍在线观看 | 欧美视频不卡一区二区三区 | 亚洲va久久久久 | 亚洲日产国码 | 午夜影院18| 色天使久久综合给合久久97色 | 欧美视频一区二区专区 | 欧美黄色片 一级片 | 国产精品激情丝袜美女 | 午夜剧场福利 | 欧美成人www在线观看网页 | 高清欧美一区二区三区 | 黄色片免费观看网站 | 狠狠色综合色综合网站嗯 | 日韩第二页 | 成人黄色在线 | 一区二区视频在线观看免费的 | 免费日韩| 久久亚洲网站 | 91欧洲在线视精品在亚洲 | 免费操 | 黄色日韩| 免费人成激情视频在线观看 | a一级爱做片免费 | 一级片视频在线观看 | 男女午夜性爽快免费视频不卡 | 夜夜揉揉日日人人视频 | 9966国产精品视频 | 一级毛片视频免费观看 | 新版天堂资源中文在线 | 欧美午夜免费看爽爽爽 |