You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
falk-werner_webfused/test/auth/factory.cc

20 lines
535 B

#include <gtest/gtest.h>
#include "webfused/auth/factory.h"
#include "webfused/auth/authenticator.h"
#include "webfused/log/log.h"
#include "mock/logger.hpp"
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;
bool result = wfd_authenticator_create("unknown", NULL, &authenticator);
ASSERT_FALSE(result);
}