Example #1
0
        public async Task InvokeSuccessLambdaAsync_WithCorrectlyConfiguredLocalAwsAccount_ShouldReturnCorrectResponseModel()
        {
            // Given
            var runner = new AwsLambdaRunner();

            // When
            var response = await runner.InvokeSuccessLambdaAsync();

            var responseModel = await response.Payload.Deserialize <SuccessLambdaResponseModel>();

            // Then
            responseModel.Should().NotBeNull();
            responseModel.Response.Should().NotBeNullOrWhiteSpace();
        }
Example #2
0
        public async Task InvokeSuccessLambdaAsync_WithCorrectlyConfiguredLocalAwsAccount_ShouldReturnCorrectStatusCodeAndExecutedVersion()
        {
            // Given
            const int    expectedStatusCode      = 200;
            const string expectedExecutedVersion = "$LATEST";
            var          runner = new AwsLambdaRunner();

            // When
            var response = await runner.InvokeSuccessLambdaAsync();

            // Then
            using (new AssertionScope())
            {
                response.Should().NotBeNull();
                response.StatusCode.Should().Be(expectedStatusCode);
                response.ExecutedVersion.Should().Be(expectedExecutedVersion);
                response.FunctionError.Should().BeNullOrWhiteSpace();
            }
        }