⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testdecorator.h

📁 著名的uncle Bob的Agile software development的代码
💻 H
字号:


#ifndef CPPUNIT_TESTDECORATOR_H
#define CPPUNIT_TESTDECORATOR_H

#ifndef CPPUNIT_GUARDS_H
#include "Guards.h"
#endif

#ifndef CPPUNIT_TEST_H
#include "Test.h"
#endif

class TestResult;

/*
 * A Decorator for Tests
 *
 * Does not assume ownership of the test it decorates
 *
 */ 

class TestDecorator : public Test 
{
    REFERENCEOBJECT (TestDecorator)

public:
                TestDecorator   (Test *test);
                ~TestDecorator  ();

    int         countTestCases  ();
    void        run             (TestResult *result);
    std::string toString        ();

protected:
    Test        *m_test;


};


inline TestDecorator::TestDecorator (Test *test)
{ m_test = test; }


inline TestDecorator::~TestDecorator ()
{}


inline TestDecorator::countTestCases ()
{ return m_test->countTestCases (); }


inline void TestDecorator::run (TestResult *result)
{ m_test->run (result); }


inline std::string TestDecorator::toString ()
{ return m_test->toString (); }


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -