Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
Use stable locale when testing date/time formats
Browse files Browse the repository at this point in the history
- `CultureReplacerMiddleware` no longer helping `RazorWebSite`
 - regressed with @30d11a8
- `[ReplaceCulture]` sets up the correct culture early enough for consistent formatting
- remove `CultureReplacerMiddleware` from `RazorWebSite`
 - only `Startup` class we have that used this with `RequestLocalizationMiddleware`
 - testing `RequestLocalizationMiddleware`; so remove the confusing extra middleware
  • Loading branch information
dougbu committed Jun 5, 2015
1 parent bd03571 commit cda2c67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Testing;
using Microsoft.Framework.DependencyInjection;
using RazorWebSite;
using Xunit;
Expand Down Expand Up @@ -50,6 +51,7 @@ public async Task AppWideDefaultsInViewAndPartialView()
}

[Fact]
[ReplaceCulture]
public async Task OverrideAppWideDefaultsInViewAndPartialView()
{
// Arrange
Expand All @@ -60,7 +62,7 @@ public async Task OverrideAppWideDefaultsInViewAndPartialView()
<ValidationInView class=""field-validation-error"" data-valmsg-for=""Error"" data-valmsg-replace=""true"">An error occurred.</ValidationInView>
<input id=""Prefix!Property1"" name=""Prefix.Property1"" type=""text"" value="""" />
<div class=""editor-label""><label for=""MyDate"">MyDate</label></div>
<div class=""editor-field""><input class=""text-box single-line"" data-val=""true"" data-val-required=""The MyDate field is required."" id=""MyDate"" name=""MyDate"" type=""datetime"" value=""1/2/2000 3:04:05 AM &#x2B;00:00"" /> <ValidationInView class=""field-validation-valid"" data-valmsg-for=""MyDate"" data-valmsg-replace=""true""></ValidationInView></div>
<div class=""editor-field""><input class=""text-box single-line"" data-val=""true"" data-val-required=""The MyDate field is required."" id=""MyDate"" name=""MyDate"" type=""datetime"" value=""02/01/2000 03:04:05 &#x2B;00:00"" /> <ValidationInView class=""field-validation-valid"" data-valmsg-for=""MyDate"" data-valmsg-replace=""true""></ValidationInView></div>
True
Expand All @@ -70,7 +72,7 @@ public async Task OverrideAppWideDefaultsInViewAndPartialView()
<ValidationInPartialView class=""field-validation-error"" data-valmsg-for=""Error"" data-valmsg-replace=""true"">An error occurred.</ValidationInPartialView>
<input id=""Prefix!Property1"" name=""Prefix.Property1"" type=""text"" value="""" />
<div class=""editor-label""><label for=""MyDate"">MyDate</label></div>
<div class=""editor-field""><input class=""text-box single-line"" id=""MyDate"" name=""MyDate"" type=""datetime"" value=""1/2/2000 3:04:05 AM &#x2B;00:00"" /> <ValidationInPartialView class=""field-validation-valid"" data-valmsg-for=""MyDate"" data-valmsg-replace=""true""></ValidationInPartialView></div>
<div class=""editor-field""><input class=""text-box single-line"" id=""MyDate"" name=""MyDate"" type=""datetime"" value=""02/01/2000 03:04:05 &#x2B;00:00"" /> <ValidationInPartialView class=""field-validation-valid"" data-valmsg-for=""MyDate"" data-valmsg-replace=""true""></ValidationInPartialView></div>
True";

Expand Down
2 changes: 0 additions & 2 deletions test/WebSites/RazorWebSite/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public void ConfigureServices(IServiceCollection services)

public void Configure(IApplicationBuilder app)
{
app.UseCultureReplacer();

app.UseRequestLocalization();

// Add MVC to the request pipeline
Expand Down

0 comments on commit cda2c67

Please sign in to comment.