Esempio n. 1
0
        /// <summary>
        /// Creates a new documentation object based on the given compiled assemblies.
        /// </summary>
        /// <param name="assemblies">The compiled assembly images.</param>
        /// <returns>A <see cref="Task{TResult}"/> providing the new instance of <see cref="Documentation"/> after completion.</returns>
        protected static async Task <Documentation> RetrieveDocumentationAsync(params ImmutableArray <byte>[] assemblies)
        {
            var builder = Documentation.CreateBuilder();

            foreach (var assembly in assemblies)
            {
                _ = builder.AddAssembly(assembly);
            }

            // We should actually add the assembly containing System.Object and other fundamentals.
            _ = builder.AddAssembly(BaseMetadataImage);
            return(await builder.BuildAsync());
        }
Esempio n. 2
0
 public async Task CreatingDocumentationWithoutAssembliesFails()
 {
     _ = await Should.ThrowAsync <InvalidOperationException>(() => Documentation.CreateBuilder().BuildAsync());
 }