Skip to content

Commit

Permalink
Add missing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Jan 24, 2024
1 parent 8617f9e commit a71212c
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion specs/Qowaiv.Specs/Financial/Amount_specs.cs
Expand Up @@ -136,7 +136,39 @@ public void throws_for_invalid_json(object json, Type exceptionType)
.And.Should().BeOfType(exceptionType);
}

public class Has_operators
public class Casts_explicit
{
public class From
{
[Test]
public void Int32() => ((Amount)42).Should().Be(42.Amount());

[Test]
public void Int64() => ((Amount)42L).Should().Be(42.Amount());

[Test]
public void Decimal() => ((Amount)42.0m).Should().Be(42.Amount());

[Test]
public void Double() => ((Amount)42.0).Should().Be(42.Amount());
}

public class To
{
[Test]
public void Int32() => ((int)42.Amount()).Should().Be(42);

[Test]
public void Int64() => ((long)42.Amount()).Should().Be(42L);

[Test]
public void Decimal() => ((decimal)42.Amount()).Should().Be(42m);

[Test]
public void Double() => ((double)42.Amount()).Should().Be(42.0);
}

public class Has_operators
{
[Test]
public void to_divide_amount_by_amount_as_decimal()
Expand Down

0 comments on commit a71212c

Please sign in to comment.