Monday, September 8, 2014

Microsoft 70-486: Configure state management

Exam Objectives


Choose a state management mechanism (in-process and out of process state management), plan for scalability, use cookies or local storage to maintain state, apply configuration settings in web.config file, implement sessionless state (for example, QueryString)

Quick Overview of Training Materials


MSDN - ASP.NET State Management Overview and Recommendations

Friday, September 5, 2014

ASP.NET MVC Unit Testing Part 4: The Tests and What Was Learned

So, now that the project is refactored with interfaces, I have fake data, and a fake environment, it's time to run some unit tests! Whoohoo!  I'll go over some of the basic tests and also cover what I learned over all throughout the unit testing process.

Thursday, September 4, 2014

ASP.NET MVC Unit Testing Part 3: Faking the Environment (HttpContext)

So I have my fake data, but I also need to address additional dependencies that are not as obvious.  These dependencies arise from the use of User and Request, which are properties of the HttpContext.  Because you apparently can't assign HttpContext directily, you have to create a fake ControllerContext.


ASP.NET MVC Unit Testing Part 2: Faking the Database

Now that the production code is all set up, it's time to create the fakes that I'll inject for my unit tests.  Rather than connecting to the production database, I want my unit tests to use an in memory dataset so they will run lightning fast.  There are limitations to using in memory data (in effect substituting LINQ to Object for LINQ to Entities) which I will address in another post.


ASP.NET MVC Unit Testing Part 1: Set up

So, a little background here first.  I'm pretty new to .NET programming, having only started my first developer job just this past March.  My one and only performance management goal was to implement some unit testing.  Simple right? Well my first feeble attempts involved trying to add unit tests to a traditional ASP.NET program... come to find out unit testing code behind files is a fools errand.  Did manage to test come CRUD on a service class, but all in all it wasn't that useful.  I was also attached to a new development project called Education Assistance (EA around the water cooler) that was using MVC.  I'd read that MVC was much easier to unit test so I figured that would be a possibility at some point.  Of course, first I had to learn a little about MVC.  I worked through a few tutorials, a couple of which actually covered unit testing.  So now I knew just enough to get myself in trouble.