public void CanCreateSecuredMappingsCache()
        {
            // Act
            var    exampleMappingConfiguration = new ISecuredRelationshipBuilder[] { _exampleSecuredRelationshipBuilder };
            Action action = () => new MappingsCache(exampleMappingConfiguration);

            // Assert
            action.ShouldNotThrow();
        }
        public void CanCreateSecuredMappingsCache()
        {
            // Act
            var exampleMappingConfiguration = new ISecuredRelationshipBuilder[] { _exampleSecuredRelationshipBuilder };
            Action action = () => new MappingsCache(exampleMappingConfiguration);

            // Assert
            action.ShouldNotThrow();
        }
        public void DuplicateSecurableRelationshipsAreNotReturned()
        {
            // Arrange
            var exampleMappingConfigurations = new ISecuredRelationshipBuilder[] { _exampleSecuredRelationshipBuilder, _exampleSecuredRelationshipBuilder2 };
            var securedMappingsCache         = new MappingsCache(exampleMappingConfigurations);

            // Act
            var securedMappings = securedMappingsCache.GetRelationships <ExampleLeaf>().ToList();

            // Assert
            securedMappings.Should().NotBeNull();
            securedMappings.Should().HaveCount(2);
        }
        public void CanResolveSecuredMappingsForExampleSecuredMappings()
        {
            // Arrange
            var exampleMappingConfigurations = new ISecuredRelationshipBuilder[] { _exampleSecuredRelationshipBuilder };
            var securedMappingsCache         = new MappingsCache(exampleMappingConfigurations);

            // Act
            var securedMappings = securedMappingsCache.GetRelationships <ExampleLeaf>().ToList();

            // Assert
            securedMappings.Should().NotBeNull();
            securedMappings.Should().HaveCount(2);
        }
        public void DuplicateSecurableRelationshipsAreNotReturned()
        {
            // Arrange
            var exampleMappingConfigurations = new ISecuredRelationshipBuilder[] { _exampleSecuredRelationshipBuilder, _exampleSecuredRelationshipBuilder2 };
            var securedMappingsCache = new MappingsCache(exampleMappingConfigurations);

            // Act
            var securedMappings = securedMappingsCache.GetRelationships<ExampleLeaf>().ToList();

            // Assert
            securedMappings.Should().NotBeNull();
            securedMappings.Should().HaveCount(2);
        }
        public void CanResolveSecuredMappingsForExampleSecuredMappings()
        {
            // Arrange
            var exampleMappingConfigurations = new ISecuredRelationshipBuilder[] { _exampleSecuredRelationshipBuilder };
            var securedMappingsCache = new MappingsCache(exampleMappingConfigurations);

            // Act
            var securedMappings = securedMappingsCache.GetRelationships<ExampleLeaf>().ToList();

            // Assert
            securedMappings.Should().NotBeNull();
            securedMappings.Should().HaveCount(2);
        }
Beispiel #7
0
 /// <summary>
 /// Creates a new instance of <see cref="SecuredRelationshipFragment{T}"/> of <typeparamref name="T"/>.
 /// </summary>
 /// <typeparam name="T">The Type to create a RelationshipFragment for.</typeparam>
 /// <param name="config">Variable not used.  Limits the scope of the extension method to instances of IMappingConfiguration.</param>
 /// <returns>A new instance of <see cref="SecuredRelationshipFragment{T}"/> of <typeparamref name="T"/>.</returns>
 public static SecuredRelationshipFragment <T> Secure <T>(this ISecuredRelationshipBuilder config) where T : class
 {
     return(new SecuredRelationshipFragment <T>());
 }