From 7fe00a139064fa5c2eb1ea11e311107a08a5e974 Mon Sep 17 00:00:00 2001 From: Bert Date: Wed, 18 Dec 2024 15:00:21 +0100 Subject: [PATCH] fix version number --- Directory.Packages.props | 4 ++-- .../UnitTests/DataAccessLayerTest.cs | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index df73389..061c2e3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,7 +3,7 @@ true - + @@ -46,4 +46,4 @@ - \ No newline at end of file + diff --git a/src/RazorPages/RazorPagesTestSample.Tests/UnitTests/DataAccessLayerTest.cs b/src/RazorPages/RazorPagesTestSample.Tests/UnitTests/DataAccessLayerTest.cs index 72806a7..ac4db93 100644 --- a/src/RazorPages/RazorPagesTestSample.Tests/UnitTests/DataAccessLayerTest.cs +++ b/src/RazorPages/RazorPagesTestSample.Tests/UnitTests/DataAccessLayerTest.cs @@ -23,7 +23,7 @@ public async Task GetMessagesAsync_MessagesAreReturned() List result = await db.GetMessagesAsync(); // Assert - List actualMessages = Assert.IsAssignableFrom>(result); + List actualMessages = Assert.IsType>(result, exactMatch: false); Assert.Equal( expectedMessages.OrderBy(m => m.Id).Select(m => m.Text), actualMessages.OrderBy(m => m.Id).Select(m => m.Text)); @@ -41,7 +41,7 @@ public async Task AddMessageAsync_MessageIsAdded() await db.AddMessageAsync(expectedMessage); // Assert - Message actualMessage = await db.FindAsync(recId, TestContext.Current.CancellationToken); + Message actualMessage = await db.FindAsync(new object[] { recId, TestContext.Current.CancellationToken }, TestContext.Current.CancellationToken); Assert.Equal(expectedMessage, actualMessage); } @@ -101,7 +101,6 @@ public async Task DeleteMessageAsync_NoMessageIsDeleted_WhenMessageIsNotFound() int recId = 4; // Act -#pragma warning disable CA1031 // Do not catch general exception types try { await db.DeleteMessageAsync(recId); @@ -110,7 +109,6 @@ public async Task DeleteMessageAsync_NoMessageIsDeleted_WhenMessageIsNotFound() { // recId doesn't exist } -#pragma warning restore CA1031 // Do not catch general exception types // Assert List actualMessages = await db.Messages.AsNoTracking().ToListAsync(cancellationToken: TestContext.Current.CancellationToken);