You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decimal separator inconsistency (MarkupMatches) causes test failure when pushed to Azure #1011
The bug is related to a difference in decimal separators between the local environment and Azure. When running a test that expects a comma as a decimal separator, the test fails when pushed to Azure, which requires a point as the decimal separator. This causes the test to produce an error message indicating a difference near ".4" in the expected value "5,4". To reproduce this issue, follow these steps:
Run the test locally and ensure that it passes.
Push the test to Azure and run it.
Observe that the test fails with an error message indicating a difference near ".4" in the expected value "5,4".
Example:
[Test]
public void ComponentShouldGetDropSequence()
{
// Act
var component = RenderComponent<FwdBlazorApp.Pages.DataViewer.DataViewer>
(parameters=>parameters.AddCascadingValue(RenderComponent<MainLayout>().Instance));
// Assert
component.FindAll("td")[0].TextContent.MarkupMatches("5,4");
component.FindAll("td")[1].TextContent.MarkupMatches("43,3");
component.FindAll("td")[2].TextContent.MarkupMatches("50,4");
component.FindAll("td")[3].TextContent.MarkupMatches("32,08");
}
Workaround:
Although there is a workaround available, it is not an optimal solution. As such, it would be prudent to address the underlying issue with MarkupMatches() to fully resolve the bug.
var td3 = component.FindAll("td")[0].TextContent;
Assert.That(Convert.ToDouble(td3),Is.EqualTo(5.4));
var td4 = component.FindAll("td")[1].TextContent;
Assert.That(Convert.ToDouble(td4),Is.EqualTo(43.3));
var td5 = component.FindAll("td")[2].TextContent;
Assert.That(Convert.ToDouble(td5),Is.EqualTo(50.4));
var td6 = component.FindAll("td")[3].TextContent;
Assert.That(Convert.ToDouble(td6),Is.EqualTo(32.08));
Activity