示例#1
0
        public void GetLastUsedAddressWithChangeAddressesHavingTransactionsReturnsHighestIndex()
        {
            var account = new HdAccount();

            account.InternalAddresses.Add(new HdAddress {
                Index = 2, Transactions = new List <TransactionData> {
                    new TransactionData()
                }
            });
            account.InternalAddresses.Add(new HdAddress {
                Index = 3, Transactions = new List <TransactionData> {
                    new TransactionData()
                }
            });
            account.InternalAddresses.Add(new HdAddress {
                Index = 1, Transactions = new List <TransactionData> {
                    new TransactionData()
                }
            });

            var result = account.GetLastUsedAddress(isChange: true);

            Assert.Equal(account.InternalAddresses.ElementAt(1), result);
        }