Skip to content

Add infrastructure for doing unit testing of the generator library#239

Merged
lambdageek merged 9 commits intodotnet:mainfrom
lambdageek:add-tests
Mar 2, 2023
Merged

Add infrastructure for doing unit testing of the generator library#239
lambdageek merged 9 commits intodotnet:mainfrom
lambdageek:add-tests

Conversation

@lambdageek
Copy link
Member

Add the beginnings of a library that tests our Roslyn bindings

@lambdageek lambdageek marked this pull request as ready for review March 1, 2023 20:13
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>39952f0f2dbd76699158d5f84fc3644602ad08c9</Sha>
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.6.0-preview.2.29">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you really need a darc dependency for this or would an older version which is on nuget.org be fine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get the unit tests to build/run with an older version - something was transitively loading the newest Nuget.Frameworks and then the MSBuildWorkspace was failing to open.

public Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace Workspace { get; }
public GlobalFilesFixture GlobalFiles { get; }
public TempDirectory TempDir { get; }
public TempMSBuildWorkspaceTest(MSBuildLocatorFixture _1, GlobalFilesFixture globalFiles)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need the MSBuildLocatorFixture as an arg here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I don't really understand how xUnit fixtures work. I'll see if I can remove it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that doesn't work actually. If you implement two IClassFixture<T> interfaces, you have to have a constructor with two fixture args - even if I only use the MSBuildLocator one for its side effects

@lambdageek lambdageek merged commit 1313bd2 into dotnet:main Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants