Exemplo n.º 1
0
        public async Task CanLoadSolution()
        {
            var fileSystem = Mocks.MockFileSystem();

            var loader = new WorkspaceLoader(fileSystem);

            var workspace = await loader.LoadAsync(MockHotel.Solution.FilePath);

            Assert.NotNull(workspace.CurrentSolution);

            var projects = workspace.CurrentSolution.Projects.ToArray();

            Assert.Equal(3, projects.Length);

            var hotelProject = projects.FirstOrDefault(p => p.Name == "Hotel");

            Assert.NotNull(hotelProject);

            var compilation = await hotelProject.GetCompilationAsync();

            Assert.NotNull(compilation);

            var hotelServiceSymbol = compilation.GetTypeByMetadataName("Hotel.IHotelService");

            Assert.NotNull(hotelServiceSymbol);

            var attribute = hotelServiceSymbol.GetAttributes().FirstOrDefault()?.AttributeClass;

            Assert.NotNull(attribute);
            Assert.Equal("ServiceContractAttribute", attribute.Name);
            Assert.Equal("System.ServiceModel", attribute.ContainingNamespace.ToString());
        }
        public async Task CanLoadSolution()
        {
            var loader = new WorkspaceLoader();

            var workspace = await loader.LoadAsync(@"D:\RendleLabs\LegacyWorkspaceLoader\data\Hotel\Hotel.sln");

            Assert.NotNull(workspace.CurrentSolution);

            var projects = workspace.CurrentSolution.Projects.ToArray();

            Assert.Equal(5, projects.Length);

            var hotelProject = projects.FirstOrDefault(p => p.Name == "Hotel");

            Assert.NotNull(hotelProject);

            var compilation = await hotelProject.GetCompilationAsync();

            Assert.NotNull(compilation);

            var hotelServiceSymbol = compilation.GetTypeByMetadataName("Hotel.IHotelService");

            Assert.NotNull(hotelServiceSymbol);

            var attribute = hotelServiceSymbol.GetAttributes().FirstOrDefault()?.AttributeClass;

            Assert.NotNull(attribute);
            Assert.Equal("ServiceContractAttribute", attribute.Name);
            Assert.Equal("System.ServiceModel", attribute.ContainingNamespace.ToString());

            var featureProject = projects.FirstOrDefault(p => p.Name == "Hotel.Feature");

            Assert.NotNull(featureProject);

            compilation = await featureProject.GetCompilationAsync();

            Assert.NotNull(compilation);

            var featureSymbol = compilation.GetTypeByMetadataName("Hotel.Feature.HotelFeature");

            Assert.NotNull(featureSymbol);
        }
Exemplo n.º 3
0
 public SymbolProvider()
 {
     this.workspaceLoader = new WorkspaceLoader();
 }
Exemplo n.º 4
0
        private void EstablishDataEnvironment(IContainer builder, ILifetimeScope scope)
        {
            var innerContainer = new ContainerBuilder();
            // Loading and storing the workspaces
            var workspaceLoader = new WorkspaceLoader(scope.Resolve<IWorkspaceCollection>(),
                "App_Data/Database/workspaces.xml");
            workspaceLoader.Load();
            innerContainer.RegisterInstance(workspaceLoader).As<WorkspaceLoader>();

            // Loading and storing the extents
            var extentLoader = new ExtentStorageConfigurationLoader(
                scope.Resolve<ExtentStorageData>(),
                scope.Resolve<IExtentStorageLoader>(),
                "App_Data/Database/extents.xml");
            innerContainer.Register(c => new ExtentStorageConfigurationLoader(
                    c.Resolve<ExtentStorageData>(),
                    c.Resolve<IExtentStorageLoader>(),
                    "App_Data/Database/extents.xml"))
                .As<ExtentStorageConfigurationLoader>();

            innerContainer.Update(builder);

            // Now start the plugins
            _settings?.Hooks?.BeforeLoadExtents(scope);

            // Loads all extents after all plugins were started
            extentLoader.LoadAllExtents();
        }