コード例 #1
0
        private void Add(Dictionary <string, string> dic, int counter)
        {
            var service = new FilingUrlShorteningService(_urlShorteningFileService);

            var key = service.Add($"http://translate.google.com/{counter}");

            dic.Add(key.ResultObject, "");
        }
コード例 #2
0
        public void TestExists()
        {
            var service = new FilingUrlShorteningService(_urlShorteningFileService);

            var key = service.Exists("a0001AVAo");

            var key1 = service.Exists("0123456");

            var key2 = service.Exists("01234");

            var key3 = service.Exists("abv01234");

            var key4 = service.Exists("a0123456");
        }
コード例 #3
0
        public void TestAdd()
        {
            var service = new FilingUrlShorteningService(_urlShorteningFileService);

            var key = service.Add("http://translate.google.com/a");

            var key1 = service.Add("http://translate.google.com/b", "0123456");

            var key2 = service.Add("http://translate.google.com/", "01234");

            var key3 = service.Add("http://translate.google.com/c", "abv01234");

            var key4 = service.Add("http://translate.google.com/d", "a0123456");
        }
コード例 #4
0
        public void TestBulkAdd()
        {
            var dic = new Dictionary <string, string>();

            for (var i = 0; i < 10000; i++)
            {
                var service = new FilingUrlShorteningService(_urlShorteningFileService);

                var key = service.Add($"http://translate.google.com/{i}");

                dic.Add(key.ResultObject, "");
            }

            var t = dic;
        }
コード例 #5
0
        public void TestGet()
        {
            var service = new FilingUrlShorteningService(_urlShorteningFileService);

            var key = service.Get("a0001AVAo");

            var key1 = service.Get("0123456");

            var key2 = service.Get("01234");

            var key3 = service.Get("abv01234");

            var key4 = service.Get("a0123456");

            var key5 = service.Get("a0123456");

            var key6 = service.Get("abcd0123456");
        }