def test_i_tabular_data
Funfx.instance
mock = Class.new Flex::DataGrid do
include FlexMock::TestCase
def is_sync
true
end
def flex_object
m = flexmock("funfx")
m.should_receive(:getTabularData).with("tempid", nil, nil).and_return("tabularvalue1,tabularvalue2")
m.should_receive(:getTabularData).with("tempid", 0, 0).and_return("tabularvalue1")
m.should_receive(:getTabularData).with("tempid", 0, nil).and_return("tabularvalue1")
m.should_receive(:getTabularData).with("tempid", 1, 1).and_return("")
return m
end
end
begin
Flex.const_get("MockDataGrid")
rescue
Object.const_set "MockDataGrid", mock
end
datagrid = MockDataGrid.new(@parentName, @id)
assert_not_nil(datagrid)
assert_equal("tabularvalue1,tabularvalue2",datagrid.tabular_data)
assert_equal("tabularvalue1", datagrid.tabular_data(:start => 0, :end => 0))
assert_equal("tabularvalue1", datagrid.tabular_data(:start => 0))
assert_equal("", datagrid.tabular_data(:start => 1, :end => 1))
end