I'm migrating an application from the old Telerik Mvc controls to the latest UI for ASP.NET MVC wrappers.
I have a bunch of unit tests that validated the controller actions that the grid calls for data. A simple example would be:
Now that I have replaced the grids and I'm passing a DataSourceRequest instead, I don't suppose there's a similarly handy function that can replace the GridCommand.Parse statement?
Cheers,
Nick
I have a bunch of unit tests that validated the controller actions that the grid calls for data. A simple example would be:
<TestMethod()>
Public
Sub
GetLogEntryData_Passes_Through_Filters_On_Multiple_Columns()
Dim
passedCmd
As
GridParameters =
Nothing
_adminLogService.Setup(
Function
(s) s.GetLogEntries(It.IsAny(Of GridParameters))).Returns(_validLogEntries).Callback(
Sub
(p) passedCmd = p)
Dim
target
As
New
AdminLogController(_adminLogService.
Object
,
Nothing
)
Dim
cmd
As
GridCommand = GridCommand.Parse(1, 10,
Nothing
,
Nothing
,
"UserName~eq~'test'~and~ControllerName~startswith~'Users'"
)
target.GetLogEntryData(cmd)
Assert.IsNotNull(passedCmd)
Assert.AreEqual(2, passedCmd.Filters.Count)
End
Sub
Now that I have replaced the grids and I'm passing a DataSourceRequest instead, I don't suppose there's a similarly handy function that can replace the GridCommand.Parse statement?
Cheers,
Nick