public void ItemsDatasourceDoesNotChangeCase()
        {
            var page = new PivotDatasourcePage();

            page.DataSources.Add(new ItemsDatasourceTagHelper {
                Items = new[] {
                    new {
                        CamelCaseName      = "Value1",
                        lowerCamelCaseName = "value2"
                    }
                }
            });

            page.ExecuteSynchronously();

            var dataSourceConfig = page.TopLevelTag.GetConfigValue <IDictionary <string, object> >("dataSource");

            AssertIgnoreWhitespaces.Contains(
                @"""data"": [
                    {
                        ""CamelCaseName"": ""Value1"",
                        ""lowerCamelCaseName"": ""value2""
                    }
                ]",
                JsonConvert.SerializeObject(dataSourceConfig["store"])
                );
        }
        public void DatasourceDoesNotAddEmptyConfig()
        {
            var page = new PivotDatasourcePage();

            page.DataSources.Add(new TestStoreDatasourceTagHelper());
            page.DataSources.Add(new PivotGridDatasourceTagHelper());

            page.ExecuteSynchronously();

            var dataSourceConfig = page.TopLevelTag.GetConfigValue <IDictionary <string, object> >("dataSource");

            Assert.Null(dataSourceConfig);
        }
        public void PivotGridDatasourceCreatesConfig()
        {
            var page = new PivotDatasourcePage();

            page.DataSources.Add(new PivotGridDatasourceTagHelper {
                OnChanged = "any"
            });

            page.ExecuteSynchronously();

            var dataSourceConfig = page.TopLevelTag.GetConfigValue <IDictionary <string, object> >("dataSource");

            Assert.True(dataSourceConfig.ContainsKey("OnChanged"));
        }