|
|
Jonathan McCracken |
Posts by Jonathan McCracken
|
08 Sep 2010, 13:30
Jonathan McCracken (35 posts) |
You’ll need to add a reference to your Web project in your Unit.Test project. Just right click under References and select the “Project” tab and you’ll see it listed. Another possibility is that your controller class isn’t public, so make sure that your controller looks like:
With regards to the Hope that helps, Jonathan |
|
09 Sep 2010, 21:04
Jonathan McCracken (35 posts) |
Vishal, Check out the reply to a similar post. The way it’s stated in the book is incorrect (it’s being fixed for the next printing) – you’ll need to follow the proper instructions in the above post. Hope that helps, Jonathan |
|
13 Sep 2010, 14:55
Jonathan McCracken (35 posts) |
Juan, Try a couple things. First make sure that Equals() is working properly for your Topic object. You can add a break-point to the Equals() method in Topic when debugging the test to see what is not equal or where your equals method is causing the problem. If that doesn’t fix it try this: Verify that you are clearing the Topic.Topics collection in every test. You can do that by adding the following to your setup fixture:
This will make sure that your Topic.Topics collection is reset every time you run the test and the static list isn’t becoming a side effect. Hope that helps, Jonathan |
|
29 Sep 2010, 15:24
Jonathan McCracken (35 posts) |
Hi everyone, I just wanted to post a big thank you to several readers who helped with the 1.1 of PDF. David Jenkins (who’s posted more to this forum than I have!), Greg Heath, Alexander DiMauri, John CrankShaw,Robert Dzikowski, Dave Mateer. Thanks to yours and others feedback the new version now has a downloadable Visual Studio solution file per chapter under /code/chapter_name/solution to let you check your answers against mine. Now onto MVC 3.0 changes… :) Regards, Jonathan |
|
10 Oct 2010, 12:02
Jonathan McCracken (35 posts) |
Mike, Makes sense – at that point in the book the testing routes section wouldn’t have been completed so that part of the code will look foreign until you get to the end of the chapter. I’ll make a note to change the text in the next revision – either to provide the solution in the text or qualify what you’ll see in the chapter’s solution folder. Thanks, Jonathan |
|
18 Nov 2010, 13:59
Jonathan McCracken (35 posts) |
Sharon, I think it would be fine if you posted the code there – just to be sure I’ll double check with my editor. If you do post the code to git-hub it might be helpful for you to share the link in this forum so others can benefit from your learning. Glad you’re enjoying the book, Jonathan |
|
18 Nov 2010, 14:03
Jonathan McCracken (35 posts) |
Robert – yeah it’s unfortunate that MvcContrib doesn’t handle query strings. I think their reasoning is that MVC’s model binding mechanism is what should be used to handle that. From a testing point of view that would separate these kinds of scenarios so your binding is tested via a custom or generic model binder, while the route is tested via the above helper method. Thanks, Jonathan |
|
20 Nov 2010, 01:35
Jonathan McCracken (35 posts) |
Sharon, I think it’s fine – so long as you follow these instructions: “the code all has comments as to where it came from, right? In that case let them use it, but yes, provide a link and an explanation.” Jonathan |
|
26 Nov 2010, 20:30
Jonathan McCracken (35 posts) |
(from Test-Drive ASP.NET MVC > Namespace issues)
Joel, Yeah the namespaces can be a bit inconsistent, but I’ve tried to clean them up in the downloadable code. If you’re just using Visual Studio you can right-click and select “Resolve” to fix them. Otherwise, if you have Resharper installed you can fix them by hitting ALT+ENTER. Hope that helps, Jonathan |
|
30 Nov 2010, 16:08
Jonathan McCracken (35 posts) |
John, Yes this is a bit of dependency nightmare… I’ve actually posted the DLLs you need here on my blog: http://jonathanmccracken.blogspot.com/2010/08/w… The problem lies in a version mis-match of Castle Dynamic Proxy is incompatible with FluentNHibernate and Castle Windsor. So to solve the problem I just compiled the assemblies myself. I haven’t checked lately if FluentNHibernate is now using a more modern version of Castle Dynamic Proxy, but if they are that might also solve the problem. Hope that helps, Jonathan |
35 posts
