public void BuildLiteralTest()
        {
            var builder = new UriTemplateBuilder();

            builder.Append("abc");
            var actual = builder.Build().Template;
            Assert.AreEqual("abc", actual);

            builder.Append("/def");
            actual = builder.Build().Template;
            Assert.AreEqual("abc/def", actual);
        }
        public void BuildHighLevelExpressionTest(
            [Values('+', '#', '.', '/', ';', '?', '&')]
            char expressionOp)
        {
            var builder = new UriTemplateBuilder();
            builder.Append(expressionOp, new VarSpec("test"));

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

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

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

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

            Assert.AreEqual(actual, builder.Build().Template);
        }
 public void BuildExpressionTest()
 {
     var builder = new UriTemplateBuilder();
     builder.Append(new VarSpec("test"));
     Assert.AreEqual("{test}", builder.Build().Template);
 }
 public void BuildExpressionsTest()
 {
     var builder = new UriTemplateBuilder();
     builder.Append(new VarSpec("t1"), new VarSpec("t2"), new VarSpec("t3"));
     Assert.AreEqual("{t1,t2,t3}", builder.Build().Template);
 }