Files
2026-06-09 00:35:42 +02:00

11 lines
386 B
C#

using Xunit.Microsoft.DependencyInjection.Abstracts;
namespace Spacebar.Tests.Extensions;
public static class TestBedFixtureExtensions {
extension(TestBedFixture tbf) {
public T GetRequiredService<T>(ITestOutputHelper toh) {
return tbf.GetService<T>(toh) ?? throw new InvalidOperationException($"Failed to get service: {typeof(T).FullName}");
}
}
}