亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-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
主站蜘蛛池模板: 在线成人看片 | 又黄又爽一线毛片免费观看 | 日本黄色一级片视频 | 老司机午夜在线视频免费 | 最近最新的日本免费 | 欧美在线播放成人免费 | 狠狠色狠狠色综合网 | 国产黄色片在线免费观看 | 成人网免费| 国产精品久久久久无毒 | gogo全球高清大尺度美女人体 | 国产在线观看成人 | 美女下面粉嫩粉嫩冒白浆高清 | 伦理片中文字幕完整视频 | 日本人在线看片 | 国产精品欧美亚洲韩国日本99 | 亚洲第一成年网 | 最近2019中文| 五月天堂婷婷 | 免费一级真人毛片 | 国产一级片视频 | 久色视频在线 | 黄色免费一级播放片 | 国产在线欧美精品中文一区 | 欧美日韩中文国产 | 成人免费手机在线看网站 | 日本欧美一区二区三区高清 | 日韩精品欧美精品中文精品 | 欧美激情视频免费 | 黄色最新网址 | 日本欧美国产精品第一页久久 | 日韩精品视频网站 | 日韩在线播放中文字幕 | 天天做天天爱夜夜大爽完整 | 亚色污 | 97黄色网| 最近中文字幕免费mv在线视频 | 成年大片免费播放视频人 | 羞羞视频免费观看 | 欧美韩日 | 国产丰满老妇伦子www |