eedb/tests/unit/WidgetTest.hpp
Bartosz Wieczorek 2c50e3ee7f refactor
2018-01-25 14:28:45 +01:00

28 lines
570 B
C++

#pragma once
#include <gmock/gmock.h>
#include <Wt/Test/WTestEnvironment.h>
#include <Wt/WApplication.h>
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);
}
};