1
0

[Unit Tests] Lock/unlock wallet

This commit is contained in:
Scott E. Graves
2017-02-03 18:44:43 -06:00
parent 9dfc1a9331
commit cdaaafdb50
5 changed files with 34 additions and 8 deletions

View File

@@ -18,10 +18,10 @@ namespace UnitTests
CSiaWalletPtr wallet = _api.GetWallet();
Assert::IsNotNull(wallet.get());
Assert::IsFalse(wallet->GetCreated());
Assert::IsFalse(wallet->GetLocked());
Assert::IsTrue(wallet->GetLocked());
}
TEST_METHOD(CreateWalletWithEnglishSeed)
TEST_METHOD(CreateWalletAndUnlockWithEnglishSeedAndLock)
{
CSiaWalletPtr wallet = _api.GetWallet();
Assert::IsFalse(wallet->GetCreated());
@@ -29,7 +29,15 @@ namespace UnitTests
String seed;
Assert::IsTrue(API_SUCCESS(SiaApiError, wallet->Create(SiaSeedLanguage::English, seed)));
Assert::IsTrue(wallet->GetCreated());
Assert::IsTrue(wallet->GetLocked());
Assert::IsTrue(API_SUCCESS(SiaApiError, wallet->Unlock(seed)));
Assert::IsTrue(wallet->GetCreated());
Assert::IsFalse(wallet->GetLocked());
Assert::IsTrue(API_SUCCESS(SiaApiError, wallet->Lock( )));
Assert::IsTrue(wallet->GetCreated());
Assert::IsTrue(wallet->GetLocked());
}
};
}