using Microsoft.AspNetCore.Mvc; using NUnit.Framework; namespace LeedsBeerQuest.API.Tests.TestHelpers; public static class ControllerTestHelper { public static T ActionResultToOkResultValue(IActionResult actionResult) where T : class { var okResult = actionResult as OkObjectResult; Assert.NotNull(okResult); var resultValue = okResult!.Value as T; Assert.NotNull(resultValue); return resultValue!; } }