Skip to content

Commit 9e4d9ef

Browse files
committed
formatting
1 parent 4e5d5c8 commit 9e4d9ef

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

src/CodeQLToolkit.Features.Test/Commands/Targets/ValidateUnitTestsCommand.cs

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,57 @@ public override void Run()
5858
Log<ValidateUnitTestsCommand>.G().LogError($"One or more unit tests failed. Details below:");
5959
Log<ValidateUnitTestsCommand>.G().LogError($"---------------------------------------------");
6060

61+
int totalCases = failures.Count;
62+
int currentCase = 0;
63+
64+
6165
foreach (var item in failures)
6266
{
67+
currentCase++;
6368

6469
if(item.failureStage == "RESULT")
6570
{
66-
Log<ValidateUnitTestsCommand>.G().LogError($"Test: {item.test}");
67-
Log<ValidateUnitTestsCommand>.G().LogError($"--------------------------------------------------");
68-
Log<ValidateUnitTestsCommand>.G().LogError($"Diff of Expected vs Actual");
69-
Log<ValidateUnitTestsCommand>.G().LogError($"--------------------------------------------------");
71+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
72+
Log<ValidateUnitTestsCommand>.G().LogError($"| TEST CASE ({currentCase} of {totalCases}) : {Path.GetFileName(item.test)}");
73+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
74+
Log<ValidateUnitTestsCommand>.G().LogError($"| STATUS : FAILED ");
75+
Log<ValidateUnitTestsCommand>.G().LogError($"| FAILURE TYPE : RESULT");
76+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
77+
Log<ValidateUnitTestsCommand>.G().LogError($"| TEST DIFFERENCES |");
78+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
79+
Log<ValidateUnitTestsCommand>.G().LogError($"| FULL PATH : {item.test}");
80+
7081

7182
foreach(var diff in item.diff)
7283
{
73-
Log<ValidateUnitTestsCommand>.G().LogError($"{diff}");
84+
Log<ValidateUnitTestsCommand>.G().LogError($"| {diff}");
7485
}
86+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
7587

7688
Log<ValidateUnitTestsCommand>.G().LogError($"\n\n\n\n");
7789

7890
}
7991
else
8092
{
81-
Log<ValidateUnitTestsCommand>.G().LogError($"Non-test content related failure:");
82-
Log<ValidateUnitTestsCommand>.G().LogError($"Test: {item.test}");
83-
Log<ValidateUnitTestsCommand>.G().LogError($"Failure Description: {item.failureDescription}");
93+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
94+
Log<ValidateUnitTestsCommand>.G().LogError($"| TEST CASE ({currentCase} of {totalCases}) : {Path.GetFileName(item.test)}");
95+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
96+
Log<ValidateUnitTestsCommand>.G().LogError($"| STATUS : FAILED ");
97+
Log<ValidateUnitTestsCommand>.G().LogError($"| FAILURE TYPE : {item.failureStage}");
98+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
99+
Log<ValidateUnitTestsCommand>.G().LogError($"| FAILURE DESCRIPTION |");
100+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
101+
Log<ValidateUnitTestsCommand>.G().LogError($"| FULL PATH : {item.test}");
102+
Log<ValidateUnitTestsCommand>.G().LogError($"| {item.failureDescription}");
103+
104+
105+
Log<ValidateUnitTestsCommand>.G().LogError($"+----------------------------------------------+");
106+
107+
Log<ValidateUnitTestsCommand>.G().LogError($"\n\n\n\n");
108+
84109
}
85110
}
86-
Log<ValidateUnitTestsCommand>.G().LogError($"---------------------------------------------");
111+
Log<ValidateUnitTestsCommand>.G().LogError($"--------------------END OF RESULTS-------------------------");
87112

88113
DieWithError("One or more failures during run unit tests.");
89114
}

0 commit comments

Comments
 (0)