btcpay-plugin/BTCPayServer.Plugins.UnitTests/Lethean/Utils/LetheanMoneyTests.cs
Claude a3869db496
rebrand(lethean): update branding, ports, and config for Lethean blockchain
- Coin: Zano → Lethean, ticker: ZAN/ZANO → LTHN
- Ports: 11211 → 36941 (mainnet RPC), 46941 (testnet RPC)
- Wallet: 11212 → 36944/46944
- Address prefix: iTHN
- URLs: zano.org → lethean.io
- Explorer links: explorer.lthn.io

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:24:13 +01:00

47 lines
No EOL
1.7 KiB
C#

using System.Globalization;
using BTCPayServer.Plugins.Lethean.Utils;
using Xunit;
namespace BTCPayServer.Plugins.UnitTests.Lethean.Utils
{
public class LetheanMoneyTests
{
[Trait("Category", "Unit")]
[Theory]
[InlineData(1, "0.000000000001")]
[InlineData(123456789012, "0.123456789012")]
[InlineData(1000000000000, "1.000000000000")]
public void Convert_LongToDecimal_ReturnsExpectedValue(long atomicUnits, string expectedString)
{
decimal expected = decimal.Parse(expectedString, CultureInfo.InvariantCulture);
decimal result = LetheanMoney.Convert(atomicUnits);
Assert.Equal(expected, result);
}
[Trait("Category", "Unit")]
[Theory]
[InlineData("0.000000000001", 1)]
[InlineData("0.123456789012", 123456789012)]
[InlineData("1.000000000000", 1000000000000)]
public void Convert_DecimalToLong_ReturnsExpectedValue(string letheanString, long expectedAtomicUnits)
{
decimal lethean = decimal.Parse(letheanString, CultureInfo.InvariantCulture);
long result = LetheanMoney.Convert(lethean);
Assert.Equal(expectedAtomicUnits, result);
}
[Trait("Category", "Unit")]
[Theory]
[InlineData(1)]
[InlineData(123456789012)]
[InlineData(1000000000000)]
public void RoundTripConversion_LongToDecimalToLong_ReturnsOriginalValue(long atomicUnits)
{
decimal lethean = LetheanMoney.Convert(atomicUnits);
long convertedBack = LetheanMoney.Convert(lethean);
Assert.Equal(atomicUnits, convertedBack);
}
}
}