예제 #1
0
        public async Task AddItemTest()
        {
            var jsonString = @"
            {
              'itemName':'Bread',
              'itemQuantity': 32
            }
            ";

            var itemName = "Bread";

            var request = new APIGatewayProxyRequest
            {
                Body = jsonString,
            };
            var context = new TestLambdaContext();

            var expectedResponse = new APIGatewayProxyResponse
            {
                StatusCode = 200,
                Body       = $"Successfully added item: {itemName}"
            };

            var function = new Function();
            var response = await function.AddItemToCart(request, context);

            Assert.Equal(expectedResponse.StatusCode, response.StatusCode);
            //Assert.Equal(expectedResponse.Body, response.Body);
        }