public void Name_Returns_AssemblyName() { // Arrange var part = new AssemblyPart(typeof(AssemblyPartTests).Assembly); // Act string name = part.Name; // Assert Assert.Equal("Alium.Core.Tests", name); }
public void Assembly_Returns_Assembly() { // Arrange var assembly = typeof(AssemblyPartTests).Assembly; var part = new AssemblyPart(assembly); // Act var partAssembly = part.Assembly; // Assert Assert.Equal(part.Assembly, partAssembly); }
public void Types_Returns_DefinedTypes() { // Arrange var assembly = typeof(AssemblyPartTests).Assembly; var part = new AssemblyPart(assembly); // Act var types = part.Types; // Assert Assert.Equal(assembly.DefinedTypes, types); Assert.NotSame(assembly.DefinedTypes, types); }
public void GetReferencePaths_ReturnsEmptySequenceForDynamicAssembly() { // Assert var name = new AssemblyName($"DynamicAssembly-{Guid.NewGuid()}"); var assembly = AssemblyBuilder.DefineDynamicAssembly(name, AssemblyBuilderAccess.RunAndCollect); var part = new AssemblyPart(assembly); // Act var references = part.GetReferencePaths().ToList(); // Assert Assert.Empty(references); }
public void GetReferencePaths_ReturnsAssemblyLocation_IfPreserveCompilationContextIsNotSet() { // Arrange var assembly = typeof(AssemblyPart).Assembly; var part = new AssemblyPart(assembly); // Act var references = part.GetReferencePaths().ToList(); // Assert var actual = Assert.Single(references); Assert.Equal(assembly.Location, actual); }