//#if !(NET35 || NETSTANDARD) using System.Threading.Tasks; //#endif namespace System.Linq.Dynamic.Core.Tests { public class InternalTests { #if ABC [Fact] public void ClassFactory_LoadTest() { //Arrange var rnd = new Random(1); var testPropertiesGroups = new DynamicProperty[][] { new DynamicProperty[] { new DynamicProperty("String1", typeof( string )), }, new DynamicProperty[] { new DynamicProperty("String1", typeof( string )), new DynamicProperty("String2", typeof( string )) }, new DynamicProperty[] { new DynamicProperty("String1", typeof( string )), new DynamicProperty("Int1", typeof( int )) }, new DynamicProperty[] { new DynamicProperty("Int1", typeof( int )), new DynamicProperty("Int2", typeof( int )) }, new DynamicProperty[] { new DynamicProperty("String1", typeof( string )), new DynamicProperty("String2", typeof( string )), new DynamicProperty("String3", typeof( string )), }, }; Action testActionSingle = i => { ClassFactory.Instance.GetDynamicClass(testPropertiesGroups[0]); }; Action testActionMultiple = i => { var testProperties = testPropertiesGroups[rnd.Next(0, testPropertiesGroups.Length)]; ClassFactory.Instance.GetDynamicClass(testProperties); }; //Act Parallel.For(0, 100000, testActionSingle); Parallel.For(0, 100000, testActionMultiple); } #endif } }