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

Update TypeImportCompletionProviderTests with records #48159

Merged
merged 1 commit into from
Sep 29, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class Bar
#region "CompletionItem tests"

[InlineData("class", (int)Glyph.ClassPublic)]
[InlineData("record", (int)Glyph.ClassPublic)]
[InlineData("struct", (int)Glyph.StructurePublic)]
[InlineData("enum", (int)Glyph.EnumPublic)]
[InlineData("interface", (int)Glyph.InterfacePublic)]
Expand Down Expand Up @@ -145,6 +146,7 @@ await VerifyTypeImportItemExistsAsync(
}

[InlineData("class", (int)Glyph.ClassPublic)]
[InlineData("record", (int)Glyph.ClassPublic)]
[InlineData("struct", (int)Glyph.StructurePublic)]
[InlineData("enum", (int)Glyph.EnumPublic)]
[InlineData("interface", (int)Glyph.InterfacePublic)]
Expand All @@ -168,11 +170,12 @@ await VerifyTypeImportItemExistsAsync(
}

[InlineData("class")]
[InlineData("record")]
[InlineData("struct")]
[InlineData("enum")]
[InlineData("interface")]
[Theory, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task DoNotShow_TopLevel_SmaeNamespace_InProject(string typeKind)
public async Task DoNotShow_TopLevel_SameNamespace_InProject(string typeKind)
{
var file1 = $@"
namespace Foo
Expand All @@ -195,6 +198,7 @@ await VerifyTypeImportItemIsAbsentAsync(
}

[InlineData("class", (int)Glyph.ClassPublic)]
[InlineData("record", (int)Glyph.ClassPublic)]
[InlineData("struct", (int)Glyph.StructurePublic)]
[InlineData("interface", (int)Glyph.InterfacePublic)]
[Theory, Trait(Traits.Feature, Traits.Features.Completion)]
Expand Down Expand Up @@ -227,6 +231,7 @@ class Bat
}

[InlineData("class")]
[InlineData("record")]
[InlineData("struct")]
[InlineData("enum")]
[InlineData("interface")]
Expand Down Expand Up @@ -256,6 +261,7 @@ class Bat
}

[InlineData("class")]
[InlineData("record")]
[InlineData("struct")]
[InlineData("enum")]
[InlineData("interface")]
Expand Down Expand Up @@ -293,6 +299,9 @@ namespace Foo
{{
public class Bar
{{}}

public record Bar2
{{}}
}}";
var file2 = @"
namespace Baz
Expand All @@ -304,6 +313,7 @@ class Bat
}";
var markup = GetMarkupWithReference(file2, file1, LanguageNames.CSharp, LanguageNames.CSharp, isProjectReference);
await VerifyTypeImportItemExistsAsync(markup, "Bar", glyph: (int)Glyph.ClassPublic, inlineDescription: "Foo");
await VerifyTypeImportItemExistsAsync(markup, "Bar2", glyph: (int)Glyph.ClassPublic, inlineDescription: "Foo");
}

[InlineData(true)]
Expand All @@ -316,6 +326,9 @@ namespace Foo
{{
public class Bar
{{}}

public record Bar2
{{}}
}}";
var file2 = @"
using Foo;
Expand All @@ -328,6 +341,7 @@ class Bat
}";
var markup = GetMarkupWithReference(file2, file1, LanguageNames.CSharp, LanguageNames.CSharp, isProjectReference);
await VerifyTypeImportItemIsAbsentAsync(markup, "Bar", inlineDescription: "Foo");
await VerifyTypeImportItemIsAbsentAsync(markup, "Bar2", inlineDescription: "Foo");
}

[InlineData(true)]
Expand All @@ -340,6 +354,9 @@ namespace Foo
{{
internal class Bar
{{}}

internal record Bar2
{{}}
}}";
var file2 = @"
namespace Baz
Expand All @@ -351,6 +368,7 @@ class Bat
}";
var markup = GetMarkupWithReference(file2, file1, LanguageNames.CSharp, LanguageNames.CSharp, isProjectReference);
await VerifyTypeImportItemIsAbsentAsync(markup, "Bar", inlineDescription: "Foo");
await VerifyTypeImportItemIsAbsentAsync(markup, "Bar2", inlineDescription: "Foo");
}

[InlineData(true)]
Expand Down