Skip to content

Commit

Permalink
Merge pull request #66 from nbarbettini/small-updates
Browse files Browse the repository at this point in the history
Small updates
  • Loading branch information
nbarbettini authored Jun 11, 2018
2 parents f4054c0 + 6957053 commit 715a474
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chapters/automated-testing/integration-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Integration tests are slower and more involved than unit tests, so it's common f

In order to test the whole stack (including controller routing), integration tests typically make HTTP calls to your application just like a web browser would.

To write integration tests that make HTTP requests, you could manually start your application and tests at the same time, and write your tests to make requests to `http://localhost:5000`. ASP.NET Core provides a nicer way to host your application for testing, however: the `TestServer` class. `TestServer` can host your application for the duration of the test, and then stop it automatically when the test is complete.
To perform an integration test, you could start your application and manually make requests to http://localhost:5000. However, ASP.NET Core provides a better alternative: the `TestServer` class. This class can host your application for the duration of the test, and then stop it automatically when the test is complete.

### Create a test project

Expand Down
5 changes: 4 additions & 1 deletion chapters/conclusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ To Jennifer, who always supports my crazy ideas.
To the following contributors who improved the Little ASP.NET Core Book:

* 0xNF
* Matt Welke
* Matt Welke (welke)
* Raman Zhylich (zhilich)

To these amazing polyglot programmers who translated the Little ASP.NET Core Book:

Expand All @@ -50,6 +51,8 @@ The full, detailed changelog is always available here:

https://github.com/nbarbettini/little-aspnetcore-book/releases

**1.1.1** (2018-06-11): Fixed typos found by readers.

**1.1.0** (2018-05-03): Significantly reworked the *Add more features* chapter to use MVC thorough the whole stack and remove the AJAX pattern. Removed Facebook login to simplify the security chapter and streamline testing and deployment. Updated the Docker instructions to reflect the latest best practices. Fixed typos and added suggestions from readers. The book also sports a new, improved cover design!

**1.0.4** (2018-01-15): Added explanation of service container lifecycles, clarified server ports and the -o flag, and removed semicolons after Razor directives. Corrected Chinese translation author credit. Fixed other small typos and issues noticed by readers.
Expand Down
3 changes: 2 additions & 1 deletion chapters/security-and-identity/authorization-with-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Create a new class in the root of the project called `SeedData`:

```csharp
using System;
using System.Linq;
using System.Threading.Tasks;
using AspNetCoreTodo.Models;
using Microsoft.AspNetCore.Identity;
Expand Down Expand Up @@ -301,7 +302,7 @@ You can inject the `UserManager` directly into a view to do these types of autho

@if (signInManager.IsSignedIn(User))
{
var currentUser = await UserManager.GetUserAsync(User);
var currentUser = await userManager.GetUserAsync(User);

var isAdmin = currentUser != null
&& await userManager.IsInRoleAsync(
Expand Down
3 changes: 2 additions & 1 deletion chapters/use-a-database/create-service-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ namespace AspNetCoreTodo.Services

public async Task<TodoItem[]> GetIncompleteItemsAsync()
{
return await _context.Items
var items = await _context.Items
.Where(x => x.IsDone == false)
.ToArrayAsync();
return items;
}
}
}
Expand Down

0 comments on commit 715a474

Please sign in to comment.