-
-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Description
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");
}
Component under test
<RowTemplate>
<MudTd DataLabel="Station">5,4</MudTd>
<MudTd DataLabel="Drop ID">43,3</MudTd>
<MudTd DataLabel="Force">50,4</MudTd>
<MudTd DataLabel="Stress">32,08</MudTd>
</RowTemplate>
Results in this output (Locally):

Results in this output (Azure):

Version info:
- bUnit version: 1.18.4
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));
Metadata
Metadata
Assignees
Labels
No labels