亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-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
主站蜘蛛池模板: 在线中文高清资源免费观看 | 欧美三级黄视频 | 一级特黄aaa大片在线观看 | 国产成人精品日本亚洲专一区 | 日韩免费视频在线观看 | 精品国产一区二区三区不卡 | 新97人人模人人爽人人喊 | 日韩视频在线免费 | 精品国产_亚洲人成在线高清 | 日韩美一区二区三区 | 国产在线视频一区二区三区 | 特级淫片aaaa毛片aa视频 | 久久久国产视频 | 国产精品天干天干 | 免费日韩在线视频 | 久久久青青草 | 中文字幕成人免费高清在线 | 成年视频免费观看 | 大象焦伊人久久综合网色视 | 视频精品一区二区三区 | 欧美一级免费在线观看 | 欧美日韩中文一区二区三区 | 中文字幕日本在线观看 | 一区二区不卡在线观看 | 亚洲看片 | 欧美另类高清 videos | 久久青草18免费观看网站 | 最新的黄色网址 | 国产在线精品一区二区中文 | 荡娃艳妇系列小说 | 92看片淫黄大片欧美看国产片 | 狠狠插综合网 | 亚洲色图国产 | 亚洲精品成人网久久久久久 | 一级片黄色片 | h国产在线 | 交在线观看网站视频 | 人人爱人人做 | 一个人免费看的视频www | 交video| 欧美丝袜自拍 |