Exemplo n.º 1
0
        public void ToString_WithSubgridOption_SubGridWithOption()
        {
            SubGridSettings4Test sg = new SubGridSettings4Test();
            sg.SetPlusIcon("plusIconClass");
            sg.SetMinusIcon("minusIconClass");
            sg.SetOpenIcon("openIconClass");
            sg.ExpandOnLoad(false);
            sg.SelectOnExpand(true);
            sg.ReloadOnExpand(false);

            string expected =
            @"subGrid: true,
            subGridOptions: {
            plusicon: 'plusIconClass',
            minusicon: 'minusIconClass',
            openicon: 'openIconClass',
            expandOnLoad: false,
            selectOnExpand: true,
            reloadOnExpand: false
            },
            subGridRowExpanded: function (sid, rid) {
            $('#' + sid).html(""<table id='subGridId'></table>"");
            var rd = $(this).getRowData(rid);
            $(""#subGridId"").jqGrid({});
            }".RemoveSpaces();
            string actual = sg.ToString().RemoveSpaces();

            Assert.AreEqual(expected, actual);
        }