diff options
| author | sneurlax <sneurlax@gmail.com> | 2024-10-18 18:52:09 -0500 |
|---|---|---|
| committer | sneurlax <sneurlax@gmail.com> | 2024-10-18 18:52:09 -0500 |
| commit | 6f04d7067872b4e0c1e6ddf5a94d3878a3f8cace (patch) | |
| tree | 7ba189169c0cef8eba9338d27c121dc1ccd34821 /impls/monero.rs/tests | |
| parent | 0c0c4133b8edb1f9c8c972b9bacf89f58e04f7e7 (diff) | |
add get_accounts
Diffstat (limited to 'impls/monero.rs/tests')
| -rw-r--r-- | impls/monero.rs/tests/integration_tests.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/impls/monero.rs/tests/integration_tests.rs b/impls/monero.rs/tests/integration_tests.rs index fd96228..95656a4 100644 --- a/impls/monero.rs/tests/integration_tests.rs +++ b/impls/monero.rs/tests/integration_tests.rs @@ -415,3 +415,27 @@ fn test_create_account_integration() { teardown(&temp_dir).expect("Failed to clean up after test"); } + +#[test] +fn test_get_accounts_integration() { + let (manager, temp_dir) = setup().expect("Failed to set up test environment"); + + let wallet_path = temp_dir.path().join("test_wallet"); + let wallet_str = wallet_path.to_str().expect("Failed to convert wallet path to string"); + + let wallet = manager + .create_wallet(wallet_str, "password", "English", NetworkType::Mainnet) + .expect("Failed to create wallet"); + + // Add multiple accounts. + wallet.create_account("Integration Account 1").expect("Failed to create account"); + wallet.create_account("Integration Account 2").expect("Failed to create account"); + + // Fetch accounts. + let accounts_result = wallet.get_accounts(""); + assert!(accounts_result.is_ok(), "Failed to fetch accounts: {:?}", accounts_result.err()); + let accounts = accounts_result.unwrap().accounts; + assert_eq!(accounts.len(), 3, "Expected 3 accounts"); + + teardown(&temp_dir).expect("Failed to clean up after test"); +} |
