-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArgDetailTests.cs
41 lines (34 loc) · 1.06 KB
/
ArgDetailTests.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
using NUnit.Framework;
namespace ArgsParser.Tests
{
public class ArgDetailTests
{
[SetUp]
public void Setup()
{
}
[Test]
public void Constructor_SetsFields()
{
var type = typeof(string);
var info = "info";
var defaultValue = "default";
var d = new ArgDetail(type, true, info, defaultValue);
Assert.AreEqual(type, d.ArgType);
Assert.AreEqual(true, d.IsRequired);
Assert.AreEqual(info, d.Info);
Assert.AreEqual(defaultValue, d.DefaultValue);
}
[TestCase(true, false)]
[TestCase(false, true)]
public void IsOptional_InvertsIsRequired(bool isRequired, bool expected)
{
var type = typeof(string);
var info = "info";
var defaultValue = "default";
var d = new ArgDetail(type, isRequired, info, defaultValue);
Assert.AreNotEqual(isRequired, d.IsOptional);
Assert.AreEqual(expected, d.IsOptional);
}
}
}