exchanger/tests/Exchanger.Tests/CardCustomAmountDisplayFormatterTests.cs

44 lines
1.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Exchanger.Scenes.CardCustomAmountScreen;
using NUnit.Framework;
namespace Exchanger.Tests;
[TestFixture]
public sealed class CardCustomAmountDisplayFormatterTests
{
[Test]
public void Format_SeparatesZeroInputFromTokenSummary()
{
CardCustomAmountDisplayText result = CardCustomAmountDisplayFormatter.Format(
TestSettings.Create().Pricing,
0);
using (Assert.EnterMultipleScope())
{
Assert.That(result.InputAmount, Is.EqualTo("0"));
Assert.That(result.BaseTokens, Is.EqualTo("0 ЖЕТОНОВ"));
Assert.That(result.BonusTokens, Is.EqualTo("БЕЗ БОНУСА"));
}
}
[TestCase(100, "100", "10 ЖЕТОНОВ", "+ 2 ЖЕТОНА\nВ ПОДАРОК")]
[TestCase(500, "500", "50 ЖЕТОНОВ", "+ 15 ЖЕТОНОВ\nВ ПОДАРОК")]
public void Format_UsesInputFieldAndTokenOnlySummary(
int amount,
string expectedInput,
string expectedBaseTokens,
string expectedBonusTokens)
{
CardCustomAmountDisplayText result = CardCustomAmountDisplayFormatter.Format(
TestSettings.Create().Pricing,
amount);
using (Assert.EnterMultipleScope())
{
Assert.That(result.InputAmount, Is.EqualTo(expectedInput));
Assert.That(result.BaseTokens, Is.EqualTo(expectedBaseTokens));
Assert.That(result.BonusTokens, Is.EqualTo(expectedBonusTokens));
}
}
}