Example #1
0
        public void Test_Locator_finds_single_dependency()
        {
            _locator = new DependencyLocator(Path.Combine(TestDataExtracted, "x64"));

            var result = _locator.LocateDependencies(new [] { "DependencyA.dll" });

            Assert.That(result, Has.Exactly(1).Items);
        }
Example #2
0
        public void Test_Locator_accept_filter_include_rules()
        {
            var path = _createDummyStructure();

            _locator = new DependencyLocator(path);
            _locator.Includes.Add(@"\\B\\");

            Assert.That(() => _locator.LocateDependencies(new[] { "foo.dll" }), Throws.Nothing);
        }
Example #3
0
        public void Test_Locator_accept_filter_exclude_and_include_regex_rules()
        {
            // Create a valid exclude and a valid include
            var path = _createDummyStructure();

            _locator = new DependencyLocator(path);
            _locator.Excludes.Add(@".*B\\");
            _locator.Includes.Add(@".*");

            Assert.That(() => _locator.LocateDependencies(new[] { "foo.dll" }), Throws.Nothing);
        }
Example #4
0
 public void Test_Locator_throws_on_multiple_dependencies()
 {
     Assert.That(() => _locator.LocateDependencies(new [] { "DependencyA.dll" }), Throws.TypeOf <DependencyLocatorException>());
 }
Example #5
0
        public void Test_Locator_throws_if_no_dependencies_found()
        {
            _locator = new DependencyLocator(Path.Combine(TestDataExtracted, "x64"));

            Assert.That(() => _locator.LocateDependencies(new[] { "Does_not_Exist.dll" }), Throws.TypeOf <DependencyLocatorException>());
        }