Welcome to the Xceed Community | Help
Community Search  
More Search Options

Headless Testing

Sort Posts: Previous Next
  •  09-27-2011, 12:15 PM Post no. 31097

    Headless Testing

    Hello, 

    I'm looking for some guidance on how to proceed.  We are using the SL DataGridControl to display query results from a server and are making use of virtualization.  Everything works fine when running our application; however, we would like to write scenario-type tests that run these queries from the viewmodel layer.  These tests are run without a view and are intended to execute the same code path (from the viewmodel down) that the application takes.  For example a simple test might create the viewmodel that is the DataContext for the DataGridControl, set some query parameters, execute an ICommand to run the query and verify a results set. 

    The issue we're running into is that we are using an AsyncDataSourceProvider to query the server and since we are using virtualization and running headless, the data provider's overrides are never invoked (e.g. BeginExecuteDataQuery, etc.).  Is there a way to turn off virtualization or force fetching data in these circumstances?  Also, please let me know if I've omitted any crucial information here.  Unfortunately I am not the developer who integrated the Xceed controls into our app so I'm picking this up as I go.

    Thanks for any assistance you can offer.

     

  •  09-28-2011, 9:54 AM Post no. 31107 in reply to 31097

    Re: Headless Testing

    Hi Mike,

    I seems that you are looking to "mimic" the data requests made by the DataGrid's UI to the AsyncDataSourceProvider. Unfortunately, for simplicity and to avoid bloating the public/protected API, the methods used by the UI on the DataSourceProvider were made internal to our assemblies since they were not intended to be called by any of the user's code. These calls are the ones that end up to call your implementations overrides (e.g. BeginExecuteDataQuery, etc.).

    Probably your best bet would be to simply skip the AsyncDataSourceProvider, and have your tests to call directly your underlying source of data (the one called within the "BeginExecuteDataQuery" override). Take note that in a "real UI" scenario, the queried data depend strongly on the UI size and even on the speed at witch the user interact with the datagrid. Our "buffer active prefetching" also "pre download" data in order to keep the UI as responsible as possible when the end-user makes it's pageup/pagedown operations. Probably a system that "record" the calls made to your viewmodel while interacting with the UI would be the best way to re-create real life simulation of the calls made to your data source.

    Etienne

     


View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.