-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit df1ccfd Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 23:35:04 2023 -0500 Update storetests.cpp commit 837a84d Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 23:19:54 2023 -0500 All - Improve Docs commit c34ba19 Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 23:19:45 2023 -0500 Tests - Better Store Tests commit 5eac9e3 Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 23:18:06 2023 -0500 Create spelling.yml commit be48316 Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 23:04:56 2023 -0500 Keyring - Better Store Tests commit c4c18e0 Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 22:50:37 2023 -0500 Keyring - Ensure UTF-8 Path + Fix Tests commit 1921ac6 Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 19:30:26 2023 -0500 All - Better Compiler Warnings commit 286de47 Author: Nick Logozzo <[email protected]> Date: Mon Dec 11 19:21:21 2023 -0500 Keyring - SQL Get Err Message
- Loading branch information
Showing
8 changed files
with
64 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
types: [ "review_requested", "ready_for_review" ] | ||
name: Spell Check | ||
jobs: | ||
codespell: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: codespell-project/actions-codespell@master | ||
with: | ||
check_filenames: true | ||
skip: cargo-sources.json,.git,*.svg,*.html,*.js,*.po,*.pot,*.page,*.map | ||
ignore_words_list: gir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,28 +5,38 @@ | |
|
||
using namespace Nickvision::Aura::Keyring; | ||
|
||
static const std::string storeName{ "AuraTestStore" }; | ||
static const std::string storePassword{ PasswordGenerator().next() }; | ||
class StoreTest : public testing::Test | ||
{ | ||
public: | ||
static std::shared_ptr<Store> m_store; | ||
|
||
static void SetUpTestSuite() | ||
{ | ||
Store::destroy("org.nickvision.aura.test"); | ||
PasswordGenerator passGen; | ||
m_store = std::make_shared<Store>("org.nickvision.aura.test", passGen.next()); | ||
} | ||
}; | ||
|
||
std::shared_ptr<Store> StoreTest::m_store = nullptr; | ||
|
||
TEST(StoreTest, EnsureNoStore) | ||
TEST_F(StoreTest, CheckValidStore) | ||
{ | ||
ASSERT_TRUE(Store::destroy(storeName)); | ||
ASSERT_TRUE(m_store->isValid()); | ||
} | ||
|
||
TEST(StoreTests, CreateStrore) | ||
TEST_F(StoreTest, AddCredentials) | ||
{ | ||
Store store{ storeName, storePassword }; | ||
ASSERT_TRUE(store.isValid()); | ||
ASSERT_TRUE(m_store->isValid()); | ||
ASSERT_TRUE(m_store->addCredential({ "YT", "https://youtube.com", "theawesomeguy", "abc123!" })); | ||
ASSERT_TRUE(m_store->addCredential({ "Google", "https://google.com", "[email protected]", "abc12345!" })); | ||
} | ||
|
||
TEST(StoreTests, AddCredentials) | ||
TEST_F(StoreTest, EnsureCredentials) | ||
{ | ||
Store store{ storeName, storePassword }; | ||
ASSERT_TRUE(store.isValid()); | ||
ASSERT_TRUE(store.addCredential({ "YT", "https://youtube.com", "theawesomeguy", "abc123!" })); | ||
ASSERT_TRUE(store.addCredential({ "Google", "https://google.com", "[email protected]", "abc12345!" })); | ||
ASSERT_TRUE(store.getAllCredentials().size() == 2); | ||
std::vector<Credential> creds{ store.getCredentials("YT") }; | ||
ASSERT_TRUE(m_store->isValid()); | ||
ASSERT_TRUE(m_store->getAllCredentials().size() == 2); | ||
std::vector<Credential> creds{ m_store->getCredentials("YT") }; | ||
ASSERT_TRUE(creds.size() == 1); | ||
std::cout << creds[0] << std::endl; | ||
ASSERT_EQ(creds[0].getName(), "YT"); | ||
|
@@ -35,9 +45,8 @@ TEST(StoreTests, AddCredentials) | |
ASSERT_EQ(creds[0].getPassword(), "abc123!"); | ||
} | ||
|
||
TEST(StoreTests, DeleteStore) | ||
TEST_F(StoreTest, DestroyStore) | ||
{ | ||
Store store{ storeName, storePassword }; | ||
ASSERT_TRUE(store.isValid()); | ||
ASSERT_TRUE(store.destroy()); | ||
ASSERT_TRUE(m_store->isValid()); | ||
ASSERT_TRUE(m_store->destroy()); | ||
} |