in src/TestHelpers/Embedded/BaselineHelper.cs [75:135]
public static string GetAssertionFormatString(bool isBaselineUpdate, bool canUpdateBaselines)
{
var output = new StringBuilder();
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
output.Append(@"
Found diffs between actual and expected:
{0}
");
if (isBaselineUpdate)
{
output.Append(@"
Baseline {2} has been updated.
");
}
else if (canUpdateBaselines)
{
output.Append(@"
View this diff with:
git diff --color-words --no-index {2} {1}
");
if (isWindows)
{
output.Append(@"
Overwrite the single baseline:
xcopy /yq {1} {2}
Overwrite all baselines for this assembly:
dotnet test {3} --filter ""TestCategory=Baseline"" -- 'TestRunParameters.Parameter(name=""SetBaseLine"", value=""true"")'
Overwrite all baselines:
.\scripts\UpdateBaselines.ps1
");
}
else
{
output.Append(@"
Overwrite the single baseline:
cp {1} {2}
Overwrite all baselines for this assembly:
dotnet test {3} --filter ""TestCategory=Baseline"" -- 'TestRunParameters.Parameter(name=""SetBaseLine"", value=""true"")'
");
}
}
else
{
output.Append(@"
Run the following in the repo root to overwrite all baselines:
.\scripts\UpdateBaselines.ps1
");
}
output.Append(@"
For information on baselines, see https://aka.ms/deployments/wiki?pagePath=/How-Tos/Work-with-Baseline-files
");
return output.ToString();
}