mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-09 13:26:16 +08:00
Add unit tests for subscription manager #4715
This commit is contained in:
@@ -36,6 +36,7 @@ endif()
|
||||
include_directories(
|
||||
../
|
||||
../../../ext
|
||||
../../../ext/gtest-1.6.0/include
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "SubscriptionKey.h"
|
||||
#include "common/common.h"
|
||||
|
||||
#include "gtest/gtest_prod.h"
|
||||
|
||||
class SubscriptionManager {
|
||||
public:
|
||||
SubscriptionManager();
|
||||
@@ -32,7 +34,16 @@ public:
|
||||
|
||||
//! Use standard output to return subscription filename to gui
|
||||
void printFilename();
|
||||
|
||||
|
||||
private:
|
||||
FRIEND_TEST(SubscriptionTests, decode_invalidLength_throwException);
|
||||
FRIEND_TEST(SubscriptionTests, decode_unrecognizedDigit_throwException);
|
||||
FRIEND_TEST(SubscriptionTests, decode_invalidSerial_outputPlainText);
|
||||
FRIEND_TEST(SubscriptionTests, parsePlainSerial_noParity_throwException);
|
||||
FRIEND_TEST(SubscriptionTests, parsePlainSerial_invalidSerial_throwException);
|
||||
FRIEND_TEST(SubscriptionTests, parsePlainSerial_validSerial_throwException);
|
||||
FRIEND_TEST(SubscriptionTests, parsePlainSerial_expiredSerial_throwException);
|
||||
|
||||
private:
|
||||
String decode(const String& input);
|
||||
void parsePlainSerial(const String& plainText, SubscriptionKey& key);
|
||||
|
||||
Reference in New Issue
Block a user