public void Initialize()
 {
     stringsToConcat = new string[NumberOfStrings];
     for (int i = 0; i < NumberOfStrings; i++)
     {
         stringsToConcat[i] = Randomizer.GetRandomAsciiString(StringLength);
     }
 }
示例#2
0
        public void Initialize()
        {
            someClassArray       = new SomeClass[NumberOfElements];
            sortedSomeClassArray = new SomeClass[NumberOfElements];
            someClassDictionary  = new Dictionary <string, SomeClass>();
            namesToLookup        = new string[NumberOfElements];

            for (int i = 0; i < NumberOfElements; i++)
            {
                var randomName = Randomizer.GetRandomAsciiString(10);
                namesToLookup[i] = randomName;

                var someClass = new SomeClass(randomName, Randomizer.GetRandomAsciiString(30));
                someClassArray[i]       = someClass;
                sortedSomeClassArray[i] = someClass;
                someClassDictionary.Add(someClass.Name, someClass);
            }

            Array.Sort(sortedSomeClassArray, (item1, item2) => item1.Name.CompareTo(item2.Name));

            namesToLookup = Randomizer.ShuffleArray(namesToLookup);
        }
 public void Initialize()
 {
     stringA = Randomizer.GetRandomAsciiString(StringLength);
     stringB = stringA + Randomizer.GetRandomAsciiString(1);
 }