Beispiel #1
0
        public void ProcessResponseTest()
        {
            var stringWriter = new StringWriter();
            var api          = new BitnodesApi(stringWriter);

            api.ProcessResponse(ApiResponse, currentOnions: null);

            // tep3ddikbopezl4v.onion is skipped because it is not a full node.
            Assert.Equal($"nesxfmano25clfvn.onion:8333{Environment.NewLine}tg4uwrjmtr2jlbjy.onion:8333{Environment.NewLine}", stringWriter.ToString());
        }
Beispiel #2
0
        public void ProcessResponseWithCurrentOnionsTest()
        {
            var currentOnions = new HashSet <string>()
            {
                "tg4uwrjmtr2jlbjy.onion:8333",        // Fulfills all criteria.
                "tep3ddikbopezl4v.onion:8333",        // This one is not a full node, so it should not be in the result.
                "185.25.48.184:8333",                 // Not an onion address.
            };

            var stringWriter = new StringWriter();
            var api          = new BitnodesApi(stringWriter);

            api.ProcessResponse(ApiResponse, currentOnions);

            // tep3ddikbopezl4v.onion is skipped because it is not a full node.
            Assert.Equal($"tg4uwrjmtr2jlbjy.onion:8333{Environment.NewLine}", stringWriter.ToString());
        }