public void SetConditional_AlreadyGotConditional_ThrowsInvalidOperationException()
        {
            // Arrange
            var context = new RadiosItemContext();

            context.SetConditional(attributes: null, content: new HtmlString("Existing conditional"));

            // Act
            var ex = Record.Exception(() => context.SetConditional(attributes: null, content: new HtmlString("Conditional")));

            // Assert
            Assert.IsType <InvalidOperationException>(ex);
            Assert.Equal <object>("Only one <govuk-radios-item-conditional> element is permitted within each <govuk-radios-item>.", ex.Message);
        }
        public void SetConditional_SetsConditionalOnContext()
        {
            // Arrange
            var context = new RadiosItemContext();

            // Act
            context.SetConditional(attributes: null, content: new HtmlString("Conditional"));

            // Assert
            Assert.Equal("Conditional", context.Conditional?.Content?.ToString());
        }
        public void SetHint_AlreadyGotConditional_ThrowsInvalidOperationException()
        {
            // Arrange
            var context = new RadiosItemContext();

            context.SetConditional(attributes: null, content: new HtmlString("Existing conditional"));

            // Act
            var ex = Record.Exception(() => context.SetHint(attributes: null, content: new HtmlString("Hint")));

            // Assert
            Assert.IsType <InvalidOperationException>(ex);
            Assert.Equal <object>("<govuk-radios-item-hint> must be specified before <govuk-radios-item-conditional>.", ex.Message);
        }