geekbot/Tests/Lib/LevelCalc.test.cs

48 lines
1.1 KiB
C#
Raw Normal View History

2018-01-19 01:17:05 +01:00
using System.Collections.Generic;
using Geekbot.net.Lib.Levels;
2018-01-19 01:17:05 +01:00
using Xunit;
namespace Tests.Lib
{
2018-04-30 23:44:19 +02:00
public class LevelCalcTest
2018-01-19 01:17:05 +01:00
{
public static IEnumerable<object[]> LevelCalcTestData
{
get
{
yield return new object[]
{
500,
13
};
yield return new object[]
{
41659,
55
};
yield return new object[]
{
0,
1
};
yield return new object[]
{
4000000,
101
};
}
}
[Theory, MemberData(nameof(LevelCalcTestData))]
2018-02-04 14:52:30 +01:00
public void GetLevel(int messages, int expectedResult)
2018-01-19 01:17:05 +01:00
{
var levelCalc = new LevelCalc();
var result = levelCalc.GetLevel(messages);
Assert.Equal(result, expectedResult);
}
}
}