Пример #1
0
        public void BinarySearchByIpAddressOutsideDbTest()
        {
            var ipString      = IpAddressHelpers.IpUintToString(7);
            var searchService = new SearchService(new ConverterService(), repository);

            var result = searchService.BinarySearchByIpAddress(ipString);

            Assert.Equal(result.Length, 0);
        }
Пример #2
0
        public void BinarySearchByCorrectIpAddressTest()
        {
            var ipString      = IpAddressHelpers.IpUintToString(9);
            var searchService = new SearchService(new ConverterService(), repository);

            var result = searchService.BinarySearchByIpAddress(ipString);

            Assert.Equal(result.Length, 1);
            Assert.Equal(result[0].CityName, "cit_1");
        }