Only show Expected/But Was for failing tests in AssertDriverContentsAre

This commit is contained in:
tznind
2023-02-01 01:22:47 +00:00
parent 2caab5d410
commit 6be225bb3d

View File

@@ -120,8 +120,11 @@ class TestHelpers {
expectedLook = expectedLook.Replace ("\r\n", "\n");
actualLook = actualLook.Replace ("\r\n", "\n");
output?.WriteLine ("Expected:" + Environment.NewLine + expectedLook);
output?.WriteLine ("But Was:" + Environment.NewLine + actualLook);
// If test is about to fail show user what things looked like
if(!string.Equals(expectedLook,actualLook)) {
output?.WriteLine ("Expected:" + Environment.NewLine + expectedLook);
output?.WriteLine ("But Was:" + Environment.NewLine + actualLook);
}
Assert.Equal (expectedLook, actualLook);
}