Exemple #1
0
        public static LargeObject Create()
        {
            var rng = Program.Rng;
            var obj = new LargeObject
            {
                Id          = rng.Next(0, Int32.MaxValue),
                Age         = rng.Next(0, 70),
                Amount      = (Decimal)(rng.NextDouble() * 1000),
                Description = Program.RandomString(rng.Next(1, 30), "The quick brown fox jumps over the lazy dog"),
                Double      = rng.NextDouble(),
                Price       = (Decimal)(rng.NextDouble() * 10),
                Probability = (Decimal)rng.NextDouble(),
                Single      = rng.Next(0, Int16.MaxValue),
                Time        = DateTime.Now,
                TimeUtc     = DateTime.UtcNow,
                Uid         = Guid.NewGuid(),
                X           = (Byte)rng.Next(0, 255),
                Y           = (Byte)rng.Next(0, 255),
                Z           = (Byte)rng.Next(0, 255)
            };

            return(obj);
        }
Exemple #2
0
 public void Setup()
 {
     Objects          = Enumerable.Range(0, 100000).Select(x => LargeObject.Create()).ToList();
     ObjectsJson      = JsonConvert.Serialize(Objects);
     ObjectsJsonBytes = Encoding.UTF8.GetBytes(ObjectsJson);
 }
Exemple #3
0
 public void Setup()
 {
     Objects = Enumerable.Range(0, 100000).Select(x => LargeObject.Create()).ToList();
 }