Ejemplo n.º 1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="TestSizeObject"/> class.
		/// </summary>
		/// <param name="size">The size.</param>
		public TestSizeObject(TestApplication.ObjectSize size)
		{
			switch (size)
			{
				case TestApplication.ObjectSize.One:
					byteArray = new byte[1024];
					break;
				case TestApplication.ObjectSize.Hundert:
					byteArray = new byte[1024 * 128];
					break;
				case TestApplication.ObjectSize.Thousend:
					byteArray = new byte[1024 * 1024];
					break;
			}

			Random r = new Random();
			for (int i = 0; i < byteArray.Length; i++)
			{
				int bb = r.Next(65, 97);
				byteArray[i] = Convert.ToByte(bb);
			}
		}
Ejemplo n.º 2
0
		public TestSizeObjectWithList(TestApplication.ObjectSize size) 
		{
			switch (size)
			{
				case TestApplication.ObjectSize.One:
					length = 1024;
					break;
				case TestApplication.ObjectSize.Hundert:
					length = 1024 * 128;
					break;
				case TestApplication.ObjectSize.Thousend:
					length = 1024 * 1024;
					break;
			}

			Random r = new Random();
			for (int i = 0; i < length; i++)
			{
				int bb = r.Next(65, 97);
				data.Add(Convert.ToByte(bb));
			}
		}