-
Notifications
You must be signed in to change notification settings - Fork 1
Examples
MorleyDev edited this page Apr 10, 2013
·
2 revisions
#include <UnitTest11.hpp>
int main()
{
return ut11::Run();
}#include <UnitTest11.hpp>
class BasicTestFixture : public ut11::TestFixture
{
private:
Calculator* m_calculator;
int m_result;
public:
virtual void Run()
{
Given("a calculator", [&]() {
m_calculator = new Calculator();
});
When("adding together two numbers", [&](){
m_result = m_calculator->Add(5, 3);
});
Then("the result is as expected", [&](){
AssertThat(m_result, ut11::Is::EqualTo(8));
});
Finally("garbage collection", [&](){
delete m_calculator;
});
}
};
DeclareFixture(BasicTestFixture);