Skip to content
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 @@ -707,22 +707,35 @@ private static string RemoveTestMarkup(string sourceWithMarkup)
return sourceWithoutMarkup;
}

public static IEnumerable<object[]> CodeSnippetsToVerifyNoTreesProduced()
[Fact]
public async Task ValidateNoGeneratedOutputForNoImport()
{
string source = """
using System.Runtime.InteropServices;
public class Basic { }
""";
yield return new object[] { ID(), source, TestTargetFramework.Standard };
yield return new object[] { ID(), source, TestTargetFramework.Framework };
yield return new object[] { ID(), source, TestTargetFramework.Net };

var test = new NoChangeTest(TestTargetFramework.Net)
{
TestCode = source,
TestBehaviors = TestBehaviors.SkipGeneratedSourcesCheck
};

await test.RunAsync();
}


[OuterLoop("Uses the network for downlevel ref packs")]
[InlineData(TestTargetFramework.Standard)]
[InlineData(TestTargetFramework.Framework)]
[Theory]
[MemberData(nameof(CodeSnippetsToVerifyNoTreesProduced))]
public async Task ValidateNoGeneratedOutputForNoImport(string id, string source, TestTargetFramework framework)
public async Task ValidateNoGeneratedOutputForNoImportDownlevel(TestTargetFramework framework)
{
TestUtils.Use(id);
string source = """
using System.Runtime.InteropServices;
public class Basic { }
""";

var test = new NoChangeTest(framework)
{
TestCode = source,
Expand Down