robinvanderknaap / MvcJqGrid

Fluent jqGrid Html Helper for ASP.NET MVC
www.playground.webpirates.nl/mvcjqgrid
GNU Lesser General Public License v3.0
101 stars 74 forks source link

Update Grid.cs #28

Closed brncesar closed 10 years ago

brncesar commented 11 years ago

Add stringResult option to filterToolbar

daanl commented 11 years ago

Hi @brncesar thanks for the pull request, could you add the needed unit tests to ensure this behavior works correctly?

You can find the examples here: https://github.com/robinvanderknaap/MvcJqGrid/blob/master/src/MvcJqGrid.Tests/GridTests.cs

brncesar commented 11 years ago

I'm sorry, but I do not know how to implement a unit test.

=(

Att, Bruno Cesar (61) 8448.4272

“É impossível haver progresso sem mudanças, e quem não consegue mudar a si mesmo não muda coisa alguma.” (George Bernard Shaw)

2013/6/26 Daan Le Duc notifications@github.com

Hi @brncesar https://github.com/brncesar thanks for the pull request, could you add the needed unit tests to ensure this behavior works correctly?

— Reply to this email directly or view it on GitHubhttps://github.com/robinvanderknaap/MvcJqGrid/pull/28#issuecomment-20061946 .

daanl commented 11 years ago

No problem! Look at the url i sent. In the solution there is a project called Tests. We use http://www.nunit.org/ as our test runner. If you have visual studio 2012 you just can right click run tests on the .cs file. This will run the tests.

We want to verify that if you create a Grid and set the property to true or false it outputs the correct behavior.

For example the code below

 [Test]
 public void CanSetAlternateClass()
 {
   var grid = new Grid("testGrid");
   grid.SetAltClass("testClass");

   StringAssert.Contains("altclass:'testClass',", grid.ToString());
   JavascriptAssert.IsValid(grid.RenderJavascript());
  }
robinvanderknaap commented 10 years ago

I've set the default value to true for stringResult to maintain backwards compatibility.

robinvanderknaap commented 10 years ago

Thanx! Sorry for the delay in merging this pull request!

robinvanderknaap commented 10 years ago

This included in NuGet package 1.0.13