public async Task <string> GetValidAddressAsync(string text)
        {
            var addresses = text.Split(' ').Where(w => (w.StartsWith("s1") || w.StartsWith("s3")) && w.Length > 30)
                            .Select(w => w.Trim());

            foreach (var address in addresses)
            {
                var isValid = (await _nodeApi.ValidateAddressAsync(address)).Result.IsValid;
                if (isValid)
                {
                    return(address);
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        public async Task ValidateAddress_Should_ReturnResult(string address, bool isValid)
        {
            var result = await _nodeApi.ValidateAddressAsync(address);

            Assert.True(result.Result.IsValid == isValid);
        }