I have created a custom control wrapper for the DropDownList. My main reason was to create some shortcut methods for custom objects that we are using to populate the list.
I am trying to write some automated tests for my custom control. The problem is that when I create an instance of the custom control in the automated test (but not actually put it on a form or control), some of the data functionality is lost. I can set the DataSource property (using a list of my custom objects), but the Items collection still shows a count of 0. I can set the SelectedIndex proprty to a valid value, but the SelectedItem property remains null. When I do this same thing with an actual control on a form, the Items collection is populated and reflects what I set in the DataSource property.
I assume that the DropDownList is borrowing some functionality from the form to tie the DataSource and Items properties together.
Is there something additional that I can do to make the DropDownList fully functional in an automated test, or is this not possible?
I have tried using the Rebind method and this does not help. I also tried not using my custom control and just creating a RadDropDownList object directly in my automated test and it behaves the same way.
I am trying to write some automated tests for my custom control. The problem is that when I create an instance of the custom control in the automated test (but not actually put it on a form or control), some of the data functionality is lost. I can set the DataSource property (using a list of my custom objects), but the Items collection still shows a count of 0. I can set the SelectedIndex proprty to a valid value, but the SelectedItem property remains null. When I do this same thing with an actual control on a form, the Items collection is populated and reflects what I set in the DataSource property.
I assume that the DropDownList is borrowing some functionality from the form to tie the DataSource and Items properties together.
Is there something additional that I can do to make the DropDownList fully functional in an automated test, or is this not possible?
I have tried using the Rebind method and this does not help. I also tried not using my custom control and just creating a RadDropDownList object directly in my automated test and it behaves the same way.