eedb/tests/unit/WidgetTest.hpp
2017-03-22 10:00:26 +01:00

28 lines
566 B
C++

#pragma once
#include <gmock/gmock.h>
#include <Wt/Test/WTestEnvironment>
#include <Wt/WApplication>
class WidgetTest : public testing::Test {
public:
WidgetTest() : app(env) {}
template < typename T >
T * ut_find(std::string && id) {
T * item = dynamic_cast< T * >(app.findWidget(id));
_assert_nut_null(item);
return item;
}
protected:
Wt::Test::WTestEnvironment env;
Wt::WApplication app;
private:
template < typename T >
void _assert_nut_null(T * t) {
ASSERT_TRUE(t != nullptr);
}
};