-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDependencyTests.cs
45 lines (39 loc) · 1.44 KB
/
DependencyTests.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
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace JSIL.Tests {
[TestFixture]
public class DependencyTests {
[Test]
public void EnumeratesAssemblyDependencies () {
var cr = CompilerUtil.Compile(new[] {
Path.Combine(
ComparisonTest.TestSourceFolder,
@"SpecialTestCases",
"EnumeratesAssemblyDependencies.cs"
)
}, Path.Combine("DependencyTests", "EnumeratesAssemblyDependencies"), "", ComparisonTest.CurrentMetaRevision);
var assembly = cr.Assembly;
var translator = new AssemblyTranslator(
new Translator.Configuration {
IncludeDependencies = false
}
);
var assemblyDefinition = translator.LoadAssembly(assembly.Location);
translator = new AssemblyTranslator(
new Translator.Configuration {
IncludeDependencies = true
}
);
var assemblyPlusDependencies = translator.LoadAssembly(assembly.Location);
Assert.AreNotEqual(
(from ad in assemblyDefinition select ad.FullName).ToArray(),
(from ad in assemblyPlusDependencies select ad.FullName).ToArray()
);
}
}
}