Exemplo n.º 1
0
        public void Should_scan_assemblies_from_application_base_directory_for_assemblies_matching_include_and_exclude_predicates()
        {
            // Arrange
            var scanner = new AssemblyScanner();
            const int expectedAssembliesCount = 1;

            // Act
            scanner.IncludeAssembly(assembly => Path.GetFileNameWithoutExtension(assembly).StartsWith("FluentSecurity."));
            scanner.ExcludeAssembly(assembly => Path.GetFileNameWithoutExtension(assembly).EndsWith(".Specification"));
            scanner.AssembliesFromApplicationBaseDirectory();

            // Assert
            Assert.That(scanner.Context.AssembliesToScan.Count(), Is.EqualTo(expectedAssembliesCount));
            Assert.That(scanner.Context.AssembliesToScan.Single().GetName().Name, Is.EqualTo("FluentSecurity.TestHelper"));
        }
Exemplo n.º 2
0
        public void Should_scan_assemblies_from_application_base_directory_for_assemblies_matching_include_and_exclude_predicates()
        {
            // Arrange
            var       scanner = new AssemblyScanner();
            const int expectedAssembliesCount = 1;

            // Act
            scanner.IncludeAssembly(assembly => Path.GetFileNameWithoutExtension(assembly).StartsWith("FluentSecurity."));
            scanner.ExcludeAssembly(assembly => Path.GetFileNameWithoutExtension(assembly).EndsWith(".Specification"));
            scanner.AssembliesFromApplicationBaseDirectory();

            // Assert
            Assert.That(scanner.Context.AssembliesToScan.Count(), Is.EqualTo(expectedAssembliesCount));
            Assert.That(scanner.Context.AssembliesToScan.Single().GetName().Name, Is.EqualTo("FluentSecurity.TestHelper"));
        }