Beispiel #1
0
        public OperatorPackagesRoot LoadOperators()
        {
            var list = new List <PackageNode>();

            var root = new OperatorPackagesRoot("Root");

            IEnumerable <IOperatorsPackage> packages = _loader.ReloadOperators();

            foreach (IOperatorsPackage operatorsPack in packages)
            {
                var package = new PackageNode(root, operatorsPack);
                foreach (IMutationOperator mutationOperator in operatorsPack.Operators)
                {
                    var operatorNode = new OperatorNode(package, mutationOperator);
                    package.Children.Add(operatorNode);
                }
                root.Children.Add(package);
                list.Add(package);
            }
            root.IsIncluded = true;
            if (!root.Children.Any())
            {
                throw new InvalidOperationException("No mutation operators were found.");
            }
            return(root);
        }
        public PackageNode(OperatorPackagesRoot root, IOperatorsPackage operatorsPackage)
            : base( operatorsPackage.Name)
        {
            _operatorsPackage = operatorsPackage;
            Parent = root;

        }
        public OperatorPackagesRoot LoadOperators()
        {
            var list = new List<PackageNode>();

            var root = new OperatorPackagesRoot("Root");

            IEnumerable<IOperatorsPackage> packages = _loader.ReloadOperators();
            foreach (IOperatorsPackage operatorsPack in packages)
            {
                var package = new PackageNode(root,operatorsPack);
                foreach (IMutationOperator mutationOperator in operatorsPack.Operators)
                {
                    var operatorNode = new OperatorNode(package,mutationOperator);
                    package.Children.Add(operatorNode);
                }
                root.Children.Add(package);
                list.Add(package);
            }
            root.IsIncluded = true;
            if(!root.Children.Any())
            {
                throw new InvalidOperationException("No mutation operators were found.");
            }
            return root;
        }
Beispiel #4
0
 public PackageNode(OperatorPackagesRoot root, IOperatorsPackage operatorsPackage)
     : base(operatorsPackage.Name)
 {
     _operatorsPackage = operatorsPackage;
     Parent            = root;
 }