Exemplo n.º 1
0
        public void ShouldGetHeaderContent()
        {
            //parse the content tested in the YamlContentParser, do not mock in this case
            var container = new CultureContentContainer();
            var sut       = new ContentHandler(container);
            var dutch     = new CultureInfo("nl-NL");

            sut.TranslateParsedYamlToContent(dutch, YamlParser.RenderYamlToObject(ContentYamlTest3.Body));
            var cultureContent = sut.GetContentByCulture(dutch);

            Assert.Equal("#Zorgtoeslag", cultureContent.GetContent("berekening.header", "titel"));
            Assert.Equal("##Proefbekrekening", cultureContent.GetContent("berekening.header", "ondertitel"));
        }
Exemplo n.º 2
0
        public void ShouldTransLateParsedContentToContent()
        {
            //parse the content tested in the YamlContentParser, do not mock in this case
            var container = new CultureContentContainer();
            var sut       = new ContentHandler(container);
            var dutch     = new CultureInfo("nl-NL");

            sut.TranslateParsedYamlToContent(dutch, YamlParser.RenderYamlToObject(ContentYamlTest1.Body));
            var cultureContent = sut.GetContentByCulture(dutch);

            Assert.Equal("Indien u niet zeker weet wat uw woonsituatie is, kijk dan op de website van de Belastingdienst.",
                         cultureContent.GetContent("stap.woonsituatie", FormElementContentType.Description));
        }
Exemplo n.º 3
0
        public void ShouldTransLateParsedContentToContentForMultipleKeys()
        {
            //parse the content tested in the YamlContentParser, do not mock in this case
            var container = new CultureContentContainer();
            var sut       = new ContentHandler(container);
            var dutch     = new CultureInfo("nl-NL");

            sut.TranslateParsedYamlToContent(dutch, YamlParser.RenderYamlToObject(ContentYamlTest2.Body));
            var cultureContent = sut.GetContentByCulture(dutch);

            Assert.Throws <IndexOutOfRangeException>(() => cultureContent.GetContent("stap.woonsituatie.keuze.alleenstaande, multipleKeys", FormElementContentType.Description));
            Assert.Equal("Alleenstaande", cultureContent.GetContent("stap.woonsituatie.keuze.alleenstaande", FormElementContentType.Description));
            Assert.Equal("Alleenstaande", cultureContent.GetContent("multipleKeys", FormElementContentType.Description));
        }