Skip to content
Closed
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,3 +1,4 @@
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -281,7 +282,7 @@ await _context.Persons.AddAsync(new 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;
Console.WriteLine($"Exception caught: {ex.GetType().Name}: {ex.Message}");
Expand Down Expand Up @@ -463,7 +464,7 @@ await _context.Persons.AddAsync(new 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;
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 @@ -96,7 +96,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
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetClinicianSchedule(string mothraId, [FromQuery] int? year = null)

Check warning on line 125 in web/Areas/ClinicalScheduler/Controllers/CliniciansController.cs

View workflow job for this annotation

GitHub Actions / Backend Tests

'GetClinicianSchedule' has a cyclomatic complexity of '29'. Rewrite or refactor the code to decrease its complexity below '26'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1502)
{
var correlationId = HttpContext.TraceIdentifier ?? Guid.NewGuid().ToString();

Expand Down Expand Up @@ -201,7 +201,7 @@
fullName = $"Clinician {mothraId}",
firstName = "",
lastName = "",
role = (string?)null
role = default(string)
};
}
else
Expand Down
2 changes: 1 addition & 1 deletion web/Areas/Effort/Services/VerificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ await _auditService.LogRecordChangeAsync(

// Set verification timestamp
var verifiedDate = DateTime.Now;
var oldValues = new { EffortVerified = (DateTime?)null };
var oldValues = new { EffortVerified = default(DateTime?) };

instructor.EffortVerified = verifiedDate;

Expand Down
7 changes: 5 additions & 2 deletions web/EmailTemplates/Views/Shared/_EmailLayout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@
@* Use width attribute for Outlook, max-width for modern clients. Class for responsive override. *@
<table class="email-container" cellpadding="0" cellspacing="0" border="0" width="650" bgcolor="#ffffff" style="background-color: #ffffff; border: 1px solid #dee2e6; max-width: 650px; width: 100%;">
@* UC Davis Weill Header Image *@
@{
var baseUrl = ViewBag.BaseUrl as string;
}
<tr>
<td class="email-header" style="padding: 0; line-height: 0; font-size: 0;">
@if (!string.IsNullOrWhiteSpace((string?)ViewBag.BaseUrl))
@if (!string.IsNullOrWhiteSpace(baseUrl))
{
<img src="@(((string)ViewBag.BaseUrl).TrimEnd('/'))/images/email/email-header-weill.jpg"
<img src="@(baseUrl.TrimEnd('/'))/images/email/email-header-weill.jpg"
alt="UC Davis Weill School of Veterinary Medicine"
width="650"
style="display: block; width: 100%; max-width: 650px; height: auto; border: 0;" />
Expand Down
Loading