Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion EssentialCSharp.Web.Tests/FunctionalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,10 @@ public async Task WhenTheApplicationStarts_NonExistingPage_GivesCorrectStatusCod
using HttpResponseMessage response = await client.GetAsync("/non-existing-page1234");

await Assert.That(response.StatusCode).IsEqualTo(HttpStatusCode.NotFound);

string content = await response.Content.ReadAsStringAsync();
await Assert.That(content).Contains("Go Home");
await Assert.That(content).Contains("Go Back");
await Assert.That(content).Contains("Browse Chapters");
}
}
}
1 change: 1 addition & 0 deletions EssentialCSharp.Web/Views/Home/Error.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
}
<div class="d-flex gap-2">
<a href="/home" class="btn btn-primary">Go Home</a>
<a href="/hello-world" class="btn btn-outline-primary">Browse Chapters</a>
<button type="button" class="btn btn-secondary"
onclick="if(history.length > 1){ history.back(); } else { window.location='/home'; }">
Go Back
Expand Down
Loading