Skip to content

Commit

Permalink
Merge pull request #48 from mule/development
Browse files Browse the repository at this point in the history
Release 0.9.4 (hopefully and finally)
  • Loading branch information
mule authored Sep 23, 2023
2 parents ca920c9 + 30db3f1 commit edf767f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
14 changes: 0 additions & 14 deletions BlazorAppTests/Components/CultureSelectorTests.razor

This file was deleted.

25 changes: 18 additions & 7 deletions BlazorComponentTests/CultureSelectorTests.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
@using FluentAssertions
@using System.Globalization
@using Abotti.BlazorComponents
@using Xunit.Abstractions
@inherits TestContext
@inject ITestOutputHelper OutputHelper

@code
{
private bool commonSetupExecuted;
private bool _commonSetupExecuted;


private readonly CultureInfo[] _supportedCultures =
{
Expand All @@ -16,11 +19,11 @@

public void SetUp()
{
if (!commonSetupExecuted)
if (!_commonSetupExecuted)
{
Services.AddLocalization();

commonSetupExecuted = true;
_commonSetupExecuted = true;
}
}

Expand All @@ -37,9 +40,10 @@

// Assert
var cultureSelection = cut.FindAll("option");
cultureSelection.Count.Should().Be(2);
cultureSelection.Count.Should().Be(3);
cultureSelection[0].Attributes["value"].Value.Should().Be(_supportedCultures[0].Name);
cultureSelection[1].Attributes["value"].Value.Should().Be(_supportedCultures[1].Name);
cultureSelection[2].Attributes["value"].Value.Should().Be(_supportedCultures[2].Name);
}

[Fact]
Expand Down Expand Up @@ -84,8 +88,15 @@
var cut = Render(@<CultureSelector CurrentCulture="CultureInfo.CurrentCulture" SupportedCultures="_supportedCultures"/>);

// Assert
var selectedOption = cut.Find("option[selected]");
var selectedValue = selectedOption.GetAttribute("value");
selectedValue.Should().Be(CultureInfo.CurrentCulture.Name);
try
{
var selectedOption = cut.Find("option[selected]");
var selectedValue = selectedOption.GetAttribute("value");
selectedValue.Should().Be(CultureInfo.CurrentCulture.Name);
}
catch (Exception e)
{
OutputHelper?.WriteLine(cut.Markup);
}
}
}

0 comments on commit edf767f

Please sign in to comment.