Unit testing razor pages

In ASP.NET MVC, views are the components that are used for rendering a web application's user interface. The view presents information contained in the model in a suitable and easy-to-understand output format, such as HTML, XML, XHTML, or JSON. The view generates output to the user based on the update performed on the model.

Razor pages make coding features on pages relatively easier. A razor page is similar to a razor view, with the addition of the @page directive. The @page directive must be the first directive in the page, it automatically converts the file into an MVC action handling requests without going through the controller.

In ASP.NET Core, razor pages can be tested to ensure they work correctly in isolation ...

Get C# and .NET Core Test Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.