Ejemplo n.º 1
0
        public void ConvertTo_WithValidValue_ShouldSuccess(string address, NetworkType networkType, string expectedOutput)
        {
            var configuration = new BitcoinAddressConfiguration();

            configuration.Type    = networkType;
            configuration.Address = BitcoinAddress.Create(address, ZcoinNetworks.Instance.GetNetwork(networkType));

            // Assert.
            Assert.Equal(expectedOutput, this.subject.ConvertTo(configuration, typeof(string)));
        }
Ejemplo n.º 2
0
        public void ConvertTo_WithUnsupportType_ShouldThrow(Type type)
        {
            var configuration = new BitcoinAddressConfiguration();

            configuration.Type    = NetworkType.Mainnet;
            configuration.Address = BitcoinAddress.Create(
                "a8ULhhDgfdSiXJhSZVdhb8EuDc6R3ogsaM",
                ZcoinNetworks.Instance.GetNetwork(NetworkType.Mainnet)
                );

            Assert.Throws <NotSupportedException>(
                () => this.subject.ConvertTo(configuration, type)
                );
        }