2019-03-23 21:53:14 +00:00
|
|
|
#ifndef MOCK_AUTHENTICATOR_H
|
|
|
|
#define MOCK_AUTHENTICATOR_H
|
|
|
|
|
|
|
|
#include <gmock/gmock.h>
|
2019-03-26 14:35:33 +00:00
|
|
|
#include "wsfs/adapter/impl/authenticator.h"
|
2019-03-23 21:53:14 +00:00
|
|
|
|
|
|
|
namespace wsfs_test
|
|
|
|
{
|
|
|
|
|
|
|
|
class Authenticator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~Authenticator() { }
|
|
|
|
virtual bool authenticate(
|
|
|
|
struct wsfs_credentials * credentials,
|
|
|
|
void * user_data) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MockAuthenticator: public Authenticator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MOCK_METHOD2(authenticate, bool (struct wsfs_credentials * credentials, void * user_data));
|
|
|
|
};
|
|
|
|
|
|
|
|
void set_authenticator(Authenticator * authenticator);
|
|
|
|
void set_authenticator(size_t index, Authenticator * authenticator);
|
|
|
|
|
|
|
|
bool authenticate(struct wsfs_credentials * creds, void * user_data);
|
|
|
|
bool authenticate_1(struct wsfs_credentials * creds, void * user_data);
|
|
|
|
bool authenticate_2(struct wsfs_credentials * creds, void * user_data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|