Angular 2 Tour of Heroes on Asp.Net Core in Visual Studio
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 72 commits behind GeorgDangl:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src/NetCoreHeroes
test/NetCoreHeroes.Tests
.gitignore
NetCoreHeroes.sln
Readme.md
global.json

Readme.md

NetCoreHeroes

Build Status

NetCoreHeroes is an example project for the Angular 2 Tour of Heroes tutorial using TypeScript in Visual Studio 2015. It's currently on Angular 2 RC4 and Asp.Net Core 1.0. I've published a few blog posts describing the process from setting up Visual Studio to Continuous Integration with Jenkins.

A live example is available here.

Build and run the project

Visual Studio: Restore node packages for the main NetCoreHeroes project and hit F5 to launch in debug mode.

Command Line: Run npm install, then npm run tsc to restore client side dependencies and compile TypeScript. Then run dotnet restore and dotnet build to compile the Asp.Net Core backend. dotnet run starts the project.

Run unit tests

Asp.Net Core Tests

Just build the whole solution, The NetCoreHeroes.Tests project has the required xUnit dependencies so unit tests are automatically discovered in Visual Studio.

TypeScript Tests

To run the unit tests for Angular 2 components, get the Chutzpah Test Adapter for Visual Studio. The Angular 2 tests should then be available in the Visual Studio Test Explorer after a rebuild.

Visual Studio Test Explorer with Anngular 2 Unit Tests

This example includes tests using async and inject with a MockBackend to unit test the HeroService.