Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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");
        }
Exemplo n.º 5
0
        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");
        }