diff --git a/test/RAPS/RolesTests.cs b/test/RAPS/RolesTests.cs
index c3d57d607..ea6d64afb 100644
--- a/test/RAPS/RolesTests.cs
+++ b/test/RAPS/RolesTests.cs
@@ -19,8 +19,8 @@ public class RolesTests
///
/// Use the _sqlLiteConnection (see RejectAddRole_WhenDuplicateRoleId() to validate unique contraints or to do create, edit, delete actions
///
- static SqliteConnection _sqlLiteConnection = new SqliteConnection("Filename=:memory:");
- static DbContextOptions _sqlLiteContextOptions = new DbContextOptionsBuilder()
+ static readonly SqliteConnection _sqlLiteConnection = new SqliteConnection("Filename=:memory:");
+ static readonly DbContextOptions _sqlLiteContextOptions = new DbContextOptionsBuilder()
.UseSqlite(_sqlLiteConnection)
.Options;
diff --git a/test/Students/EmergencyContactControllerTests.cs b/test/Students/EmergencyContactControllerTests.cs
index ed48b4943..2efc6b194 100644
--- a/test/Students/EmergencyContactControllerTests.cs
+++ b/test/Students/EmergencyContactControllerTests.cs
@@ -318,8 +318,8 @@ public async Task UpdateStudentContact_ArgumentException_ReturnsValidationProble
// but in unit tests without an HttpContext it stays null — assert the body shape.
var objectResult = Assert.IsType(result.Result);
var problem = Assert.IsType(objectResult.Value);
- Assert.True(problem.Errors.ContainsKey("PhoneValidation"));
- Assert.Contains("Invalid phone number: 12345", problem.Errors["PhoneValidation"]);
+ Assert.True(problem.Errors.TryGetValue("PhoneValidation", out var phoneErrors));
+ Assert.Contains("Invalid phone number: 12345", phoneErrors);
}
[Fact]
diff --git a/web/Areas/ClinicalScheduler/Controllers/RotationsController.cs b/web/Areas/ClinicalScheduler/Controllers/RotationsController.cs
index e0bf5c64b..fcf16888b 100644
--- a/web/Areas/ClinicalScheduler/Controllers/RotationsController.cs
+++ b/web/Areas/ClinicalScheduler/Controllers/RotationsController.cs
@@ -562,8 +562,8 @@ private List