public async Task Have_ExpandMode_Attribute_SetToMulti_ByDefault() { // Arrange IRenderedComponent <BfAccordion> cut = RenderComponent <BfAccordion>(); // Asset IAttr attr = cut.Find(FastHtmlElements.FastAccordion) .Attributes .GetNamedItem(FastHtmlElements.FastAccordionAttributes.ExpandMode); attr.Should().NotBeNull(); }
public async Task Have_ExpandMode_Attribute_SetToSingle_WhenConfiguredSo() { // Arrange IRenderedComponent <BfAccordion> cut = RenderComponent <BfAccordion>( p => p.Add(pp => pp.ExpandMode, BfComponentApis.BfAccordion.ExpandModeValues.Single)); // Asset IAttr attr = cut.Find(FastHtmlElements.FastAccordion) .Attributes .GetNamedItem(FastHtmlElements.FastAccordionAttributes.ExpandMode); attr.Should().NotBeNull(); }
public async Task BeOpened_WhenConfiguredSo() { // Arrange IRenderedComponent <BfAccordion> cut = RenderComponent <BfAccordion>( p => p.AddChildContent <BfAccordionItem>(pp => pp.Add( ppp => ppp.IsExpanded, true))); // Assert IAttr attr = cut.Find($"{FastHtmlElements.FastAccordion}>{FastHtmlElements.FastAccordionItem}") .Attributes .GetNamedItem("expanded"); attr.Should().NotBeNull(); }
public async Task SplatUnknownParameters() { // Arrange IRenderedComponent <BfAccordion> cut = RenderComponent <BfAccordion>( ("custom", "value")); // Assert IAttr attr = cut.Find(FastHtmlElements.FastAccordion) .Attributes .GetNamedItem("custom"); attr.Should().NotBeNull(); attr.Value.Should().Be("value"); }
public async Task Splat_UnknownParameters() { // Arrange IRenderedComponent <BfAccordion> cut = RenderComponent <BfAccordion>( p => p.AddChildContent <BfAccordionItem>( ppp => ppp.AddUnmatched("custom", "value") )); // Assert IAttr attr = cut.Find($"{FastHtmlElements.FastAccordion}>{FastHtmlElements.FastAccordionItem}") .Attributes .GetNamedItem("custom"); attr.Should().NotBeNull(); attr.Value.Should().Be("value"); }