Skip to content

Commit 0e08856

Browse files
committed
refactor: remove null checks for existing record and data in ProcessExistingRecord tests
1 parent 315f2ba commit 0e08856

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

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

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -594,44 +594,4 @@ public async Task ProcessExistingRecord_WhenValidRecord_ShouldReturnRecordAndSav
594594
cache.TryGet("testFunction#5eff007a9ed2789a9f9f6bc182fc6ae6", out var cachedRecord).Should().BeTrue();
595595
cachedRecord.Should().Be(existingRecord);
596596
}
597-
598-
[Fact]
599-
public void ProcessExistingRecord_WhenNullRecord_ShouldThrowArgumentNullException()
600-
{
601-
// Arrange
602-
var persistenceStore = new InMemoryPersistenceStore();
603-
var request = LoadApiGatewayProxyRequest();
604-
persistenceStore.Configure(new IdempotencyOptionsBuilder().Build(), null, null);
605-
606-
// Act
607-
var act = () => persistenceStore.ProcessExistingRecord(null, JsonSerializer.SerializeToDocument(request)!);
608-
609-
// Assert
610-
act.Should().Throw<ArgumentNullException>()
611-
.WithParameterName("exRecord")
612-
.WithMessage("Existing record cannot be null*");
613-
}
614-
615-
[Fact]
616-
public void ProcessExistingRecord_WhenNullData_ShouldThrowArgumentNullException()
617-
{
618-
// Arrange
619-
var persistenceStore = new InMemoryPersistenceStore();
620-
persistenceStore.Configure(new IdempotencyOptionsBuilder().Build(), null, null);
621-
622-
var existingRecord = new DataRecord(
623-
"test-key",
624-
DataRecord.DataRecordStatus.COMPLETED,
625-
DateTimeOffset.UtcNow.AddSeconds(3600).ToUnixTimeSeconds(),
626-
"response",
627-
null);
628-
629-
// Act
630-
var act = () => persistenceStore.ProcessExistingRecord(existingRecord, null);
631-
632-
// Assert
633-
act.Should().Throw<ArgumentNullException>()
634-
.WithParameterName("data")
635-
.WithMessage("Data cannot be null*");
636-
}
637597
}

0 commit comments

Comments
 (0)