Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 8bc5ff0

Browse files
committed
Check we don't reference DesignTime assemblies
Check that no GitHub assemblies reference any assembly that ends with DesignTime. Types from DesignTime assemblies should be embedded not referenced.
1 parent 24c4931 commit 8bc5ff0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.IO;
2+
using System.Reflection;
3+
using NUnit.Framework;
4+
5+
public class GitHubAssemblyTests
6+
{
7+
[Theory]
8+
public void GitHub_Assembly_Should_Not_Reference_DesignTime_Assembly(string assemblyFile)
9+
{
10+
var asm = Assembly.LoadFrom(assemblyFile);
11+
foreach (var referencedAssembly in asm.GetReferencedAssemblies())
12+
{
13+
Assert.That(referencedAssembly.Name, Does.Not.EndWith(".DesignTime"),
14+
"DesignTime assemblies should be embedded not referenced");
15+
}
16+
}
17+
18+
[DatapointSource]
19+
string[] GitHubAssemblies => Directory.GetFiles(AssemblyDirectory, "GitHub.*.dll");
20+
21+
string AssemblyDirectory => Path.GetDirectoryName(GetType().Assembly.Location);
22+
}

0 commit comments

Comments
 (0)