Skip to content

Commit

Permalink
Add collection expression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Mar 8, 2024
1 parent 868dab4 commit 1125169
Showing 1 changed file with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@


Check warning on line 1 in Tests/Singulink.Globalization.Currency.Tests/MoneySetTests/CollectionExpressions.cs

View workflow job for this annotation

GitHub Actions / debug-windows

Check warning on line 1 in Tests/Singulink.Globalization.Currency.Tests/MoneySetTests/CollectionExpressions.cs

View workflow job for this annotation

GitHub Actions / debug-windows

Check failure on line 1 in Tests/Singulink.Globalization.Currency.Tests/MoneySetTests/CollectionExpressions.cs

View workflow job for this annotation

GitHub Actions / release-windows

Check failure on line 1 in Tests/Singulink.Globalization.Currency.Tests/MoneySetTests/CollectionExpressions.cs

View workflow job for this annotation

GitHub Actions / release-windows

namespace Singulink.Globalization.Tests.MoneySetTests;

[PrefixTestClass]
public class CollectionExpressions
{
private static readonly ImmutableArray<Money> SetValues = [Money.Create(123, "USD"), Money.Create(456, "EUR"), Money.Create(789, "JPY")];

[TestMethod]
public void CreateMoneySet()
{
MoneySet set = [..SetValues];
set.ShouldBe(SetValues, ignoreOrder: true);
}

[TestMethod]
public void CreateSortedMoneySet()
{
SortedMoneySet set = [.. SetValues];
set.ShouldBe(SetValues, ignoreOrder: true);
}

[TestMethod]
public void CreateImmutableMoneySet()
{
ImmutableMoneySet set = [.. SetValues];
set.ShouldBe(SetValues, ignoreOrder: true);
}

[TestMethod]
public void CreateImmutableSortedMoneySet()
{
ImmutableSortedMoneySet set = [.. SetValues];
set.ShouldBe(SetValues, ignoreOrder: true);
}

[TestMethod]
public void CreateIReadOnlyMoneySet()
{
IReadOnlyMoneySet set = [.. SetValues];
set.ShouldBeOfType<MoneySet>();
set.ShouldBe(SetValues, ignoreOrder: true);
}

[TestMethod]
public void CreateIMoneySet()
{
IMoneySet set = [.. SetValues];
set.ShouldBeOfType<MoneySet>();
set.ShouldBe(SetValues, ignoreOrder: true);
}

[TestMethod]
public void CreateIImmutableMoneySet()
{
IImmutableMoneySet set = [.. SetValues];
set.ShouldBeOfType<ImmutableMoneySet>();
set.ShouldBe(SetValues, ignoreOrder: true);
}
}

0 comments on commit 1125169

Please sign in to comment.