1
0
mirror of https://github.com/falk-werner/webfused synced 2024-10-27 20:44:08 +00:00
falk-werner_webfused/test/auth/factory.cc

20 lines
535 B
C++
Raw Normal View History

2020-03-16 20:50:31 +00:00
#include <gtest/gtest.h>
#include "webfused/auth/factory.h"
#include "webfused/auth/authenticator.h"
#include "webfused/log/log.h"
2020-03-20 12:48:58 +00:00
#include "mock/logger.hpp"
2020-03-16 20:50:31 +00:00
using ::testing::_;
using ::webfused_test::MockLogger;
TEST(auth_factory, fail_unknown_provider)
{
MockLogger logger;
EXPECT_CALL(logger, log(WFD_LOGLEVEL_ERROR, _, _)).Times(1);
EXPECT_CALL(logger, onclose()).Times(1);
wfd_authenticator authenticator;
2020-03-18 09:17:17 +00:00
bool result = wfd_authenticator_create("unknown", NULL, &authenticator);
2020-03-16 20:50:31 +00:00
ASSERT_FALSE(result);
}