• September 2024
    M T W T F S S
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    30  
  • Latest Posts

  • Latest Comments

  • Archives

Posts Tagged ‘ASP.NET’


Unicorn Series Overview

Headline: All the modern software development practices really do make significant business impact. Contents Automated Testing Disclaimer: As usual, there is not information in this series that would be considered proprietary information for C&C Reservoirs. This is the overview and index for a series on software development practices the team I’m leading has been using […]

Batching Items with EF 6.0

Headline: It’s not too hard to batch items with or without async capabilities in Entity Framework (EF) 6.0. Here I have a large number (ok… not in the sample test, but in real life) of items and I’d like to pull them in as in batches rather than wait for all of them to be […]

Unit Testing HandleErrorAttribute

Code Analysis doesn’t like the former MVC pattern of using a catch for all errors when updating a model. I wanted to use the HandleError attribute to deal with errors, but how should I unit test it? There are several keys to having the HandleError attribute work: Must decorate the Action with [HandleError] Must have […]

Unit Test Authorize Attribute

Technorati Tags: Unit Testing,ASP.NET,MVC,VS 2010 Story: I want to write a unit test to ensure that the Authorize attribute is applied to a controller ActionResult or ViewResult so that security is tested. Here is the test: Unit Test [TestMethod] public void PreviousSiteUserConversion_Authorization_Attributes_Have_Been_Applied() {     // Arrange     MethodInfo varietalMethod = typeof(AdminController).GetMethod("PreviousSiteUserConversion", new Type[] { });       // […]

Impressed with CrystalTech for .NET 4.0

Technorati Tags: .NET 4.0,Hosting,ASP.NET I’ve used CrystalTech for years. They seemed to be falling behind a bit when I started to work with the MVC (Model-View-Controller) pattern. That works MUCH better with IIS 7 than with IIS 6, but CrystalTech only had IIS 6 servers. That’s all changed! I now have no excuses for not […]

MVC – The Start

Technorati Tags: ASP.NET,MVC,Code Analysis,Unit Testing This shows my initial setup of an MVC 2 RC 2 application. Using Visual Studio 2010 RC I selected File –> New –> Project… then under Visual C#, Web, I selected the ASP.NET MVC 2 Web Application. Then when I click OK I get the following dialog. Since I’m a […]

Testing HtmlHelper in MVC 2 RC 2

Technorati Tags: MVC,TDD,Mock,Moq I strive to use TDD (Test Driven Development) so not having unit tests drives me crazy. I was so pleased to run across this post http://ox.no/posts/mocking-htmlhelper-in-aspnet-mvc-rc1-using-moq making it easy for me to unit test the Html Helper. But then I downloaded the MVC 2 RC 2 and all my unit tests for […]

Showing the Version for an MVC App

Technorati Tags: MVC,ASP.NET,VS 2010 The primary MVC (Model-View-Controller) application that I’m working on is called KarlZMvc resulting in a dll called KarlZMvc.dll. To get the version output on my Site.Master page I need to include the following line: Code Snippet <{f073afa9b3cad59b43edffc8236236232bb532d50165f68f2787a3c583ed137f}= typeof(KarlZMvc.MvcApplication).Assembly.GetName().Version.ToString() {f073afa9b3cad59b43edffc8236236232bb532d50165f68f2787a3c583ed137f}> I tried all sorts of combinations with the GetExecutingAssembly, or calling, etc. […]

Globalization in web.config

Technorati Tags: MVC,Globalization,ASP.NET Headline: Putting the following code in the web config (at least for an ASP.NET MVC app) will cause your pages to honor the user’s browser settings. Code Snippet   <!–If culture and uiCulture are set to auto, ASP.NET can set the UI culture and culture for a Web page automatically, based on the […]

Forget the Colon as a Separator

Technorati Tags: MVC,ASP.NET Headline: Only use a colon as a separator when there is no other visible means of separation. Stated differently, “Stop using a colon between a label and a text box!” Back in DOS (Disc Operating System) when there was no graphical user interface we needed a way to let the user know […]