Exemplo n.º 1
0
        public void ParsingValidContentExample()
        {
            string        attributeContent = "test";
            OpenApiString example          = new OpenApiString(attributeContent);
            Dictionary <string, OpenApiExample> examples = new Dictionary <string, OpenApiExample>();

            string parsedExample = ContentParser.GetStringExampleFromContent(example, examples);

            Assert.AreEqual(attributeContent, parsedExample);
        }
Exemplo n.º 2
0
        public void ParsingContentExamples()
        {
            string attributeContent = "test";
            Dictionary <string, OpenApiExample> examples = new Dictionary <string, OpenApiExample>
            {
                { "testKey 1", new OpenApiExample {
                      Value = new OpenApiString(attributeContent)
                  } },
                { "testKey 2", new OpenApiExample {
                      Value = new OpenApiString(attributeContent)
                  } }
            };

            string parsedExample = ContentParser.GetStringExampleFromContent(null, examples);

            Assert.AreEqual(attributeContent, parsedExample);
        }
Exemplo n.º 3
0
        public void NoExampleFoundShouldReturnNull()
        {
            string parsedExample = ContentParser.GetStringExampleFromContent(null, new Dictionary <string, OpenApiExample>());

            Assert.IsNull(parsedExample);
        }