in tst/PortingAssistantExtensionIntegTests/AssessmentTests.cs [267:325]
private async Task<Boolean> TestPortSolutionAsync(string[] projectInfo, string targetFramework, bool includeFix, bool assessSolution=true, string projectName = "")
{
PAIntegTestClient client = null;
try
{
string solutionPath = Path.Combine(tempProjectRoot, projectInfo[0]);
string solutionName = projectInfo[1];
string expectedSolutionPath = solutionPath;
StartLanguageServer();
client = new PAIntegTestClient(solutionPath, solutionName);
await client.InitClientAsync();
if (assessSolution)
{
await client.AssessSolutionAsync(targetFramework);
}
var currentResults = await client.PortSolutionAsync(targetFramework, includeFix, projectName);
if (includeFix)
{
expectedSolutionPath += "-WithFix";
}
if(targetFramework.Equals(NET50))
{
expectedSolutionPath += "-net50";
}
expectedSolutionPath += "-PortResults";
Boolean result = FileUtils.AreTwoDirectoriesEqual(solutionPath, expectedSolutionPath);
return result;
}
catch (Exception e)
{
Console.WriteLine(e);
return false;
}
finally
{
if (client != null)
{
try
{
await client.CleanupAsync();
}
catch (Exception e) { }
}
try
{
ProcessHelper.getInstance().StopServer();
}
catch (Exception e) { }
}
return false;
}