forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackages.cs
More file actions
53 lines (42 loc) · 1.97 KB
/
Packages.cs
File metadata and controls
53 lines (42 loc) · 1.97 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
namespace ScriptCs.Tests.Acceptance
{
using System;
using System.Reflection;
using ScriptCs.Tests.Acceptance.Support;
using Should;
using Should.Core.Assertions;
using Xbehave;
public static class Packages
{
[Scenario(Skip = "Failing with a path length exception")]
public static void PackageContainsAFrameworkAssemblyReference(ScenarioDirectory directory, Exception exception)
{
var scenario = MethodBase.GetCurrentMethod().GetFullName();
"Given a simple script"
.x(() => directory = ScenarioDirectory.Create(scenario)
.WriteLine("foo.csx", "Console.WriteLine();"));
"When I install a package which contains a framework assembly reference"
.x(() => ScriptCsExe.Install("FrameworkAssemblyReferencer", directory));
"And I execute the script"
.x(() => exception = Record.Exception(() => ScriptCsExe.Run("foo.csx", directory)));
"Then there should be no errors"
.x(() => exception.ShouldBeNull());
}
[Scenario]
public static void PackagesWithDuplicateAssemblies(ScenarioDirectory directory, Exception exception)
{
var scenario = MethodBase.GetCurrentMethod().GetFullName();
"Given a simple script"
.x(() => directory = ScenarioDirectory.Create(scenario)
.WriteLine("foo.csx", "Console.WriteLine();"));
"When I install a package"
.x(() => ScriptCsExe.Install("Duplicate.A", directory));
"And I install another package containing the same assembly"
.x(() => ScriptCsExe.Install("Duplicate.B", directory));
"And I execute the script"
.x(() => exception = Record.Exception(() => ScriptCsExe.Run("foo.csx", directory)));
"Then there should be no errors"
.x(() => exception.ShouldBeNull());
}
}
}