Exemple #1
0
        public async Task A_package_is_not_initialized_more_than_once()
        {
            var initializer = new TestPackageInitializer(
                "console",
                "MyProject");

            var package = Create.EmptyWorkspace(initializer: initializer);

            await package.CreateRoslynWorkspaceForRunAsync(new TimeBudget(30.Seconds()));

            await package.CreateRoslynWorkspaceForRunAsync(new TimeBudget(30.Seconds()));

            initializer.InitializeCount.Should().Be(1);
        }
Exemple #2
0
        public async Task A_package_copy_is_not_reinitialized_if_the_source_was_already_initialized()
        {
            var initializer = new TestPackageInitializer(
                "console",
                "MyProject");

            var original = Create.EmptyWorkspace(initializer: initializer);

            await original.CreateRoslynWorkspaceForLanguageServicesAsync(new TimeBudget(30.Seconds()));

            var copy = await PackageUtilities.Copy(original);

            await copy.CreateRoslynWorkspaceForLanguageServicesAsync(new TimeBudget(30.Seconds()));

            initializer.InitializeCount.Should().Be(1);
        }