Exemple #1
0
 private static void MultipleSourceCachedCascade(System.Random Rand)
 {
     foreach (Employee3 Employee3 in 100.Times(x => Rand.NextClass <Employee3>()))
     {
         Employee3.Boss = Rand.NextClass <Employee3>();
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached Cascade Save"))
         {
             Employee3.Save();
         }
     }
     for (int x = 0; x < 100; ++x)
     {
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached Cascade All"))
         {
             Employee3.All().ForEach(y => { var Temp = y.Boss; });
         }
     }
     for (int x = 0; x < 100; ++x)
     {
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached Cascade Any"))
         {
             var Temp = Employee3.Any().Boss;
         }
     }
     for (int x = 0; x < 100; ++x)
     {
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached Cascade Paged"))
         {
             Employee3.Paged().ForEach(y => { var Temp = y.Boss; });
         }
     }
 }
Exemple #2
0
 private static void MultipleSourceCached(System.Random Rand)
 {
     foreach (Employee2 Employee2 in 100.Times(x => Rand.NextClass <Employee2>()))
     {
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached Save"))
         {
             Employee2.Save();
         }
     }
     for (int x = 0; x < 100; ++x)
     {
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached All"))
         {
             Employee2.All();
         }
     }
     for (int x = 0; x < 100; ++x)
     {
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached Any"))
         {
             Employee2.Any();
         }
     }
     for (int x = 0; x < 100; ++x)
     {
         using (Utilities.Profiler.Profiler Profiler = new Utilities.Profiler.Profiler("Multiple Source Cached Paged"))
         {
             Employee2.Paged();
         }
     }
 }
Exemple #3
0
        /// <summary>
        /// Loads the module using the bootstrapper
        /// </summary>
        /// <param name="Bootstrapper">Bootstrapper used to register various objects</param>
        public void Load(IBootstrapper Bootstrapper)
        {
            if (Bootstrapper == null)
                return;
            var TempRand = new System.Random();
            Bootstrapper.Register<TestObject>(() => TempRand.NextClass<TestObject>());
            Bootstrapper.Register<string>(() => @"{ ""BoolReference"" : true,
  ""ByteArrayReference"" : [ 1,
      2,
      3,
      4
    ],
  ""ByteReference"" : 200,
  ""CharReference"" : ""A"",
  ""DecimalReference"" : 1.234,
  ""DoubleReference"" : 1.234,
  ""FloatReference"" : 1.234,
  ""GuidReference"" : ""5bec9017-7c9e-4c52-a8d8-ac511c464370"",
  ""ID"" : 55,
  ""IntReference"" : 123,
  ""LongReference"" : 42134123,
  ""NullStringReference"" : null,
  ""ShortReference"" : 1234,
  ""StringReference"" : ""This is a test string""
}");
        }
 public void ClassGenerator()
 {
     System.Random Rand = new System.Random(1231415);
     RandomTestClass Item = Rand.NextClass<RandomTestClass>();
     Assert.Equal(202970450, Item.A);
     Assert.Equal("Lorem ipsum dolor sit amet. ", Item.B);
     Assert.Equal(System.Math.Round(0.9043f, 4), System.Math.Round(Item.C, 4));
     Assert.Between(Item.D, 1, 100);
 }
        public void ClassGenerator()
        {
            var Rand = new System.Random(1231415);
            var Item = Rand.NextClass <RandomTestClass>();

            Assert.Equal(202970450, Item.A);
            Assert.Equal("Lorem ipsum dolor sit amet. ", Item.B);
            Assert.Equal(System.Math.Round(0.9043f, 4), System.Math.Round(Item.C, 4));
            Assert.InRange(Item.D, 1, 100);
        }