Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }