forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptHostTests.cs
More file actions
44 lines (37 loc) · 1.29 KB
/
ScriptHostTests.cs
File metadata and controls
44 lines (37 loc) · 1.29 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
using Moq;
using ScriptCs.Contracts;
using Should;
using Xunit;
namespace ScriptCs.Tests
{
public class ScriptHostTests
{
public class TheGetMethod
{
private Mock<IScriptPackContext> _mockContext = new Mock<IScriptPackContext>();
private Mock<IScriptPackManager> _mockScriptPackManager = new Mock<IScriptPackManager>();
private ScriptHost _scriptHost;
public TheGetMethod()
{
_scriptHost = new ScriptHost(_mockScriptPackManager.Object, new string[0]);
_mockScriptPackManager.Setup(s => s.Get<IScriptPackContext>()).Returns(_mockContext.Object);
}
[Fact]
public void ShoulGetScriptPackFromScriptPackManagerWhenInvoked()
{
var result = _scriptHost.Require<IScriptPackContext>();
_mockScriptPackManager.Verify(s => s.Get<IScriptPackContext>());
}
}
public class TheConstructor
{
[Fact]
public void ShouldSetScriptArgsWhenConstructed()
{
var scriptArgs = new string[0];
var scriptHost = new ScriptHost(null, scriptArgs);
scriptHost.ScriptArgs.ShouldEqual(scriptArgs);
}
}
}
}