Commit Graph

16 Commits

Author SHA1 Message Date
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
Doug Bunting 35d176f5b2 Update DNX Core on Linux workarounds
- remove skip conditions for aspnet/External#33, aspnet/External#41, aspnet/External#42, aspnet/External#43
- add workaround for aspnet/External#47; avoid "g" custom datetime format specifier
- make tag helper execution order determinate in `TagHelpersWebSite`

Will test DNX Core in Travis builds (use `--test-dnxcore`) once aspnet/Universe#290 fix is in.

nits:
- remove useless `using`s for `Microsoft.AspNet.Razor.TagHelpers`
2015-10-10 23:09:51 -07:00
Pranav K f57e180971 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:53 -07:00
Doug Bunting 895258d550 Work around aspnet/External#33, aspnet/External#41, aspnet/External#42, and aspnet/External#43
- do not run tests that hit known issues with Core CLR on Linux
2015-09-20 21:42:12 -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
Daniel Lo Nigro a2e53e8d1a Explicitly check if URI is file when checking for an absolute URI 2015-09-01 16:33:00 -07:00
Ryan Nowak 9d89a8cac3 Homogenize MVC startup code patterns
Use builder APIS for both AddMvc() and AddMvcCore()
Change various API patterns to all use .AddXyz(...) off of one or both of
these builders.
2015-08-16 18:48:24 -07:00
Ryan Nowak 07fabde92a Part 3 of #2776 - revert a6ce9abab1 and add
some more tests.

This change reverts the behavior change from
a6ce9abab1 and adds more tests around the
scneario that was actually broken.

The right behavior is that unconvertable values result in a validation
error. There's no special behavior around value types and required values.
2015-08-16 16:20:44 -07:00
Ryan Nowak a6ce9abab1 Fix #2776 - Add implicit [BindRequired] for value type properties 2015-08-13 15:35:54 -07:00
Ryan Nowak 12ceb6ae1c React to DI namespace change part 3. 2015-08-11 15:44:47 -07:00
Ajay Bhargav Baaskaran e4049c07eb Razor boolean and null attribute special case handled correctly
- Issue #2769
 - Special case is only applied to null and bool value with no surrounding
   whitespace
2015-07-30 10:37:38 -07:00
Ajay Bhargav Baaskaran 92f3e21fe6 Fix: Metadata ignored for non model-specific EditorTemplate
Issue - #2778
2015-07-16 15:48:01 -07:00
sornaks 68523a3550 Fixing tests in Mono.
- Disabling tests which have corresponding bugs in mono.
- Fixing a few tests which do not handle *nix file system.
- Updating Travis configuration to use mono's alpha bits.
- Introducing PlatformNormalizer to normalize content across multiple platforms.
2015-07-02 17:24:14 -07:00
Ryan Nowak 2f554c4b29 Use new antiforgery package 2015-06-25 14:45:00 -07:00
Doug Bunting 9c63d1d842 Get tests working with `core.autocrlf=false`
- #1514
- refactor `RazorCompilationService` to allow a test subclass that normalizes Razor file line endings
 - add `TestRazorCompilationService` to `RazorPageExecutionInstrumentationWebSite`
 - adjust line endings to match in `RazorPageExecutionInstrumentationTest`
- add `ignoreLineEndingDifferences: true` to `Assert.Equal()` calls
 - responses on Windows can have a mix of line endings
  - `git config` setting affects line endings in .cshtml (and baseline) files
  - however MVC and Razor mix `Environment.NewLine`s into HTTP responses
- update `PrecompilationTest` to split response regardless of line endings
- update `ResourceFile` to normalize all source file streams to LF only
 - ensures consistent checksums and line mappings
 - change `MvcRazorHostTest` to expect new line mappings
 - recreate baseline files to expect new checksums and literal line endings
- use verbatim strings in affected tests
 - careful use of `Environment.NewLine` in expectations is now just noise

nits:
- add doc comments in `RazorCompilationService`
- correct `TagHelpersTest` name to match containing file
- avoid incorrect `using` removal when `GENERATE_BASELINES` is not defined
- remove unnecessary `ResourceFile` normalization of output files
2015-06-24 14:53:07 -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