-
Notifications
You must be signed in to change notification settings - Fork 4k
/
LifetimeTests.cs
29 lines (25 loc) · 1.04 KB
/
LifetimeTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using Microsoft.VisualStudio.LanguageServices.UnitTests.ProjectSystemShim.Framework;
using Roslyn.Test.Utilities;
using Xunit;
namespace Roslyn.VisualStudio.CSharp.UnitTests.ProjectSystemShim
{
public class LifetimeTests
{
[WpfFact]
[Trait(Traits.Feature, Traits.Features.ProjectSystemShims)]
[WorkItem(10358, "https://github.com/dotnet/roslyn/issues/10358")]
public void DisconnectingAProjectDoesNotLeak()
{
using (var environment = new TestEnvironment())
{
var project = ObjectReference.CreateFromFactory(() => CSharpHelpers.CreateCSharpProject(environment, "Test"));
Assert.Single(environment.Workspace.CurrentSolution.Projects);
project.UseReference(p => p.Disconnect());
project.AssertReleased();
}
}
}
}