Commit Graph

107 Commits

Author SHA1 Message Date
Kiran Challa 3c694ce77c Movig RequestServicesWebsite to BasicWebsite 2015-12-03 14:42:10 -08:00
Pranav K 017bf1a20f Changes to use moq-netcore 2015-11-25 16:04:04 -08:00
ryanbrandenburg b6f8c523a8 * Remove MvcSample and replace with MvcSandbox 2015-11-23 11:53:48 -08:00
Doug Bunting ff91e796c1 Revert "Fixing tests"
- wrong fix especially now that test encoders work as expected
- touch up `HtmlHelperTest` and `RazorViewTest` since test encoders are now consistent
- remove references to old `Microsoft.Extensions.WebEncoders.Testing` package

This reverts commit a9d5876cd9.
- but leave `FormTagHelperTest` and `ValidationMessageTagHelperTest` cleanup alone

nit: use `string.Empty` in `HtmlHelperLinkGenerationTest`
2015-11-02 09:45:56 -08:00
Doug Bunting c8c0c5303e Remove more `TestHelper` functional tests
- remove tests already thoroughly covered in unit tests
  - #3139 part 2 of 3
- make checks of `<form>` tag helper more consistent with others
  - use a tag helper initializer but testing every variant; covered in unit tests
- remove `MvcStartupTest` and associated web site
  - scenario covered elsewhere
- remove `PrecompilationTest.PrecompiledView_RendersCorrectly()`
  - scenario covered elsewhere and shouldn't do I/O on checked-in files
2015-10-28 16:40:13 -07:00
Pranav K f57e180971 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:53 -07:00
Pranav K 8d7b95655d Removing Autofac dependency 2015-10-03 12:18:19 -07:00
Doug Bunting d03a851ab3 Use `MvcTextFixture` as much as possible
- #3066
  - reduce `TestServer` -> `PhysicalFileProvider` -> `FileSystemWatcher` count enough to run with Core CLR on Linux
- remove use of `HttpClient.DefaultRequestHeaders`; any client change affects other tests
- remove use of `RequestBuilder` class; creates a per-test `HttpClient` and requires the `TestServer`
- updated a few expectations because `CommonTestEncoder` does JavaScript a bit differently
  - "JavaScriptEncode[[...]]" -> "JavaScriptStringEncode[[...]]"
- side benefit: xUnit reports functional tests execute for only ~12.4s; was >30s before this change

Infrastructure: Enhance `MvcTestFixture`
- handle `ConfigureServices()` methods that are not `void`
- handle `Configure(IApplicationBuilder, ILoggerFactory)`
- ensure server is initialized with consistent `CurrentCulture` and `CurrentUICulture`
- add `FilteredDefaultAssemblyProviderFixture<TStartup>` and `MvcEncodedTestFixture<TStartup>`
  - add `MvcTextFixture.AddAdditionalServices()` extension point supporting these

- do not expose the `TestServer`; an anti-pattern for tests to manipulate the server
- update class names to match containing files
- use existing `TestApplicationEnvironment`
  - apply some `MvcTestFixture` improvements to the shared `TestApplicationEnvironment` class
- remove unused methods from `TestHelper`

nits:
- touched-up some leftover `_app` &c declarations to be more explicit and minimize `using`s
- moved statements into correct sections of methods in `RoutingTests`
- removed `TestLoggerFactory` and related classes from `TagHelperSampleTest`
2015-09-15 10:18:27 -07:00
N. Taylor Mullen 4fb2053f34 Update project.json to have warningsAsErrors accept a bool. 2015-09-02 15:35:13 -07:00
Pranav K 05226a4a55 Refactor ICompilerCache to be instantiated via ICompilerCacheProvider
Fixes #2933
2015-08-20 10:54:32 -07:00
sornaks b6a109e2a3 Making DefaultDisplayTemplates and DefaultEditorTemplates use IHtmlContent.
- Making TagBuilder's InnerHtml an IHtmlContent.
- Delay encoding until the content is written.
- Moving BufferedHtmlContent to Common cos it is used in aspnet/Razor also.
- Changing GenerateOption to take in a string and create StringHtmlContent.
- This reduces the space used by around 13%.
2015-08-10 14:55:34 -07:00
Pranav K 43e4870fa2 Switching to the official Autofac package. 2015-08-04 15:12:19 -07:00
Tugberk Ugurlu 81f8b3edfb removed packExclude from unnecessary places, replaced it with
publishExclude and removed kproj and xproj excludes
2015-07-20 16:49:59 -07:00
Ryan Nowak e985fa5d42 Split up MVC.Extensions into smaller packages
Startup.cs API experience to follow in a separate change. This change just
gets the bulk of the code churn out of the way.
2015-07-06 23:41:22 -07:00
Ryan Nowak 2f554c4b29 Use new antiforgery package 2015-06-25 14:45:00 -07:00
Kirthi Krishnamraju 74b193b15d Added configurable option for LanguageViewLocationExpander to use subfolder or suffix 2015-06-08 12:07:49 -07:00
Doug Bunting 261975b0bc Rename `MvcTagHelpersWebSite` to `HtmlGenerationsWebSite`
- name was too specific and I am about to add another HTML helper scenario
2015-06-05 20:30:17 -07:00
Doug Bunting ffd1dc1fb0 Add support for generating baseline output files while testing
- baselines include both expected output and design-time line mappings
- controlled by GENERATE_BASELINES
 - assertions related to file content are not checked in this mode
