コード例 #1
0
        public void FindAssemblies_Exclude()
        {
            var specification1 = new FilePatternSpecification("*.1", FilePatternSpecificationKind.IncludeFollowReferences);
            var specification2 = new FilePatternSpecification("*.2", FilePatternSpecificationKind.Exclude);

            StubSearchService("*.1", "1.dll", "2.dll"); // included
            StubSearchService("*.2", "2.dll", "3.dll"); // excluded

            var finder = CreateRootAssemblyFinder(specification1, specification2);

            finder.FindRootAssemblies().ForceEnumeration();

            _loaderMock.AssertWasCalled(mock => mock.TryLoadAssembly("1.dll"));
            _loaderMock.AssertWasNotCalled(mock => mock.TryLoadAssembly("2.dll"));
            _loaderMock.AssertWasNotCalled(mock => mock.TryLoadAssembly("3.dll"));
        }