public void FindRootAssemblies_NoInnerFinders()
        {
            var finder = new CompositeRootAssemblyFinder(new IRootAssemblyFinder[0]);

            var rootAssemblies = finder.FindRootAssemblies();

            Assert.That(rootAssemblies, Is.Empty);
        }
        public void FindRootAssemblies_InnerFinder()
        {
            IRootAssemblyFinder innerFinderStub = CreateInnerFinderStub(_root1, _root2);
            var finder = new CompositeRootAssemblyFinder(new[] { innerFinderStub });

            var rootAssemblies = finder.FindRootAssemblies();

            Assert.That(rootAssemblies, Is.EquivalentTo(new[] { _root1, _root2 }));
        }
        public void FindRootAssemblies_MultipleInnerFinders()
        {
            IRootAssemblyFinder innerFinderStub1 = CreateInnerFinderStub(_root1, _root2);
            IRootAssemblyFinder innerFinderStub2 = CreateInnerFinderStub(_root3);

            var finder = new CompositeRootAssemblyFinder(new[] { innerFinderStub1, innerFinderStub2 });

            var rootAssemblies = finder.FindRootAssemblies();

            Assert.That(rootAssemblies, Is.EquivalentTo(new[] { _root1, _root2, _root3 }));
        }
        public void FindRootAssemblies_RemovesAreNotDuplicates()
        {
            IRootAssemblyFinder innerFinderStub1 = CreateInnerFinderStub(_root1, _root2, _root2);
            IRootAssemblyFinder innerFinderStub2 = CreateInnerFinderStub(_root3, _root2, _root1);

            var finder = new CompositeRootAssemblyFinder(new[] { innerFinderStub1, innerFinderStub2 });

            var rootAssemblies = finder.FindRootAssemblies().ToArray();

            Assert.That(rootAssemblies.Length, Is.EqualTo(6));
            Assert.That(rootAssemblies.Distinct(), Is.EquivalentTo(new[] { _root1, _root2, _root3 }));
        }