Files
bgr/src/BGR.Console.Tests/Unit/ResourceManagerTests.cs
T

26 lines
604 B
C#
Raw Normal View History

2025-02-09 23:22:21 -06:00
namespace BGR.Console.Tests.Unit;
public class ResourceManagerTests
{
private readonly ResourceManager _resourceManager = new();
[Fact]
public void GetResource_WhenResourceExists_ItShouldReturnStream()
{
var resourceName = "u2net.onnx";
using var stream = _resourceManager.GetResource(resourceName);
stream.ShouldNotBeNull();
}
[Fact]
public void GetResource_WhenResourceDoesNotExist_ItShouldThrowException()
{
var resourceName = "nonexistent.onnx";
var act = () => _resourceManager.GetResource(resourceName);
act.ShouldThrow<FileNotFoundException>();
}
}