45 lines
697 B
C++
45 lines
697 B
C++
#pragma once
|
|
|
|
#include "String.h"
|
|
#include "Pointer.h"
|
|
#include <functional>
|
|
|
|
class TestCase
|
|
{
|
|
public:
|
|
using TestCaseFunction = std::function<void()>;
|
|
|
|
TestCase(const String& name, const String& tags, TestCaseFunction func)
|
|
: mTestFunction(func),
|
|
mName(name),
|
|
mTags(tags)
|
|
{
|
|
|
|
};
|
|
|
|
virtual ~TestCase() = default;
|
|
|
|
const String& getName() const
|
|
{
|
|
return mName;
|
|
}
|
|
|
|
const String& getTags() const
|
|
{
|
|
return mTags;
|
|
}
|
|
|
|
virtual void run()
|
|
{
|
|
mTestFunction();
|
|
};
|
|
|
|
public:
|
|
TestCaseFunction mTestFunction{nullptr};
|
|
|
|
private:
|
|
String mName;
|
|
String mTags;
|
|
|
|
};
|
|
using TestCasePtr = Ptr<TestCase>;
|