AngularJS/MVC Cookbook Simple Binding

My previous post described the back-end configuration for my “People” domain model (people, addresses, etc.) Let’s look at how this data is used within the web application using an MVC web API controller along with an AngularJS web service call and simple data binding. The Web API I created a very simple ApiController class, called…

AngularJS/MVC Cookbook CRUD Operations

Let’s look at some fundamentals of a typical web application that performs CRUD (Create, Read, Update, and Delete) operations. For this, the CRUD Operations project was added to the AngularJS/MVC Cookbook. I needed some test data, so I borrowed a few records from SQL Server’s AdventureWorks example database. This query gave me an XML document…

AngularJS/MVC Cookbook Running Unit Tests

Running Javascript unit tests is a little bit different than testing other code. In an NUnit test, for example, the system under test and the engine running the test share the same .NET runtime which allows for easy instantiation of the tests as well as collecting test results. In a Javascript test, however, the test…

AngularJS/MVC Cookbook Unit Testing

I’ve updated the Simple Routing example in the AngularJS/MVC Cookbook with unit tests. Unit tests are meant to test a piece of an application independently from any dependencies it might have. AngularJS provides a dependency injection framework that allows (and encourages) unit testing pieces of a web application. For this application, I am using Jasmine…

AngularJS/MVC Cookbook Simple Routing

In a classic ASP.NET MVC application, stepping between parts of the application usually requires a trip to the web server to refresh the entire contents of the page. However, in a Single Page Application (SPA), only elements within the page are updated giving the user a better, more responsive experience. A SPA implementation may still…

AngularJS/MVC Cookbook Basic Project

As part of the Angular-MVC-Cookbook project, I needed a starting point for a web application. In the Basic Project path, there is a pre-configured ASP.NET MVC application that includes a number of components. It’s a very basic project. I’ve removed the universal providers, additional javascript libraries (like jQuery UI, Knockout, etc.), and turned off forms…

Testing SmtpClient using Microsoft Fakes

A new feature of Visual Studio 2012 is the Microsoft Fakes functionality (well, not a new feature, per se, just a repackaging of the Moles Isolation Framework published by Microsoft Research). It provides a means to isolate functionality in .NET application for testing, including non-virtual and static methods in sealed types. The last part is…