Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RemyDuijkeren committed Jan 20, 2025
1 parent be10f96 commit e05c445
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Packages on this feed are alpha and beta and, while they've passed all our tests
For support, bugs and new ideas use [GitHub issues](https://github.com/remyvd/NodaMoney/issues). Please see our
[guidelines](CONTRIBUTING.md) for contributing to the NodaMoney.

[![NuGet](https://img.shields.io/nuget/v/NodaMoney.svg?logo=nuget)](https://www.nuget.org/packages/NodaMoney)
[![NuGet](https://img.shields.io/nuget/dt/NodaMoney.svg?logo=nuget)](https://www.nuget.org/packages/NodaMoney)
![CI](https://github.com/RemyDuijkeren/NodaMoney/actions/workflows/ci.yml/badge.svg)
[![GitHub NuGet](https://img.shields.io/github/v/tag/RemyDuijkeren/NodaMoney?label=GitHub%20nuget&logo=github)](https://github.com/RemyDuijkeren/NodaMoney/packages)
[![NuGet](https://img.shields.io/nuget/v/NodaMoney.svg?logo=nuget)](https://www.nuget.org/packages/NodaMoney)
[![Pre-release NuGet](https://img.shields.io/github/v/tag/RemyDuijkeren/NodaMoney?label=pre-release%20nuget&logo=github)](https://github.com/users/RemyDuijkeren/packages/nuget/package/NodaMoney)
[![CI](https://github.com/RemyDuijkeren/NodaMoney/actions/workflows/ci.yml/badge.svg)](https://github.com/RemyDuijkeren/NodaMoney/actions/workflows/ci.yml)

See [http://www.nodamoney.org/](http://www.nodamoney.org/) for more information about this project or below.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void WhenBuild_ShouldNotBeRegistered()
builder.Build();

// Act
Action action = () => Currency.FromCode("BTA");
Action action = () => CurrencyInfo.FromCode("BTA");

// Assert
action.Should().Throw<InvalidCurrencyException>().WithMessage("*unknown*currency*");
Expand All @@ -44,11 +44,11 @@ public void WhenBuild_ShouldNotBeRegistered()
public void WhenRegister_ShouldBeRegistered()
{
// Arrange
CurrencyInfoBuilder builder = new("BTA");
CurrencyInfoBuilder builder = new("BTZ");
CurrencyInfo result = builder.Register();

// Act
CurrencyInfo ci = CurrencyInfo.FromCode("BTA");
CurrencyInfo ci = CurrencyInfo.FromCode("BTZ");

// Assert
ci.Should().BeEquivalentTo(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void AddOperator_WhenAddWithDifferentCurrency_ThrowException(decimal valu

Action action = () => { var result = money1 + money2; };

action.Should().Throw<InvalidCurrencyException>().WithMessage("The requested operation expected the currency*");
action.Should().Throw<InvalidCurrencyException>().WithMessage("Currency mismatch*");
}

[Theory, MemberData(nameof(TestData))]
Expand All @@ -177,7 +177,7 @@ public void AddMethod_WhenAddWithDifferentCurrency_ThrowException(decimal value1

Action action = () => Money.Add(money1, money2);

action.Should().Throw<InvalidCurrencyException>().WithMessage("The requested operation expected the currency*");
action.Should().Throw<InvalidCurrencyException>().WithMessage("Currency mismatch*");
}

[Theory, MemberData(nameof(TestData))]
Expand All @@ -188,7 +188,7 @@ public void AddOperator_WhenSubtractWithDifferentCurrency_ThrowException(decimal

Action action = () => { var result = money1 - money2; };

action.Should().Throw<InvalidCurrencyException>().WithMessage("The requested operation expected the currency*");
action.Should().Throw<InvalidCurrencyException>().WithMessage("Currency mismatch*");
}

[Theory, MemberData(nameof(TestData))]
Expand All @@ -199,7 +199,7 @@ public void SubtractMethod_WhenSubtractWithDifferentCurrency_ThrowException(deci

Action action = () => Money.Subtract(money1, money2);

action.Should().Throw<InvalidCurrencyException>().WithMessage("The requested operation expected the currency*");
action.Should().Throw<InvalidCurrencyException>().WithMessage("Currency mismatch*");
}
#pragma warning restore xUnit1026 // Theory methods should use all of their parameters
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void WhenCurrencyIsDifferent_ThenComparingShouldFail()
{
Action action = () => _tenEuro1.CompareTo(_tenDollar);

action.Should().Throw<InvalidCurrencyException>().WithMessage("The requested operation expected the currency*");
action.Should().Throw<InvalidCurrencyException>().WithMessage("Currency mismatch*");
}

[Fact]
Expand All @@ -117,4 +117,4 @@ public void WhenComparingToString_ThenComparingShouldFail()

action.Should().Throw<ArgumentException>().WithMessage("obj is not the same type as this instance*");
}
}
}

0 comments on commit e05c445

Please sign in to comment.