Represents the primary builder class for creating StubbleRenderer instances
Inheritance: IStubbleBuilder
        public void It_Should_See_Empty_DataTables_As_Falsey()
        {
            var stubble = new StubbleBuilder().AddSystemData().Build();

            var output = stubble.Render("{{#foo}}I'm in foo{{/foo}}", new {foo = new DataTable()});
            Assert.Equal("", output);
        }
        public void It_Doesnt_Throw_When_No_Value_Exists()
        {
            const string json = "{ foo: \"bar\" }";

            var stubble = new StubbleBuilder()
                                .AddJsonNet()
                                .Build();

            var obj = JsonConvert.DeserializeObject(json);

            var output = stubble.Render("{{foo2}}", obj);
            Assert.Equal("", output);
        }
        public void It_Can_Get_Values_From_JTokens()
        {
            const string json = "{ foo: \"bar\" }";

            var stubble = new StubbleBuilder()
                                .AddJsonNet()
                                .Build();

            var obj = JsonConvert.DeserializeObject(json);

            var output = stubble.Render("{{foo}}", obj);
            Assert.Equal("bar", output);
        }
        public void It_Handles_Nested_Objects()
        {
            const string json = "{ foo: { bar: \"foobar\" } }";

            var stubble = new StubbleBuilder()
                                .AddJsonNet()
                                .Build();

            var obj = JsonConvert.DeserializeObject(json);

            var output = stubble.Render("{{foo.bar}}", obj);
            Assert.NotNull(output);
            Assert.Equal("foobar", output);
        }
        public void It_Handles_Arrays_Correctly()
        {
            const string json = "{ foo: [ { bar: \"foobar\" } ] }";

            var stubble = new StubbleBuilder()
                                .AddJsonNet()
                                .Build();

            var obj = JsonConvert.DeserializeObject(json);

            var output = stubble.Render("{{#foo}}{{bar}}{{/foo}}", obj);
            Assert.NotNull(output);
            Assert.Equal("foobar", output);
        }
        public void Truthy_Checks_Work_Correctly()
        {
            const string json = "{ showme: false, foo: { bar: \"foobar\" } }";

            var stubble = new StubbleBuilder()
                                .AddJsonNet()
                                .Build();

            var obj = JsonConvert.DeserializeObject(json);

            var output = stubble.Render("{{#showme}}{{foo.bar}}{{/showme}}", obj);
            Assert.NotNull(output);
            Assert.Equal("", output);
        }
        public void It_Should_Be_Able_To_Access_DataTables_In_DataSet_By_Index()
        {
            var dt = new DataTable();
            dt.Columns.Add("IntColumn", typeof(int));
            dt.Rows.Add(1);
            dt.Rows.Add(2);
            dt.Rows.Add(3);

            var dt2 = new DataTable();
            dt2.Columns.Add("IntColumn", typeof(int));
            dt2.Rows.Add(3);
            dt2.Rows.Add(2);
            dt2.Rows.Add(1);

            var ds = new DataSet();
            ds.Tables.Add(dt);
            ds.Tables.Add(dt2);
            var stubble = new StubbleBuilder().AddSystemData().Build();

            var output = stubble.Render("{{#foo.0}}{{IntColumn}}{{/foo.0}}-{{#foo.1}}{{IntColumn}}{{/foo.1}}", new { foo = ds });
            Assert.Equal("123-321", output);
        }
        public void It_Should_Enumerate_Through_DataSet()
        {
            var dt = new DataTable("TableA");
            dt.Columns.Add("IntColumn", typeof(int));
            dt.Rows.Add(1);
            dt.Rows.Add(2);
            dt.Rows.Add(3);

            var dt2 = new DataTable("TableB");
            dt2.Columns.Add("IntColumn", typeof(int));
            dt2.Rows.Add(3);
            dt2.Rows.Add(2);
            dt2.Rows.Add(1);

            var ds = new DataSet();
            ds.Tables.Add(dt);
            ds.Tables.Add(dt2);
            var stubble = new StubbleBuilder().AddSystemData().Build();

            var output = stubble.Render("{{#foo}}{{#.}}{{IntColumn}}{{/.}}{{/foo}}", new { foo = ds });
            Assert.Equal("123321", output);
        }
        public void It_Should_Treat_DataTable_As_List()
        {
            var dt = new DataTable();
            dt.Columns.Add("IntColumn", typeof(int));
            dt.Rows.Add(1);
            dt.Rows.Add(2);
            dt.Rows.Add(3);

            var stubble = new StubbleBuilder().AddSystemData().Build();

            var output = stubble.Render("{{#foo}}{{IntColumn}}{{/foo}}", new { foo = dt });
            Assert.Equal("123", output);
        }