37 lines
1005 B
C#
37 lines
1005 B
C#
using NUnit.Framework;
|
|
using NightclubArcadia.Skills;
|
|
|
|
namespace NightclubArcadia.Skills.Tests
|
|
{
|
|
public class DcBandTests
|
|
{
|
|
[TestCase("routine", 11)]
|
|
[TestCase("ROUTINE", 11)]
|
|
[TestCase("trivial", 8)]
|
|
[TestCase("13", 13)]
|
|
[TestCase("-3", -3)]
|
|
public void TryParse_AcceptsBandNamesAndIntegers(string input, int expected)
|
|
{
|
|
Assert.IsTrue(DcBands.TryParse(input, out var dc));
|
|
Assert.AreEqual(expected, dc);
|
|
}
|
|
|
|
[Test]
|
|
public void TryParse_TrivialIsEight_NotFive()
|
|
{
|
|
Assert.IsTrue(DcBands.TryParse("trivial", out var dc));
|
|
Assert.AreEqual(8, dc);
|
|
Assert.AreEqual(8, (int)DcBand.Trivial);
|
|
}
|
|
|
|
[TestCase("banana")]
|
|
[TestCase("")]
|
|
[TestCase(null)]
|
|
[TestCase("standard")]
|
|
public void TryParse_RejectsGarbage(string input)
|
|
{
|
|
Assert.IsFalse(DcBands.TryParse(input, out _));
|
|
}
|
|
}
|
|
}
|