public void UnspentTransactionsWithAddressHavingUnspentTransactionsReturnsUnspentTransactions() { var address = new HdAddress { Transactions = new List <TransactionData> { new TransactionData { Id = new uint256(15) }, new TransactionData { Id = new uint256(16), SpendingDetails = new SpendingDetails() }, new TransactionData { Id = new uint256(17) }, new TransactionData { Id = new uint256(18), SpendingDetails = new SpendingDetails() } } }; IEnumerable <TransactionData> result = address.UnspentTransactions(); Assert.Equal(2, result.Count()); Assert.Equal(new uint256(15), result.ElementAt(0).Id); Assert.Equal(new uint256(17), result.ElementAt(1).Id); }
public void UnspentTransactionsWithAddressHavingUnspentTransactionsReturnsUnspentTransactions() { WalletMemoryStore store = new WalletMemoryStore(); var address = new HdAddress { Address = "Address" }; store.Add(new List <TransactionOutputData> { new TransactionOutputData { Id = new uint256(15), OutPoint = new OutPoint(new uint256(15), 1), Address = "Address" }, new TransactionOutputData { Id = new uint256(16), SpendingDetails = new SpendingDetails { TransactionId = new uint256(1) }, OutPoint = new OutPoint(new uint256(16), 1), Address = "Address" }, new TransactionOutputData { Id = new uint256(17), OutPoint = new OutPoint(new uint256(17), 1), Address = "Address" }, new TransactionOutputData { Id = new uint256(18), SpendingDetails = new SpendingDetails { TransactionId = new uint256(1) }, OutPoint = new OutPoint(new uint256(18), 1), Address = "Address" } }); IEnumerable <TransactionOutputData> result = address.UnspentTransactions(store); Assert.Equal(2, result.Count()); Assert.Contains(new uint256(15), result.Select(x => x.Id)); Assert.Contains(new uint256(17), result.Select(x => x.Id)); }
public void UnspentTransactionsWithAddressNotHavingUnspentTransactionsReturnsEmptyList() { WalletMemoryStore store = new WalletMemoryStore(); var address = new HdAddress { Address = "Address" }; store.Add(new List <TransactionOutputData> { new TransactionOutputData { Id = new uint256(16), SpendingDetails = new SpendingDetails { TransactionId = new uint256(1) }, OutPoint = new OutPoint(new uint256(16), 1), Address = "Address" }, new TransactionOutputData { Id = new uint256(18), SpendingDetails = new SpendingDetails { TransactionId = new uint256(1) }, OutPoint = new OutPoint(new uint256(18), 1), Address = "Address" } }); IEnumerable <TransactionOutputData> result = address.UnspentTransactions(store); Assert.Empty(result); }
public void UnspentTransactionsWithAddressWithoutTransactionsReturnsEmptyList() { var address = new HdAddress(); IEnumerable <TransactionData> result = address.UnspentTransactions(); Assert.Empty(result); }
public void UnspentTransactionsWithAddressWithoutTransactionsReturnsEmptyList() { var address = new HdAddress() { Transactions = new List <TransactionData>() }; var result = address.UnspentTransactions(); Assert.Equal(0, result.Count()); }
public void UnspentTransactionsWithAddressWithoutTransactionsReturnsEmptyList() { WalletMemoryStore store = new WalletMemoryStore(); var address = new HdAddress { Address = "Address" }; IEnumerable <TransactionOutputData> result = address.UnspentTransactions(store); Assert.Empty(result); }
public void UnspentTransactionsWithAddressNotHavingUnspentTransactionsReturnsEmptyList() { var address = new HdAddress(new List <TransactionData> { new TransactionData { Id = new uint256(16), SpendingDetails = new SpendingDetails() }, new TransactionData { Id = new uint256(18), SpendingDetails = new SpendingDetails() } }); IEnumerable <TransactionData> result = address.UnspentTransactions(); Assert.Empty(result); }
public void UnspentTransactionsWithAddressNotHavingUnspentTransactionsReturnsEmptyList() { var address = new HdAddress() { Transactions = new List <TransactionData>() { new TransactionData() { Id = new uint256(16), SpendingDetails = new SpendingDetails() }, new TransactionData() { Id = new uint256(18), SpendingDetails = new SpendingDetails() } } }; var result = address.UnspentTransactions(); Assert.Equal(0, result.Count()); }