- add design-time test of Basic.cshtml to `MvcRazorHostTest`
- regenerate all files to avoid BOM and blank line noise in future PRs
 - update out-of-date design-time Basic.cs file

nits:
- make a few variable names more consistent
- make `Assembly` fields `static`
- remove unused `_resourcesAssembly` field from `ErrorPageTests`
- remove `ResourceHelpers` which was specific to functional tests
2015-06-01 13:13:39 -07:00
Kirthi Krishnamraju 78033fda1f fix build break 2015-05-21 11:25:03 -07:00
Kirthi Krishnamraju 337bbad51d React to aspnet/Configuration #195,#198 and fix few minor build break issues 2015-05-20 20:01:23 -07:00
Kirthi Krishnamraju e48565dcd8 Adding errors in ModelState 2015-04-22 13:44:09 -07:00
N. Taylor Mullen 88dc5f73ac Update project.json, code=>compile. Also remove **/*.cs and **/*.vs from compile section. These are now defaulted to on. 2015-04-02 16:17:54 -07:00
Doug Bunting 5882cdb03f MVC portion of aspnet/Razor#335
- set correct `MarkAsHtmlEncodedMethodName` value in `MvcRazorHost`
- handle `HtmlString` values in `TagHelperOutput.Attributes` in `RazorPage`
 - special-case double-quotes in `HtmlString` values
 - add `static WriteTo()` method for use in tag helpers
- handle non-`string` `output.Attributes` values in tag helpers
- make `TagHelperContentWrapperTextWriter` a `public` class
- provide a `TagHelperContent.Append(object, ...)` extension method
- add `LinkTagHelper.Href` and `ScriptTagHelper.Src` properties
 - avoid Razor HTML-encoding these attribute values before their use
- add `JavaScriptEncoder` properties in `LinkTagHelper` and `ScriptTagHelper`
 - allow encoding testing without unit testing the default encoder
- handle MVC and Razor changes for this bug in existing tests
- add functional tests of encodings
- add test encoders to TestCommon project

nits:
- correct `InputTagHelper` to pass `type=""` through unchanged
- set correct `TagHelperContentTypeName` value in `MvcRazorHost`
- remove unnecessary `FormTagHelper.Method` and `OptionTagHelper.Selected` properties
- remove complex ternaries and `ShouldAddFileVersion()` methods
- add a few debug assertions
- fix some odd wrapping
- remove or `#if`-out unused `using`s
- remove trailing whitespace
2015-03-30 10:54:00 -07:00
Doug Bunting 1dafff4fb9 Reenable Core functional tests
- this reverts commit 2d304e5
2015-03-24 13:43:57 -07:00
Doug Bunting 2d304e5da1 Disable Core functional tests (again)
- avoid System.Private.DataContractSerialization problem
2015-03-24 10:14:15 -07:00
Kiran Challa 90773ab925 Enabled coreclr for functional tests and reverted back previous change to skipped tests.
- skipped a new test. This is a known issue that I have reported to the respective team.
- This also fixes #1987 : Investigate xml serializer test failures in Core CLR
2015-03-21 23:21:53 -07:00
Harsh Gupta 015edefa96 Cors Support in MVC. 2015-03-18 19:37:00 -07:00
N. Taylor Mullen 385fa29407 Update xunit.runner.kre => xunit.runner.aspnet. 2015-03-12 18:01:41 -07:00
Doug Bunting cc7b319cb7 Remove use of `ServiceDescriber` in MVC and cleanup related hacks
- see issues aspnet/DependencyInjection#193 and #1612
- use `TryAdd()` in `MvcServices` for the `IAssemblyProvider`

Move `ApplicationBasePath` handling into `RazorPreCompileModule`
- restores view precompilation in functional tests of sample sites
- if we need this, others will as well
- override `IApplicationEnvironment` but get folder from `ProjectContext`
 - also remove remaining `IServiceProvider` implementations in this code

test fixes:
- simplify `IApplicationEnvironment` override
- move override logic into `TestHelper.CreateServer()` methods
- remove `LoggerFactory` setup
 - does not seem to require special-casing
- remove unused `ITestConfigurationProvider` / `TestConfigurationProvider`
- remove `TestAssemblyProvider` classes
 - no longer required
- remove `ReplaceCallContextServiceLocationService` test helper
 - change MVC sample to fully-qualify config.json path
  - avoids `ReplaceCallContextServiceLocationService` need in `MvcSampleTests`
 - no longer required for other tests

