Exemplo n.º 1
0
        public void Should_locate_all_profiles()
        {
            // Arrange
            var scanner = new ProfileScanner();

            scanner.AssembliesFromApplicationBaseDirectory(assembly => assembly.FullName.StartsWith("FluentSecurity."));

            // Act
            scanner.LookForProfiles();

            // Assert
            var profiles = scanner.Scan();

            Assert.That(profiles.Count(), Is.EqualTo(3));
        }
Exemplo n.º 2
0
        public void Should_not_locate_profiles_in_namespace()
        {
            // Arrange
            var scanner = new ProfileScanner();

            scanner.AssembliesFromApplicationBaseDirectory(assembly => assembly.FullName.StartsWith("FluentSecurity."));
            scanner.IncludeNamespaceContainingType <Level1Marker>();
            scanner.ExcludeNamespaceContainingType <Level2Marker>();

            // Act
            scanner.LookForProfiles();

            // Assert
            var profiles = scanner.Scan();

            Assert.That(profiles.Count(), Is.EqualTo(1));
            Assert.That(profiles.First(), Is.EqualTo(typeof(TestProfile1)));
        }