Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. MVC3 unit testing
  2. var searchResults = SearcherUnderTest.Search("TestKeyword");
  3.  
  4. Assert.IsInstanceOfType( Type expected, object searchResults );
  5.        
  6. [Test]
  7. public void Search_ShouldReturnAListOfOrders()
  8. {
  9.     var result = _controller.Search("searchParameter") as MyViewModel ;
  10.  
  11.     Assert.That(result, Is.Not.Null);
  12.     Assert.That(result.SearchResults, Is.Not.Null);
  13.     Assert.That(result.SearchResults.Count, Is.GreaterThan(0));
  14. }