Fix SaveLoadSaveTest blowing up harder when a test failure happened.

This commit is contained in:
Pieter-Jan Briers
2021-01-14 20:41:13 +01:00
parent b6d97b6068
commit ba49ee60d8

View File

@@ -58,13 +58,17 @@ namespace Content.IntegrationTests.Tests
var failed = TestContext.CurrentContext.Result.Assertions.FirstOrDefault(); var failed = TestContext.CurrentContext.Result.Assertions.FirstOrDefault();
if (failed != null) if (failed != null)
{ {
var path1 = Path.Combine(userData.RootDir!,rp1.ToRelativeSystemPath()); var oneTmp = Path.GetTempFileName();
var path2 = Path.Combine(userData.RootDir!,rp2.ToRelativeSystemPath()); var twoTmp = Path.GetTempFileName();
TestContext.AddTestAttachment(path1);
TestContext.AddTestAttachment(path2); File.WriteAllText(oneTmp, one);
File.WriteAllText(twoTmp, two);
TestContext.AddTestAttachment(oneTmp, "First save file");
TestContext.AddTestAttachment(twoTmp, "Second save file");
TestContext.Error.WriteLine("Complete output:"); TestContext.Error.WriteLine("Complete output:");
TestContext.Error.WriteLine(path1); TestContext.Error.WriteLine(oneTmp);
TestContext.Error.WriteLine(path2); TestContext.Error.WriteLine(twoTmp);
} }
}); });
} }