示例#1
0
        private static IList <string> RandomStrings(int count, TestStringCharset charset, int maxLen)
        {
            IList <string> result = new List <string>(count);

            for (int i = 0; i < count; i++)
            {
                result.Add(charset.randomString(maxLen));
            }
            return(result);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testRandomStrings()
        public virtual void TestRandomStrings()
        {
            for (int i = 0; i < 1000; i++)
            {
                foreach (TestStringCharset charset in TestStringCharset.values())
                {
                    IList <string> list = RandomStrings(100, charset, 30);
                    foreach (string @string in list)
                    {
                        PropertyBlock record = new PropertyBlock();
                        if (LongerShortString.encode(10, @string, record, DEFAULT_PAYLOAD_SIZE))
                        {
                            assertEquals(Values.stringValue(@string), LongerShortString.decode(record));
                        }
                    }
                }
            }
        }