コード例 #1
0
        private void EntityTypeGarbageCollectionBehaviorThrowsArgumentExceptionWhenBehaviorInvalid(
            GarbageCollectionBehavior invalidBehavior)
        {
            var context = new Mock <IDeploymentContext>();

            ArgumentTester.ThrowsArgumentException(
                () => context.Object.EntityTypeGarbageCollectionBehavior(
                    Guid.NewGuid(), invalidBehavior),
                "behavior");
        }
コード例 #2
0
 /// <summary>
 /// Sets the garbage collection behavior for the specified entity type.
 /// </summary>
 /// <param name="context">The deployment context.</param>
 /// <param name="entityTypeId">The ID of the entity type.</param>
 /// <param name="behavior">The garbage collection behavior.</param>
 public static void EntityTypeGarbageCollectionBehavior(
     this IDeploymentContext context,
     Guid entityTypeId,
     GarbageCollectionBehavior behavior)
 {
     ArgumentValidator.EnsureArgumentNotNull(context, nameof(context));
     ArgumentValidator.EnsureArgumentNotEmpty(entityTypeId, nameof(entityTypeId));
     ValidateGarbageCollectionBehavior(behavior);
     context.EntityTypeParameter(
         entityTypeId,
         GarbageCollectionBehaviorParameterName,
         behavior.ToString());
 }
コード例 #3
0
 /// <summary>
 /// Sets the garbage collection behavior for the specified destination system.
 /// </summary>
 /// <param name="context">The deployment context.</param>
 /// <param name="destinationSystemId">
 /// The ID of the destination (external) system.
 /// </param>
 /// <param name="behavior">The garbage collection behavior.</param>
 public static void DestinationSystemGarbageCollectionBehavior(
     this IDeploymentContext context,
     Guid destinationSystemId,
     GarbageCollectionBehavior behavior)
 {
     ArgumentValidator.EnsureArgumentNotNull(context, nameof(context));
     ArgumentValidator.EnsureArgumentNotEmpty(
         destinationSystemId, nameof(destinationSystemId));
     ValidateGarbageCollectionBehavior(behavior);
     context.DestinationSystemParameter(
         destinationSystemId,
         GarbageCollectionBehaviorParameterName,
         behavior.ToString());
 }
コード例 #4
0
        private void EntityTypeGarbageCollectionBehaviorCreatesEntityTypeParameter(
            GarbageCollectionBehavior behavior)
        {
            // arrange
            var  context      = new Mock <IDeploymentContext>(MockBehavior.Strict);
            Guid entityTypeId = Guid.NewGuid();

            context
            .Setup(dc => dc.EntityTypeParameter(
                       entityTypeId,
                       DeploymentContextExtensions.GarbageCollectionBehaviorParameterName,
                       behavior.ToString()))
            .Verifiable();

            // act
            context.Object.EntityTypeGarbageCollectionBehavior(entityTypeId, behavior);

            // assert
            context.Verify();
        }
コード例 #5
0
        private void DestinationSystemGarbageCollectionBehaviorCreatesDestinationSystemParameter(
            GarbageCollectionBehavior behavior)
        {
            // arrange
            var  context             = new Mock <IDeploymentContext>(MockBehavior.Strict);
            Guid destinationSystemId = Guid.NewGuid();

            context
            .Setup(dc => dc.DestinationSystemParameter(
                       destinationSystemId,
                       DeploymentContextExtensions.GarbageCollectionBehaviorParameterName,
                       behavior.ToString()))
            .Verifiable();

            // act
            context.Object.DestinationSystemGarbageCollectionBehavior(
                destinationSystemId, behavior);

            // assert
            context.Verify();
        }
コード例 #6
0
 ValidateGarbageCollectionBehavior(GarbageCollectionBehavior behavior)
 {
     ValidateBehavior(behavior, Resources.InvalidGarbageCollectionBehavior);
 }