-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathCommandContextItemTest.cs
More file actions
80 lines (65 loc) · 1.89 KB
/
Copy pathCommandContextItemTest.cs
File metadata and controls
80 lines (65 loc) · 1.89 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using Moq;
using NUnit.Framework;
namespace CADBooster.SolidDna.Test;
[TestFixture]
internal class CommandContextItemTest
{
[Test]
public void Create_WithNullInfo_ThrowsException()
{
var item = new CommandContextItem
{
Name = "TestItem",
Hint = "Test hint"
};
Assert.Throws<SolidDnaException>(() => item.Create(null));
}
[Test]
public void Create_WithNullOrEmptyName_ThrowsException()
{
var item = new CommandContextItem
{
Name = null,
Hint = "Test hint"
};
var info = new Mock<ICommandContextCreateInfo>();
info.Setup(x => x.SolidWorksCookie).Returns(1);
Assert.Throws<SolidDnaException>(() => item.Create(info.Object));
}
[Test]
public void Create_WithWhitespaceName_ThrowsException()
{
var item = new CommandContextItem
{
Name = " ",
Hint = "Test hint"
};
var info = new Mock<ICommandContextCreateInfo>();
info.Setup(x => x.SolidWorksCookie).Returns(1);
Assert.Throws<SolidDnaException>(() => item.Create(info.Object));
}
[Test]
public void VisibleForAssemblies_DefaultValue_IsTrue()
{
var item = new CommandContextItem();
Assert.That(item.VisibleForAssemblies, Is.True);
}
[Test]
public void VisibleForDrawings_DefaultValue_IsTrue()
{
var item = new CommandContextItem();
Assert.That(item.VisibleForDrawings, Is.True);
}
[Test]
public void VisibleForParts_DefaultValue_IsTrue()
{
var item = new CommandContextItem();
Assert.That(item.VisibleForParts, Is.True);
}
[Test]
public void SelectionType_DefaultValue_IsEverything()
{
var item = new CommandContextItem();
Assert.That(item.SelectionType, Is.EqualTo(SelectionType.Everything));
}
}