Пример #1
0
 public void Deconstruct(
     out IAmazonRDS rdsClient,
     out IAmazonSimpleNotificationService snsClient,
     out IAmazonEventBridge eventsClient,
     out IAmazonSQS sqsClient,
     out IAmazonLambda lambdaClient,
     out StartDatabaseHandler handler
     )
 {
     rdsClient    = RdsClient;
     snsClient    = SnsClient;
     eventsClient = EventBridgeClient;
     sqsClient    = SqsClient;
     lambdaClient = LambdaClient;
     handler      = StartDatabaseHandler;
 }
Пример #2
0
#pragma warning restore CS8618, CS0649

            public Task Setup()
            {
                var logger        = Substitute.For <ILogger <StartDatabaseHandler> >();
                var configuration = new OptionsWrapper <LambdaConfiguration>(new LambdaConfiguration
                {
                    WaitForDatabaseAvailabilityRuleName = waitForDatabaseAvailabilityRuleName,
                    NotificationQueueUrl   = queueUrl,
                    DequeueEventSourceUUID = dequeueEventSourceUuid
                });

                LambdaClient.GetEventSourceMappingAsync(null).ReturnsForAnyArgs(new GetEventSourceMappingResponse
                {
                    State = "Disabled"
                });

                StartDatabaseHandler = new StartDatabaseHandler(RdsClient, SnsClient, EventBridgeClient, SqsClient, LambdaClient, logger, configuration);
                return(Task.CompletedTask);
            }