Skip to content

Commit 33de0e1

Browse files
committed
Addressing analysed warnings.
1 parent ae021c6 commit 33de0e1

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

libraries/src/AWS.Lambda.Powertools.Idempotency/Internal/LRUCache.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace AWS.Lambda.Powertools.Idempotency.Internal;
1111
/// </summary>
1212
/// <typeparam name="TKey">The type of the key to the cached item.</typeparam>
1313
/// <typeparam name="TValue">The type of the cached item.</typeparam>
14+
// ReSharper disable once InconsistentNaming
1415
internal sealed class LRUCache<TKey, TValue>
1516
{
1617
/// <summary>

libraries/tests/AWS.Lambda.Powertools.Idempotency.Tests/Handlers/IdempotencyFunction.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using System.Threading.Tasks;
2222
using Amazon.DynamoDBv2;
2323
using Amazon.Lambda.APIGatewayEvents;
24-
using Amazon.Lambda.Core;
2524

2625
namespace AWS.Lambda.Powertools.Idempotency.Tests.Handlers;
2726

@@ -45,15 +44,15 @@ public IdempotencyFunction(AmazonDynamoDBClient client)
4544
}
4645

4746
[Idempotent]
48-
public async Task<APIGatewayProxyResponse> Handle(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
47+
public async Task<APIGatewayProxyResponse> Handle(APIGatewayProxyRequest apigProxyEvent)
4948
{
5049
HandlerExecuted = true;
5150

52-
var result= await InternalFunctionHandler(apigProxyEvent,context);
51+
var result= await InternalFunctionHandler(apigProxyEvent);
5352

5453
return result;
5554
}
56-
private async Task<APIGatewayProxyResponse> InternalFunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
55+
private async Task<APIGatewayProxyResponse> InternalFunctionHandler(APIGatewayProxyRequest apigProxyEvent)
5756
{
5857
Dictionary<string, string> headers = new()
5958
{

libraries/tests/AWS.Lambda.Powertools.Idempotency.Tests/IdempotencyTest.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using Amazon.DynamoDBv2;
2020
using Amazon.DynamoDBv2.Model;
2121
using Amazon.Lambda.APIGatewayEvents;
22-
using Amazon.Lambda.TestUtilities;
2322
using AWS.Lambda.Powertools.Idempotency.Tests.Handlers;
2423
using AWS.Lambda.Powertools.Idempotency.Tests.Persistence;
2524
using FluentAssertions;
@@ -49,16 +48,14 @@ public async Task EndToEndTest()
4948
PropertyNameCaseInsensitive = true
5049
};
5150

52-
//var persistenceStore = new InMemoryPersistenceStore();
53-
var context = new TestLambdaContext();
5451
var request = JsonSerializer.Deserialize<APIGatewayProxyRequest>(await File.ReadAllTextAsync("./resources/apigw_event2.json"),options);
5552

56-
var response = await function.Handle(request, context);
53+
var response = await function.Handle(request);
5754
function.HandlerExecuted.Should().BeTrue();
5855

5956
function.HandlerExecuted = false;
6057

61-
var response2 = await function.Handle(request, context);
58+
var response2 = await function.Handle(request);
6259
function.HandlerExecuted.Should().BeFalse();
6360

6461
JsonSerializer.Serialize(response).Should().Be(JsonSerializer.Serialize(response));

libraries/tests/AWS.Lambda.Powertools.Idempotency.Tests/Internal/LRUCacheTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
//Source: https://github.dev/microsoft/botbuilder-dotnet/blob/main/tests/AdaptiveExpressions.Tests/LRUCacheTest.cs
2222
namespace AWS.Lambda.Powertools.Idempotency.Tests.Internal;
2323

24+
// ReSharper disable once InconsistentNaming
2425
public class LRUCacheTests
2526
{
2627
[Fact]
@@ -58,7 +59,7 @@ public void TestDiacardPolicy()
5859
/*
5960
* The average time of this test is about 2ms.
6061
*/
61-
public void TestDPMemorySmall()
62+
public void TestDpMemorySmall()
6263
{
6364
var cache = new LRUCache<int, int>(2);
6465
cache.Set(0, 1);
@@ -87,7 +88,7 @@ public void TestDPMemorySmall()
8788
* The average time of this test is about 3ms.
8889
*/
8990
[Fact]
90-
public void TestDPMemoryLarge()
91+
public void TestDpMemoryLarge()
9192
{
9293
var cache = new LRUCache<int, int>(500);
9394
cache.Set(0, 1);
@@ -123,7 +124,6 @@ public async Task TestMultiThreadingAsync()
123124
const int numOfOps = 1000;
124125
for (var i = 0; i < numOfThreads; i++)
125126
{
126-
var idx = i;
127127
tasks.Add(Task.Run(() => StoreElement(cache, numOfOps)));
128128
}
129129

libraries/tests/AWS.Lambda.Powertools.Idempotency.Tests/Persistence/DynamoDBFixture.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using Amazon.DynamoDBv2;
1919
using Amazon.DynamoDBv2.Model;
2020
using Amazon.Runtime;
21-
using AWS.Lambda.Powertools.Idempotency.Persistence;
2221
using DotNet.Testcontainers.Builders;
2322
using DotNet.Testcontainers.Containers;
2423

0 commit comments

Comments
 (0)