From 6b73892e78d5132c4e5b2b2da527a0853cbd23a2 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 15 Mar 2018 13:25:52 +0000 Subject: [PATCH] Avoid culture assumption in SupportsTwoWayBindingForDateValuesWithFormatString test. Fixes #268 --- .../RenderingRazorIntegrationTest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs index 8d069059b2..942d83e312 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs @@ -351,8 +351,9 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test public void SupportsTwoWayBindingForDateValuesWithFormatString() { // Arrange/Act + var testDateFormat = "ddd yyyy-MM-dd"; var component = CompileToComponent( - @" + @" @functions { public DateTime MyDate { get; set; } = new DateTime(2018, 3, 4); }"); @@ -362,7 +363,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test var frames = GetRenderTree(component); Assert.Collection(frames, frame => AssertFrame.Element(frame, "input", 3, 0), - frame => AssertFrame.Attribute(frame, "value", "Sun 2018-03-04", 1), + frame => AssertFrame.Attribute(frame, "value", new DateTime(2018, 3, 4).ToString(testDateFormat), 1), frame => { AssertFrame.Attribute(frame, "onchange", 2); @@ -370,7 +371,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test // Trigger the change event to show it updates the property ((UIEventHandler)frame.AttributeValue)(new UIChangeEventArgs { - Value = "Mon 2018-03-05" + Value = new DateTime(2018, 3, 5).ToString(testDateFormat) }); Assert.Equal(new DateTime(2018, 3, 5), myDateProperty.GetValue(component)); },