Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/CTS/AssessmentControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private static bool IsForbidResult<T>(ActionResult<T> a)
Assert.True(result != null || forbidResult != null);

}
catch (Exception)
catch (Xunit.Sdk.XunitException)
{
return false;
}
Expand All @@ -279,7 +279,7 @@ private static bool IsNotFoundResult<T>(ActionResult<T> a)
var result = a.Result as NotFoundResult;
Assert.Equal((int)HttpStatusCode.NotFound, result?.StatusCode);
}
catch (Exception)
catch (Xunit.Sdk.XunitException)
{
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions test/ClinicalScheduler/EmailNotificationTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using NSubstitute;
using NSubstitute.ExceptionExtensions;
Expand Down Expand Up @@ -281,7 +282,7 @@ await _context.Persons.AddAsync(new Models.ClinicalScheduler.Person
{
result = await _service.RemoveInstructorScheduleAsync(savedSchedule.InstructorScheduleId);
}
catch (Exception ex)
catch (Exception ex) when (ex is InvalidOperationException or DbUpdateException or SqlException or OperationCanceledException)
{
caughtException = ex;
System.Console.WriteLine($"Exception caught: {ex.GetType().Name}: {ex.Message}");
Expand Down Expand Up @@ -463,7 +464,7 @@ await _context.Persons.AddAsync(new Models.ClinicalScheduler.Person
{
result = await _service.RemoveInstructorScheduleAsync(savedPrimarySchedule.InstructorScheduleId);
}
catch (Exception ex)
catch (Exception ex) when (ex is InvalidOperationException or DbUpdateException or SqlException or OperationCanceledException)
{
caughtException = ex;
System.Console.WriteLine($"Exception caught: {ex.GetType().Name}: {ex.Message}");
Expand Down
2 changes: 1 addition & 1 deletion test/ClinicalScheduler/RotationServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void SeedTestData()
}
_context.SaveChanges();
}
catch (Exception ex)
catch (Exception ex) when (ex is DbUpdateException or InvalidOperationException)
{
// Log the exception and provide a clear error message for debugging
Console.WriteLine($"Error seeding test data: {ex.Message}");
Expand Down
Loading