This is a migrated thread and some comments may be shown as answers.

[Solved] Testing w/GridCommand (can't mock)

1 Answer 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cranialstrain
Top achievements
Rank 1
Cranialstrain asked on 13 May 2010, 01:21 PM
In the style of TDD I'm trying to either stub or mock GridCommand. As the properties on GridCommand (such as PageSize/PageIndex) are not overridable this isn't possible. At the same time the FilterDescriptors and SortDescriptors properties are read-only so I can stub these.

I notice there is a static Parse method that returns a GridCommand object. Does anyone know the syntax for creating Filter and Sort Descriptors using this method?

e.g. var myNewCommand = GridCommand.Parse(3, 20, "ColumnA ASC", String.Empty, "ColumnB^Int^23");

Thanks. 

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 13 May 2010, 01:24 PM
Hi Cranialstrain,

I don't think mocking or stubbing GridCommand is necessary. It is an object without any behavior so I don't think there is any value in mocking it. I suggest you just instantiate a new instance and use it. We have provided the full source code together with unit tests. You can check it out for tips how to instantiate GridCommand, FilterDescriptor etc.

All the best,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Cranialstrain
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or