You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/tests/Recyclarr.Tests/Common/ResourceDataReaderTest.cs

35 lines
957 B

using Recyclarr.Common;
namespace Recyclarr.Tests.Common;
[TestFixture]
public class ResourceDataReaderTest
{
[Test]
public void GetResourceData_DefaultDir_ReturnResourceData()
{
var testData = new ResourceDataReader(GetType());
var data = testData.ReadData("DefaultDataFile.txt");
data.Trim().Should().Be("DefaultDataFile");
}
[Test]
public void GetResourceData_NonexistentFile_Throw()
{
var testData = new ResourceDataReader(GetType());
Action act = () => testData.ReadData("DataFileWontBeFound.txt");
act.Should()
.Throw<ArgumentException>()
.WithMessage("Embedded resource not found*");
}
[Test]
public void ReadData_ExplicitSubDir_ReturnResourceData()
{
var testData = new ResourceDataReader(GetType(), "TestData");
var data = testData.ReadData("DataFile.txt");
data.Trim().Should().Be("DataFile");
}
}