예제 #1
0
        public void Can_set_statement()
        {
            // set statement using constructor
            var request = new AnalyticsRequest(Statement);

            var formValues = request.GetFormValues();

            Assert.Equal(Statement, formValues["statement"]);

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

            Assert.Equal(Statement, json.statement.Value);

            // set statement using method
            const string statement = "SELECT 1 FROM `datset`;";

            request.WithStatement(statement);

            formValues = request.GetFormValues();
            Assert.Equal(statement, formValues["statement"]);

            json = JsonConvert.DeserializeObject <dynamic>(
                request.GetFormValuesAsJson()
                );
            Assert.Equal(statement, json.statement.Value);
        }