mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-01 22:21:57 +00:00
11 lines
386 B
C#
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}");
|
|
}
|
|
}
|
|
} |