Exemplo n.º 1
0
        public void BuildHighLevelExpressionTest(
            [Values('+', '#', '.', '/', ';', '?', '&')]
            char expressionOp)
        {
            var builder = new UriTemplateBuilder();

            builder.Expression(expressionOp, new VarSpec("test"));

            var expected = "{" + expressionOp + "test}";
            var actual   = builder.Build().Template;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void BuildHighLevelsExpressionTests()
        {
            var ops     = new char[] { '+', '#', '.', '/', ';', '?', '&' };
            var builder = new UriTemplateBuilder();

            foreach (var op in ops)
            {
                builder.Expression(op, new VarSpec("test"));
            }

            var actual = string.Join(string.Empty, ops.Select(x => "{" + x + "test}").ToArray());

            Assert.AreEqual(actual, builder.Build().Template);
        }