Ejemplo n.º 1
0
        public async Task ReturnsSource_ForGenericType()
        {
            var source1 = @"using System;

class Foo {
}";
            var source2 = @"class Bar {
    private Foo foo;
}";

            var workspace = _assistant.CreateWorkspace(
                new Dictionary <string, string>
            {
                { "foo.cs", source1 }, { "bar.cs", source2 }
            });

            var controller = new MetadataService(workspace, new MetadataHelper(_loader));
            var response   = await controller.Handle(new MetadataRequest
            {
                AssemblyName = "System.Private.CoreLib",
                TypeName     = "System.Collections.Generic.List`1",
                Timeout      = 60000
            });

            Assert.NotNull(response.Source);

            response = await controller.Handle(new MetadataRequest
            {
                AssemblyName = "System.Private.CoreLib",
                TypeName     = "System.Collections.Generic.Dictionary`2"
            });

            Assert.NotNull(response.Source);
        }