Hey,
I need to test a component that iterates over the Assets property.
I am currently struggling to figure out how to seed these Assets in bunit.
I already saw that this has been suggested for net9.0, and I am working in net10.0.
However that issue has been closed, because the usecase under test was (probably) appending the hash to the path.
#1612
But my usecase to test is an iteration over these assets.
So my question is:
How exactly would I correctly set these assets up in bUnit?
Scenario
public partial class AssetComponent : ComponentBase
{
private IReadOnlyList<string> SubresourceNames { get; set; }
protected override void OnInitialized()
{
SubresourceNames = Assets
.Select(asset => asset.Properties?.Single(property => property.Name == "label")?.Value) // The "label" property contains the relative file path.
.Where( .. )
.ToList();
}
}
@foreach (var assetName in SubresourceNames)
{
<DoStuff attribute="@assetName" />
}
Hey,
I need to test a component that iterates over the
Assetsproperty.I am currently struggling to figure out how to seed these Assets in bunit.
I already saw that this has been suggested for
net9.0, and I am working innet10.0.However that issue has been closed, because the usecase under test was (probably) appending the hash to the path.
#1612
But my usecase to test is an iteration over these assets.
So my question is:
How exactly would I correctly set these assets up in bUnit?
Scenario