public void AnonymousIP_ValidResponse()
 {
     using (var reader = new DatabaseReader(_anonymousIpDatabaseFile))
     {
         var ipAddress = "1.2.0.1";
         var response  = reader.AnonymousIP(ipAddress);
         Assert.True(response.IsAnonymous);
         Assert.True(response.IsAnonymousVpn);
         Assert.False(response.IsHostingProvider);
         Assert.False(response.IsPublicProxy);
         Assert.False(response.IsTorExitNode);
         Assert.Equal(ipAddress, response.IPAddress);
     }
 }
        public void AnonymousIP_ValidResponseWithAllTrue()
        {
            using var reader = new DatabaseReader(_anonymousIpDatabaseFile);
            var ipAddress = "81.2.69.1";
            var response  = reader.AnonymousIP(ipAddress);

            Assert.True(response.IsAnonymous);
            Assert.True(response.IsAnonymousVpn);
            Assert.True(response.IsHostingProvider);
            Assert.True(response.IsPublicProxy);
            Assert.True(response.IsResidentialProxy);
            Assert.True(response.IsTorExitNode);
            Assert.Equal(ipAddress, response.IPAddress);
            Assert.Equal("81.2.69.0/24", response.Network?.ToString());
        }
Exemplo n.º 3
0
        public void AnonymousIP()
        {
            using (var reader = new DatabaseReader(Path.Combine(_databaseDir, "GeoIP2-Anonymous-IP-Test.mmdb")))
            {
                var ipAddress = "1.2.0.1";

                var response = reader.AnonymousIP(ipAddress);

                Assert.That(response.IsAnonymous, Is.True);
                Assert.That(response.IsAnonymousVpn, Is.True);
                Assert.That(response.IsHostingProvider, Is.False);
                Assert.That(response.IsPublicProxy, Is.False);
                Assert.That(response.IsTorExitNode, Is.False);
                Assert.That(response.IPAddress, Is.EqualTo(ipAddress));
            }
        }
Exemplo n.º 4
0
        public void AnonymousIP()
        {
            using (var reader = new DatabaseReader(Path.Combine(_databaseDir, "GeoIP2-Anonymous-IP-Test.mmdb")))
            {
                var ipAddress = "1.2.0.1";

                var response = reader.AnonymousIP(ipAddress);

                Assert.That(response.IsAnonymous, Is.True);
                Assert.That(response.IsAnonymousVpn, Is.True);
                Assert.That(response.IsHostingProvider, Is.False);
                Assert.That(response.IsPublicProxy, Is.False);
                Assert.That(response.IsTorExitNode, Is.False);
                Assert.That(response.IPAddress, Is.EqualTo(ipAddress));
            }
        }