MyTested.AspNetCore.Mvc
MyTested.AspNetCore.Mvc copied to clipboard
General Enhancements and Ideas
- [x] VoidActionResult can be singleton
- [x] MockedLoggerFactory and MockedLogger can be singleton
- [x] CreateDefaultAuthenticated can be singleton
- [x] Reflection caching
- [x] MockedHttpResponse may not be used - default one should work
- [X] ControllerBuilder should expose its properties for extensibility
- [x] ContentType testing do not need to instantiate MediaTypeHeaderValue class
- [x] Change With to Containing everywhere collections are asserted
- [x] Cast all dynamic calls
- [ ] All exact collection testers should say it checks the count
- [x] Loop handling in deeply equal tests
- [x] Check ObjectResult declared type
- [ ] With total number of elements in collection
- [x] HttpRequest and HttpResponse object contents for easier testing
- [x] Null checking in error messages can be extracted
- [ ] Add local caching to various test helpers, which invoke the same algorithm (for example Cookies in HTTP response tests)
- [x] Use default Startup finder
- [ ] WithResolvedDependencies may use the default service collection
- [ ] Non-controller route action testing
- [X] Remove Func expressions from route testing
- [X] Add custom StringInput formatter (https://github.com/aspnet/Mvc/blob/fe639f028fb3aac96da779a2484e4d9f49990df8/test/WebSites/FormatterWebSite/StringInputFormatter.cs)
- [x] Dictionary validator
- [ ] Examine the stream workaround in JSON parsing (FormattersHelper.WriteAsStringToStream)
- [ ] GetEncodingName is not used properly
- [ ] Consider using disposing mechanisms for various components (controller, HTTP context, etc.)
- [ ] Optimize startup with lazy initialization as much as possible
- [x] All ShouldHave test builders should be chainable
- [x] Getting route values can be done from the expression call
- [x] Add value providers to the controller context
- [x] Add WithResolvedRouteData - with and without additional values - to resolve route data from the provided expression
- [x] Redirect and Created should work with route values like route testing (count check only if no lambda expression provided)
- [x] React to removed HTTP prefix on action results
- [X] Consider removing the full scan of the StartUp file
- [X] Strong name assebly
- [ ] If problems, consider using WrappedApplicationEnvironment in platform services
- [ ] Move exceptions to folders
- [X] Controller builder chaining should not have any order
- [ ] Delay StartupLoader
- [ ] IHttpContextAccessor may need to be overriden with non logical context - needs further testing
- [ ] Exception messages may get prefixes from the test context
- [x] Service extensions should allow implementation factories (and replace to other type of scope)
- [ ] Uri test builder can use actions and detailed errors
- [ ] Parallel applications
- [ ] Exception helper for common exceptions
- [ ] Filter cache caches action execution - examine whether it can help with performance (ObjectMethodExecutor)
- [ ] Add Passing with predicate wherever possible (route arguments, HTTP response models, etc.)
- [ ] Add default testing options (content types, etc.) (get them from global config)
- [x] Strong name the package
- [ ] Running() - integration test with fluent API
- [ ] Consider removing instance checking like IContractResolver in JsonSeriallizerSettings
- [ ] Check StringComparer.OrdinalIgnoreCase for session, cache, etc.
- [ ] Configuration should be used from the original project, not the test one
- [ ] Local redirect result may test for route values with the lambda expression call
- [ ] Created and Redirect may use ToController<TController> (required additional route parsing)
- [ ] GetConstructorByUnorderedParameters in Reflection may cache constructors per type and parameters per constructor
- [ ] Mixed dependency resolver - services and per test at once (or WithResolvedDependencyFromServicesFrom)
- [ ] WithResponseModel may show string representations
- [ ] Cache types and type infos where possible
- [ ] Do not call PlatformServices multiple times
- [ ] ActionDescriptor may need better condition to be set from the cache
- [ ] Action call is cached in MVC - check if it can be used
- [ ] Routes can use ToRouteValueOfType methods
- [ ] Figure a way to get the web application name and path (currently it is the test project's)
- [ ] Add From.Services() and From all other options (query, headers, etc.)
- [ ] Add/implement shouldly assertions (add sample)
- [ ] Anonymous types do not have friendly type name and deep equal now working properly
- [ ] TryReplace services should check whether it is replacing any service
- [ ] Values can be shown friendlier in error messages (example: int arrays - 1, 2, 3)
- [ ] Where object to dictionary is used - every method can be enhanced to allow different types depending on the context (headers can allow Header object, cookies - Cookie object)
- [ ] Route values - add of type testing for routes
- [ ] Route value dictionary is ordinal ignore case
- [ ] AndContinueWith - integrate more than one controller
- [ ] Performance test with plugable diagnostics
- [X] Use request services for mocks and where possible
- [ ] Mocked telemetry
- [ ] Optimize service collection extension methods (PrepareForTesting)
- [ ] ToStringValueDictionary may return StringValues
- [ ] Add all ICacheEntry options
- [ ] ShouldHaveLogged testing
- [ ] Ready to use mocks for various services like SignInManager, Files, etc.
- [ ] LocalRedirect may need to be Redirect().ToLocal()
- [ ] Add more defensive programming to the methods
- [ ] MemoryCache and TempData may be scoped service
- [ ] Consider advances expression visitor for the models
- [ ] Optimize service replacement
- [ ] Improve extensibility with public methods of the classes
- [ ] Refactor TestApplication into separate smaller classes
- [ ] Extract Throwers
- [ ] Add OfType to ViewComponentResult
- [ ] ModelState testing should be able to work without model
- [ ] EntityFramework services should consider non DbOptions replacement
- [ ] Unit tests should use TestStartup
- [ ] UriTestBuilder - Passing is not accessible from interfaces
- [ ] Add null checks everywhere possible
- [ ] ShouldHave options
- [ ] ShouldHave service
- [ ] Redirect and Created To method should validate the passed controller
- [ ] Add data providers Passing option for value
- [ ] Request cookies should have easier way of setting
- [ ] Add WithModelState to controller builder
- [ ] Application should be able to be configured manually - plugins for example
- [ ] Add Manual Test sample
- [ ] Add Readme to all separate projects
- [ ] Sorting formatters does not show correct error message (other sortings may have the same issue)
- [ ] Action argument testing
- [ ] ToRouteValue throws null exception when action is not resolved
- [ ] Add unit test with the problematic RouteValueAttribute (uncomment the one which worked)
- [ ] Add IRouter extensibility point in route testing (ITestRouter)
- [ ] Consider running action filters on route test (should be an option) (for controller too)
- [ ] Add EF test for scoped services by using the internal provider option
- [ ] Plugins should be part of the test configuration - should be allowed as strings (consider application parts too)
- [x] Replace Routes to Routing namespace
- [ ] Add Should have service testing
- [ ] Remove TestHelper
- [ ] Refactor Base and And test builders
- [ ] NewAndTestBuilderWithActionResult may not be needed - IAndTestBuilder should be enough
- [ ] Default HTML options in ViewContext - decide what to do with struct values
- [ ] Add IView mock for ViewComponent testing
- [ ] Descriptor caches can use the application model conventions to fill the descriptors faster
- [ ] Separate huge interfaces into partials
- [ ] Clear inner test builders - they should not have ShouldPassFor options
- [ ] Add ITestStartup - allows you to add easily the methods
- [ ] Common exception messages may be from static methods in the exception class itself
- [ ] ActionResults with generics can be optimized by not checking the return type
- [ ] WithNoModel wherever applicable
- [ ] DefaultValue, Null, NotNull do not provide AndAlso - use interface in the AndWith test builder
- [ ] Exception ShouldPassFor should not be in the Abstractions package
- [ ] Add CRUD to the IDbContextBuilder for easier adding of entities
- [ ] ViewBag testing without strings but with dynamic predicate
- [ ] View names may need specific testing - .View() does not check for non null values
- [ ] AndAlso after some of the test builder - ShouldReturn().View().AndAlso().ShouldPassFor()
- [ ] Remove the cast to ActionTestContext in ComponentShouldHaveTestBuilderModelStateExtensions
- [ ] ViewContextMock creates two ModelState dictionaries because the second one cannot be set (maybe setter should apply values like in RouteData)
- [ ] ControllerPropertyHelper may not be needed
- [ ] Think of a way to get TempData and ViewData without type checking (features in the test context for example)
- [ ] Test setups can be separated into different packages
- [ ] GetTempData and GetViewData can look into the component contexts too
- [ ] DataProviders can come from manual method call -> .From(c => c)
- [ ] Remove default configuration and make Startup required
- [ ] Extract test plugin loader
- [ ] Extract Resources files
- [ ] Remove the ApplicationParts workaround for .NET 4.5.1
- [ ] Depend only on strict versions
- [ ] Make every project.json consistent with the others
- [ ] Add copyright to project.json files
- [ ] Fix the version is not valid problem - 1.0.0-*
- [ ] Add JSON schema for the testconfig.json file
- [ ] Add base Startup types and interfaces the developer can use for easier registration of test services
- [ ] Add loading of dependency context from the Startup type when there is base Startup type and interface the developer can use
- [ ] Add sample with Moq (replace MusicStore custom mock)
- [ ] Remove default registered routes and do not allow route testing without Startup file or route builder (should change the usage of IControllerFactory in the ModelBinderActionInvoker)
- [ ] Add Sample with StartsFrom<CustomTestStartup>() which is not from the web assembly itself
- [ ] Add version and branches to the README.md
- [ ] Consider allowing configuring the application without Startup class - MyApplication.Running() (add these to every other static starting point)
- [ ] Multiple ModelState errors for a single key testing
- [ ] WithRouteData action
- [ ] Action results do not have AndAlso for ShouldPassFor
- [ ] NonAnd interfaces may not be needed IAndContentTestBuilder is used everywhere for example
- [ ] Attribute test builder calls twice the search for attributes almost everywhere
- [ ] That equals error message can be from a default value from a validation attribute without providing a magic string
- [ ] Add support for Cookie-based Temp Data
- [ ] Fix unit test names
- [ ] Use collections and fixtures in the unit tests - current implementation is not good because of mmultiple startups in project
- [ ] Move common validators in the services and use them from there (registered through the plugins)
- [ ] Authorize Attribute - Policy and other properties
- [ ] Consider the SkipValidation in TestCounter with something a bit more secure
- [ ] Casts and dynamics can be removed with interfaces not returned by the API
- [ ] Add symbols to Symbols Source and JSON schema for the test config
- [ ] Add http://dotnetapis.com/ to documentation
- [ ] If no base Startup is used, IServiceCollection cannot be resolved
- [ ] Containing error allows should pass for in model state builder (it should be removed)
- [ ] Validation Summary model state test should be able to test only the message without the empty key (use etension method with specified generic parameter)
- [ ] Optimize attribute testing to not instantiate components/call methods