public void When_library_added_all_trees_added()
        {
            var library = new GenericBTLibrary();

            library.AddBT(_firstTree, _tree);
            library.AddBT(_secondTree, _tree2);

            _library.AddBTLibrary(library);

            Assert.AreEqual(_tree.Name, _library.GetBT(_firstTree).Name);
            Assert.AreEqual(_tree2.Name, _library.GetBT(_secondTree).Name);
        }
Beispiel #2
0
        /**
         * Creates a BT library that contains all the BTs contained in the libraries
         * of <code>libraries</code>. If several trees are referenced by the same
         * name, only the last one (according to its order in the input libraries)
         * will remain.
         *
         * @param libraries
         *            the list with all the libraries whose BTs will contain the
         *            returned BT library.
         * @return a BT library that contains all the BTs contained in the libraries
         *         of <code>libraries</code>.
         */

        public static IBTLibrary createBTLibrary(List <IBTLibrary> libraries)
        {
            var result = new GenericBTLibrary();

            foreach (var btLibrary in libraries)
            {
                result.AddBTLibrary(btLibrary);
            }

            return(result);
        }