Beispiel #1
0
        public void Input_ClassC_Address()
        {
            var _locals    = new string[] { "192.168.0.1", "192.168.254.11" };
            var _isPrivate = false;

            foreach (var _local in _locals)
            {
                _isPrivate = IPv4.IsPrivate(_local);

                Assert.True(_isPrivate);
            }
        }
Beispiel #2
0
        public void Input_ClassB_Address()
        {
            var _locals    = new string[] { "172.16.2.6", "172.31.0.1" };
            var _isPrivate = false;

            foreach (var _local in _locals)
            {
                _isPrivate = IPv4.IsPrivate(_local);

                Assert.True(_isPrivate);
            }
        }
Beispiel #3
0
        public void Input_ClassA_Address()
        {
            var _locals    = new string[] { "10.0.0.1", "10.10.126.222" };
            var _isPrivate = false;

            foreach (var _local in _locals)
            {
                _isPrivate = IPv4.IsPrivate(_local);

                Assert.True(_isPrivate);
            }
        }
Beispiel #4
0
        public void Input_Local_Address()
        {
            var _locals    = new string[] { "127.0.0.1", "localhost", "::1" };
            var _isPrivate = false;

            foreach (var _local in _locals)
            {
                _isPrivate = IPv4.IsPrivate(_local);

                Assert.True(_isPrivate);
            }
        }
Beispiel #5
0
        public void Input_Internet_Address()
        {
            var _locals    = new string[] { "172.15.0.1", "172.32.254.3" };
            var _isPrivate = false;

            foreach (var _local in _locals)
            {
                _isPrivate = IPv4.IsPrivate(_local);

                Assert.False(_isPrivate);
            }
        }
Beispiel #6
0
        public void Input_StringEmpty_Address()
        {
            var _isPrivate = IPv4.IsPrivate(string.Empty);

            Assert.False(_isPrivate);
        }