static ComplexExpressionTreeBuilderExtensionsTests() { var targetAssembly = Assembly.LoadFrom("TAlex.MathCore.ComplexExpressions.Extensions.dll"); ConstantFactory = new ConstantFlyweightFactory <object>(); ConstantFactory.LoadFromAssemblies(new List <Assembly> { targetAssembly }); FunctionFactory = new FunctionFactory <object>(); FunctionFactory.LoadFromAssemblies(new List <Assembly> { targetAssembly }); ExpressionTreeBuilder = new ComplexExpressionTreeBuilder { ConstantFactory = ConstantFactory, FunctionFactory = FunctionFactory }; FunctionsTestCasesData = FunctionFactory.GetMetadata().Select(x => { var d = new TestCaseData(x); d.SetName(String.Format("ShouldContainsCorrectedExampleUsages: {0}", x.DisplayName)); return(d); }).ToList(); }
static ComplexExpressionTreeBuilderExtensionsTests() { var targetAssembly = typeof(ExpressionExtensions).Assembly; ConstantFactory = new ConstantFlyweightFactory <object>(); ConstantFactory.LoadFromAssemblies(new List <Assembly> { targetAssembly }); FunctionFactory = new FunctionFactory <object>(); FunctionFactory.LoadFromAssemblies(new List <Assembly> { targetAssembly }); ExpressionTreeBuilder = new ComplexExpressionTreeBuilder { ConstantFactory = ConstantFactory, FunctionFactory = FunctionFactory }; FunctionsTestCasesData = FunctionFactory.GetMetadata().ToArray(); }
static ComplexExpressionTreeBuilderExtensionsTests() { var targetAssembly = Assembly.LoadFrom("TAlex.MathCore.ComplexExpressions.Extensions.dll"); ConstantFactory = new ConstantFlyweightFactory<object>(); ConstantFactory.LoadFromAssemblies(new List<Assembly> { targetAssembly }); FunctionFactory = new FunctionFactory<object>(); FunctionFactory.LoadFromAssemblies(new List<Assembly> { targetAssembly }); ExpressionTreeBuilder = new ComplexExpressionTreeBuilder { ConstantFactory = ConstantFactory, FunctionFactory = FunctionFactory }; FunctionsTestCasesData = FunctionFactory.GetMetadata().Select(x => { var d = new TestCaseData(x); d.SetName(String.Format("ShouldContainsCorrectedExampleUsages: {0}", x.DisplayName)); return d; }).ToList(); }