nit: remove unused `_serviceProvider` and constructor overload in `RazorPreCompiler`
2015-03-10 22:25:42 -07:00
Ajay Bhargav Baaskaran db728cd386 Introducing TempData
- Issue #455
 - Updated MVC sample
 - Added relevant tests
2015-03-10 12:04:05 -07:00
Doug Bunting e7ee4278a5 Correct case of web site folder and project names
- work around aspnet/DNX#1361 and inconsistent dev boxes (from previous fix attempts)
 - had inconsistent case in test/WebSites and test/WebSites/ConnegWebSite
- ConnegWebsite -> ContentNegotiationWebSite
- RazorInstrumentationWebsite -> RazorPageExecutionInstrumentationWebSite
- RazorViewEngineOptionsWebsite -> RazorEmbeddedViewsWebSite

nits:
- sort dependencies in functional test project.json
- correct a few readme.md files
2015-03-10 09:34:06 -07:00
N. Taylor Mullen 1d578ca2fd Remove BOM from project.json, *.cmd, *.sh and *.shade files. 2015-03-09 12:56:42 -07:00
N. Taylor Mullen e829ba7646 Update aspnet50/aspnetcore50 => dnx451/dnxcore50. 2015-03-08 12:52:24 -07:00
Mugdha Kulkarni 4f0ba26c79 Adding the test cases for generating lower case URLs 2015-02-20 15:50:58 -08:00
Pranav K e797b0af51 Disable functional tests in CoreCLR until System.Runtime.Dynamic issue is sorted out 2015-02-20 08:36:16 -08:00
Ryan Nowak d2aa55893d Functional tests for #302
This feature allows routing to generate a link when the action that is
being linked-to does not yet exist. See the PR in routing for the actual
implementation changes. This PR just has a simple functional test for the
scenario.
2015-02-16 17:59:31 -08:00
Pranav K 5e69d90076 * Modify DefaultControllerTypeProvider to look at the object graph to
determine if any ancestor has the "Controller" suffix.

* Introduce NonControllerAttribute to opt out of Controller detection.

Fixes #1274
2015-02-15 22:11:37 -08:00
Pranav K e1e43e1e8c ControllerActivator should be able to use controllers registered as
services

* Added WithControllersFromServiceProvider that replaces the default
  controller activator with a service based one.
* Move activation to DefaultControllerFactory
* Modify [Activate] behavior so that it no longer activates services. Use
  [FromService] attribute to hydrate services

Fixes #1707
2015-02-11 16:41:59 -08:00
Kiran Challa 4ecbe8c709 [Fixes #1065] Need a way to specify "just type" with produces 2015-02-09 10:46:24 -08:00
Kiran Challa 2e938a51f8 [Fixes #1878] Investigate Xml formatters tests failures on Windows 2008 R2 OS 2015-02-06 13:23:12 -08:00
Pranav K 59db8143da Updating CompilerCache to use IMemoryCache and file system watcher to
expire files in razor file cache.

Add a functional test to ensure the compiler cache does not get
initialized until the first request to a View.

Fixes #1708
2015-02-05 09:52:17 -08:00
Mugdha Kulkarni addd8dd5d2 Changing produces and format filter interaction 2015-01-31 23:18:18 -08:00
Mugdha Kulkarni c8b911b596 Adding functional tests and attribute route tests.
Incorporating PR coments.
2015-01-31 23:15:13 -08:00
Kirthi Krishnamraju cbed666cba Added functionaltests for ModelMetadataType attribute and moved TryValidateModel tests actions to ValidationWebSite 2015-01-27 15:56:49 -08:00
Kiran Challa 5c2dc5db11 [Fixes#1792]Separate XML serializers to Microsoft.AspNet.Mvc.Xml 2015-01-22 15:09:20 -08:00
Harsh Gupta 60fa4a6f45 Adding Support for consumes.
Consumes has overriding behavior and the one closest to action wins.
2015-01-16 14:15:08 -08:00
David Fowler 90f2ece84d Work around dependency resolution problem 2015-01-16 03:01:51 -08:00
sornaks 262bb9a732 Changes introducing ResponseCache to cache content in the client/proxy. 2015-01-15 16:51:22 -08:00
Ryan Nowak 623b733eaa Adding a sample (test) for using custom IRouter implementation with MVC
This is a demonstration of how to inject an IRouter in between traditional
routes and MVC's handler. This allows you to accomplish a variety of
things that were possible with WebAPIs handlers, but inside the routing
system.

The example here turns a header representing the user into a locale, which
is used to select a controller. You could do other things like reject the
route match or change link generation.

There is one subtle project change here, to allow the same to be possible
for attribute routing, we need to create the attribute route after running
the user's routing configuration code.
2015-01-15 16:31:21 -08:00
Pranav K b7d44666b8 Adding support for flowing compilation errors to Diagnostics middleware
Fixes #872
2015-01-13 07:32:58 -08:00