-
Notifications
You must be signed in to change notification settings - Fork 5
/
MaxBusyRunnerTest.cs
59 lines (51 loc) · 1.69 KB
/
MaxBusyRunnerTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System.Collections.Generic;
using NinjaTurtlesMutation.Console.Options;
using NUnit.Framework;
namespace NinjaTurtlesMutation.Tests.ConsoleOptionsTests
{
[TestFixture]
public class MaxBusyRunnerTest
{
class MaxBusyRunnerExposed : MaxBusyRunner
{
public void TakeArgumentsExposed(Queue<string> queue)
{
TakeArguments(queue);
}
}
[TestCase("1", 1)]
[TestCase("2", 2)]
[TestCase("100", 100)]
public void GoodArgumentIsParsed(string arg, int expected)
{
var qarg = new Queue<string>();
var mbre = new MaxBusyRunnerExposed();
qarg.Enqueue(arg);
qarg.Enqueue("Fake");
qarg.Enqueue("plouf");
qarg.Enqueue("wow, much code");
mbre.TakeArgumentsExposed(qarg);
Assert.AreEqual(mbre.MaxBusyRunnersValue, expected);
}
[TestCase("0")]
[TestCase("-1")]
public void LessThanOneThrow(string badValue)
{
var qarg = new Queue<string>();
var mbre = new MaxBusyRunnerExposed();
qarg.Enqueue(badValue);
Assert.Throws<InvalidArgumentValueException>(() => mbre.TakeArgumentsExposed(qarg));
}
[TestCase("lolz")]
[TestCase("rpz91")]
[TestCase("html")]
public void NonsenseThrow(string nonsense)
{
var qarg = new Queue<string>();
var mbre = new MaxBusyRunnerExposed();
qarg.Enqueue(nonsense);
qarg.Enqueue("lé");
Assert.Throws<OptionArgumentParseException>(() => mbre.TakeArgumentsExposed(qarg));
}
}
}