machine.specifications

Machine.Specifications and Entity Framework Examples

I'm trying to find some best-practice examples (or any examples, actually) of using Machine.Specifications with the ASP.Net Entity Framework in an MVC project. Not having had much experience with Machine.Specifications, I'm keen to see what sort of tests other people find useful and whether there are any gotchas for using the EF-generat...

Machine.Specifications.MVC ShouldBeAView() always fails even on valid ViewResults

Has anyone run into this while using Machine.Specifications.Mvc? I setup a spec to test the results of a controller action. In this case: [Subject("User views the dashboard")] public class When_a_user_views_the_vendors_page : ManagementContext { static ActionResult result; Because of = () => result = manageController.Ve...

Mocking and Stubbing Ajax Requests

Dear All, Yesterday I re-factored the below method to return either a full view or a partial view. public ActionResult List(int page) { var viewModel = GetListViewModel(page); if(Request.IsAjaxRequest()) { return PartialView("_list", viewModel); } return View("PartsList", viewModel); } But now my tests h...