Beispiel #1
0
            public void TypedVariable2()
            {
                var path   = "hello{int id}?nice";
                var target = new TestCSharpGenerator();
                var items  = target.InvokeGetUrlPathParameters(path);

                Assert.AreEqual(1, items.Count);
                Assert.IsTrue(items.ContainsKey("id"));
                Assert.AreEqual("int id", items["id"].OriginalName);
                Assert.AreEqual("id", items["id"].Name);
                Assert.AreEqual("int", items["id"].Type);
            }
Beispiel #2
0
            public void BoolVariableWithDefaultValue()
            {
                var path   = "hello{bool World = false}?nice";
                var target = new TestCSharpGenerator();
                var items  = target.InvokeGetUrlPathParameters(path);

                Assert.AreEqual(1, items.Count);
                Assert.IsTrue(items.ContainsKey("World"));
                Assert.AreEqual("bool World = false", items["World"].OriginalName);
                Assert.AreEqual("World", items["World"].Name);
                Assert.AreEqual("bool", items["World"].Type);
                Assert.AreEqual("false", items["World"].Value);
            }
Beispiel #3
0
            public void TypedAndSimpleVariable()
            {
                var path   = "hello{DateTime World}?nice{test}";
                var target = new TestCSharpGenerator();
                var items  = target.InvokeGetUrlPathParameters(path);

                Assert.AreEqual(2, items.Count);
                Assert.IsTrue(items.ContainsKey("World"));
                Assert.AreEqual("DateTime World", items["World"].OriginalName);
                Assert.AreEqual("World", items["World"].Name);
                Assert.AreEqual("DateTime", items["World"].Type);
                Assert.IsTrue(items.ContainsKey("test"));
                Assert.AreEqual("test", items["test"].OriginalName);
                Assert.AreEqual("test", items["test"].Name);
                Assert.IsNull(items["test"].Type);
            }
            public void TypedVariable2WithDefaultValue()
            {
                var path = "hello{int id = 12}?nice";
                var target = new TestCSharpGenerator();
                var items = target.InvokeGetUrlPathParameters(path);

                Assert.AreEqual(1, items.Count);
                Assert.IsTrue(items.ContainsKey("id"));
                Assert.AreEqual("int id = 12", items["id"].OriginalName);
                Assert.AreEqual("id", items["id"].Name);
                Assert.AreEqual("int", items["id"].Type);
                Assert.AreEqual("12", items["id"].Value);
            }
            public void TypedVariable()
            {
                var path = "hello{DateTime World}?nice";
                var target = new TestCSharpGenerator();
                var items = target.InvokeGetUrlPathParameters(path);

                Assert.AreEqual(1, items.Count);
                Assert.IsTrue(items.ContainsKey("World"));
                Assert.AreEqual("DateTime World", items["World"].OriginalName);
                Assert.AreEqual("World", items["World"].Name);
                Assert.AreEqual("DateTime", items["World"].Type);
            }
            public void BoolVariableWithDefaultValue()
            {
                var path = "hello{bool World = false}?nice";
                var target = new TestCSharpGenerator();
                var items = target.InvokeGetUrlPathParameters(path);

                Assert.AreEqual(1, items.Count);
                Assert.IsTrue(items.ContainsKey("World"));
                Assert.AreEqual("bool World = false", items["World"].OriginalName);
                Assert.AreEqual("World", items["World"].Name);
                Assert.AreEqual("bool", items["World"].Type);
                Assert.AreEqual("false", items["World"].Value);
            }