Beispiel #1
0
        public void Can_add_named_parameter()
        {
            var request = new AnalyticsRequest(_defaultstatement);

            request.AddNamedParamter("my_string", "value");
            request.AddNamedParamter("my_int", 10);
            request.AddNamedParamter("my_bool", true);

            var formValues = request.GetFormValues();

            Assert.AreEqual("value", formValues["my_string"]);
            Assert.AreEqual(10, formValues["my_int"]);
            Assert.AreEqual(true, formValues["my_bool"]);

            var json = JsonConvert.DeserializeObject <dynamic>(
                request.GetFormValuesAsJson()
                );

            Assert.AreEqual("value", json.my_string.Value);
            Assert.AreEqual(10, json.my_int.Value);
            Assert.AreEqual(true, json.my_bool.Value);
        }