Example #1
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);
 }