public void WrongNetworkThrowsArgumentException()
        {
            Exception exception = Record.Exception(() => NetworkHelpers.GetNetwork("myNetwork"));

            Assert.NotNull(exception);
            Assert.IsType <ArgumentException>(exception);
        }
        public void GetTestNetNetworkReturnsNetworkTest()
        {
            Network test    = KnownNetworks.TestNet;
            Network network = NetworkHelpers.GetNetwork("testnet");

            Assert.Equal(KnownNetworks.TestNet, network);
        }
        public void GetMainNetNetworkReturnsNetworkMain()
        {
            Network main    = KnownNetworks.Main;
            Network network = NetworkHelpers.GetNetwork("mainnet");

            Assert.Equal(KnownNetworks.Main, network);
        }
        public void GetTestNetworkRetuirnsNetworkTest()
        {
            Network test    = Network.TestNet;
            Network network = NetworkHelpers.GetNetwork("test");

            Assert.Equal(Network.TestNet, network);
        }
예제 #5
0
        public void GetNetworkIsCaseInsensitive()
        {
            Network testNetwork = NetworkHelpers.GetNetwork("Test");

            Assert.Equal(Network.PurpleTest, testNetwork);

            Network mainNetwork = NetworkHelpers.GetNetwork("MainNet");

            Assert.Equal(Network.PurpleMain, mainNetwork);
        }
        public void GetNetworkIsCaseInsensitive()
        {
            Network test = KnownNetworks.TestNet;
            Network main = KnownNetworks.Main;

            Network testNetwork = NetworkHelpers.GetNetwork("Test");

            Assert.Equal(KnownNetworks.TestNet, testNetwork);

            Network mainNetwork = NetworkHelpers.GetNetwork("MainNet");

            Assert.Equal(KnownNetworks.Main, mainNetwork);
        }
예제 #7
0
 /// <inheritdoc />
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     return(NetworkHelpers.GetNetwork((string)reader.Value));
 }
예제 #8
0
        public void GetTestNetNetworkRetuirnsNetworkTest()
        {
            Network network = NetworkHelpers.GetNetwork("testnet");

            Assert.Equal(Network.PurpleTest, network);
        }
예제 #9
0
        public void GetMainNetNetworkRetuirnsNetworkMain()
        {
            Network network = NetworkHelpers.GetNetwork("mainnet");

            Assert.Equal(Network.PurpleMain, network);
        }