Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unskip quick info tests #65725

Merged
merged 3 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.IntegrationTest.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
using Xunit.Abstractions;

namespace Roslyn.VisualStudio.IntegrationTests.CSharp
{
[Trait(Traits.Feature, Traits.Features.QuickInfo)]
public class CSharpQuickInfo : AbstractEditorTest
{
protected override string LanguageName => LanguageNames.CSharp;

public CSharpQuickInfo()
: base(nameof(CSharpQuickInfo))
{
}

[IdeFact]
public async Task QuickInfo_MetadataDocumentation()
{
await SetUpEditorAsync(@"
///<summary>Hello!</summary>
class Program
{
static void Main(string$$[] args)
{
}
}", HangMitigatingCancellationToken);
await TestServices.Editor.InvokeQuickInfoAsync(HangMitigatingCancellationToken);
var quickInfo = await TestServices.Editor.GetQuickInfoAsync(HangMitigatingCancellationToken);
Assert.Equal(
"class System.String\r\nRepresents text as a sequence of UTF-16 code units.To browse the .NET Framework source code for this type, see the Reference Source.",
quickInfo);
}

[IdeFact, Trait(Traits.Editor, Traits.Editors.LanguageServerProtocol)]
public async Task QuickInfo_Documentation()
{
await SetUpEditorAsync(@"
///<summary>Hello!</summary>
class Program$$
{
static void Main(string[] args)
{
}
}", HangMitigatingCancellationToken);
await TestServices.Editor.InvokeQuickInfoAsync(HangMitigatingCancellationToken);
var quickInfo = await TestServices.Editor.GetQuickInfoAsync(HangMitigatingCancellationToken);
Assert.Equal("class Program\r\nHello!", quickInfo);
}

[IdeFact, Trait(Traits.Editor, Traits.Editors.LanguageServerProtocol)]
public async Task International()
{
await SetUpEditorAsync(@"
/// <summary>
/// This is an XML doc comment defined in code.
/// </summary>
class العربية123
{
static void Main()
{
العربية123$$ goo;
}
}", HangMitigatingCancellationToken);
await TestServices.Editor.InvokeQuickInfoAsync(HangMitigatingCancellationToken);
var quickInfo = await TestServices.Editor.GetQuickInfoAsync(HangMitigatingCancellationToken);
Assert.Equal(@"class العربية123
This is an XML doc comment defined in code.", quickInfo);
}

[IdeFact, Trait(Traits.Editor, Traits.Editors.LanguageServerProtocol)]
public async Task SectionOrdering()
{
await SetUpEditorAsync(@"
using System;
using System.Threading.Tasks;

class C
{
/// <exception cref=""Exception""></exception>
async Task <int> M()
{
return await M$$();
}
}", HangMitigatingCancellationToken);

await TestServices.Editor.InvokeQuickInfoAsync(HangMitigatingCancellationToken);
var quickInfo = await TestServices.Editor.GetQuickInfoAsync(HangMitigatingCancellationToken);
var expected = "(awaitable) Task<int> C.M()\r\n\r\nExceptions:\r\n Exception";
Assert.Equal(expected, quickInfo);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.IntegrationTest.Utilities;
Expand All @@ -11,45 +12,46 @@

namespace Roslyn.VisualStudio.IntegrationTests.VisualBasic
{
[Collection(nameof(SharedIntegrationHostFixture))]
[Trait(Traits.Feature, Traits.Features.QuickInfo)]
public class BasicQuickInfo : AbstractEditorTest
{
protected override string LanguageName => LanguageNames.VisualBasic;

public BasicQuickInfo(VisualStudioInstanceFactory instanceFactory)
: base(instanceFactory, nameof(BasicQuickInfo))
public BasicQuickInfo()
: base(nameof(BasicQuickInfo))
{
}

[WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/38301")]
public void QuickInfo1()
[IdeFact]
public async Task QuickInfo1()
{
SetUpEditor(@"
await SetUpEditorAsync(@"
''' <summary>Hello!</summary>
Class Program
Sub Main(ByVal args As String$$())
End Sub
End Class");
VisualStudio.Editor.InvokeQuickInfo();
Assert.Equal("Class System.String\r\nRepresents text as a sequence of UTF-16 code units.To browse the .NET Framework source code for this type, see the Reference Source.", VisualStudio.Editor.GetQuickInfo());
End Class", HangMitigatingCancellationToken);
await TestServices.Editor.InvokeQuickInfoAsync(HangMitigatingCancellationToken);
var quickInfo = await TestServices.Editor.GetQuickInfoAsync(HangMitigatingCancellationToken);
Assert.Equal("Class System.String\r\nRepresents text as a sequence of UTF-16 code units.To browse the .NET Framework source code for this type, see the Reference Source.", quickInfo);
}

[WpfFact(Skip = "https://github.com/dotnet/roslyn/issues/62280")]
public void International()
[IdeFact]
public async Task International()
{
SetUpEditor(@"
await SetUpEditorAsync(@"
''' <summary>
''' This is an XML doc comment defined in code.
''' </summary>
Class العربية123
Shared Sub Goo()
Dim goo as العربية123$$
End Sub
End Class");
VisualStudio.Editor.InvokeQuickInfo();
End Class", HangMitigatingCancellationToken);
await TestServices.Editor.InvokeQuickInfoAsync(HangMitigatingCancellationToken);
var quickInfo = await TestServices.Editor.GetQuickInfoAsync(HangMitigatingCancellationToken);
Assert.Equal(@"Class TestProj.العربية123
This is an XML doc comment defined in code.", VisualStudio.Editor.GetQuickInfo());
This is an XML doc comment defined in code.", quickInfo);
}
}
}