public void Parse_returns_empty_vault_and_no_private_key(string json) { var(accounts, privateKey) = VaultParser.Parse(JObject.Parse(json)); Assert.Empty(accounts); Assert.Null(privateKey); }
public void Parse_returns_accounts_and_private_key(string fixture) { var(accounts, privateKey) = VaultParser.Parse(JObject.Parse(GetFixture(fixture))); Assert.NotEmpty(accounts); Assert.NotNull(privateKey); }
public void Parse_prepends_parent_path(string fixture) { var parentPath = "blah/blah-blah"; var(accounts, _) = VaultParser.Parse(JObject.Parse(GetFixture(fixture)), parentPath); foreach (var account in accounts) { Assert.StartsWith(parentPath, account.Path); } }
public void Parse_returns_vault() { var vault = VaultParser.Parse(JObject.Parse(TestData.DecryptedBlob)); Assert.That(vault.Accounts.Length, Is.GreaterThan(1)); }
public void Parse_throws_when_root_folder_is_invalid(string json) { Exceptions.AssertThrowsInternalError(() => VaultParser.Parse(JObject.Parse(json)), "Invalid format: root folder not found"); }
public void Parse_returns_no_private_key(string json) { var(_, privateKey) = VaultParser.Parse(JObject.Parse(json)); Assert.Null(privateKey); }
public void Parse_returns_empty_vault(string json) { var(accounts, _) = VaultParser.Parse(JObject.Parse(json)); Assert.Empty(accounts); }
public void Parse_throws_when_item_info_block_is_invalid(string json) { Exceptions.AssertThrowsInternalError(() => VaultParser.Parse(JObject.Parse(RootPrefix + json + RootSuffix)), "Invalid format: item info block not found"); }