MyTested.AspNetCore.Mvc
MyTested.AspNetCore.Mvc copied to clipboard
Fluent testing library for ASP.NET Core MVC.
The library should test the routes based on whether the endpoint routing is turned on or off. More information here: https://aregcode.com/blog/2019/dotnetcore-understanding-aspnet-endpoint-routing/
When `.But()` is implemented in #281 `Without` methods will be needed. Needed methods: - [ ] `WithoutData` in the EntityFrameworkCore package - [ ] `WithoutMemoryCache` in the Caching package -...
Example test: ```c# MyRouting .Configuration() .ShouldMap(request => request .WithMethod(HttpMethod.Post) .WithLocation("/My/Action") .WithFormFields(new { Title = title, Content = content }) .WithUser() .WithAntiForgeryToken()) .To(c => c.Action(new MyFormModel { Title = title, Content...
Sample tests should look like this: ```c# MyController .Instance() .WithUser(user => user .WithUsername("MyUserName")) .Calling(c => c.Index()) .ShouldReturn() .Ok() .But() .WithoutUser() .ShouldReturn() .Unathorized(); MyController .Instance() .Calling(c => c.Get(1)) .ShouldReturn() .Ok() .But()...
This should be a configuration option.
Currently `.WithSetupFor` will throw an exception if the service is registered as `IOptions`, no matter the lifetime.
Currently, it shows a generic error stating the component could not be instantiated. It should how a correct error and do not catch all exceptions. Maybe add this to the...
Even if the model state contains errors - it is considered skipped https://github.com/aspnet/Mvc/commit/faba95287ee761f5a208ad1df42239ca9c9b3fa4
These should be renamed to Specifying. The old methods should be marked as obsolete after version 3.0 and deleted after version 3.1. The reason is - you may have route...