27 #include <gtest/gtest.h> 45 msg1_ <<
"S_MY_WIEGAND_1";
47 msg1_ <<
"af:bc:12:42";
50 msg2_ <<
"S_MY_WIEGAND_1";
54 msg3_ <<
"S_MY_WIEGAND_1";
56 msg3_ <<
"af:bc:12:42";
86 ASSERT_TRUE(builder_.extract_source_name(
"S_MY_DEVICE", &out));
87 ASSERT_EQ(out,
"MY_DEVICE");
89 ASSERT_TRUE(builder_.extract_source_name(
"S___MY_DEVICE", &out));
90 ASSERT_EQ(out,
"__MY_DEVICE");
92 ASSERT_FALSE(builder_.extract_source_name(
"MY_DEVICE", &out));
93 ASSERT_FALSE(builder_.extract_source_name(
"", &out));
94 ASSERT_FALSE(builder_.extract_source_name(
"S_", &out));
95 ASSERT_FALSE(builder_.extract_source_name(
"D", &out));
101 ASSERT_TRUE(auth_source.get());
105 ASSERT_TRUE(spec.get());
106 ASSERT_EQ(
"af:bc:12:42", spec->card_id());
107 ASSERT_EQ(32, spec->nb_bits());
113 ASSERT_TRUE(auth_source.get());
117 ASSERT_TRUE(spec.get());
118 ASSERT_EQ(
"1234", spec->pin_code());
124 ASSERT_TRUE(auth_source.get());
129 ASSERT_TRUE(spec.get());
130 ASSERT_EQ(
"af:bc:12:42", spec->card().card_id());
131 ASSERT_EQ(32, spec->card().nb_bits());
132 ASSERT_EQ(
"1234", spec->pin().pin_code());
std::shared_ptr< PinCode > PinCodePtr
AuthSourceBuilder builder_
This define message formatting for data source SIMPLE_WIEGAND.
This is the header file for a generated source file, GitSHA1.cpp.
zmqpp::message msg1_
This looks like a message sent by MY_WIEGAND_1 with SIMPLE_WIEGAND data.
std::shared_ptr< RFIDCard > RFIDCardPtr
TEST_F(AuthSourceBuilderTest, BuildCardAndPing)
std::shared_ptr< ICredential > ICredentialPtr
Credentials composed of an RFIDCard and a PIN code.
Holds classes relevant to the Authentication and Authorization subsystem.
Message formatting when using a simple PIN code.
zmqpp::message msg3_
Message to construct a cardId + pin credential.
Authentication backend modules live here.
This class is some kind of factory to create IAuthenticationSource object from a zmqpp::message sent ...
std::shared_ptr< RFIDCardPin > RFIDCardPinPtr
When reading both a card an a PIN code.
zmqpp::message msg2_
This looks like a message sent by MY_WIEGAND_1 with WIEGAND_PIN_4BITS data.
Test the AuthSourceBuilder ability to create AuthSource object from messages.