fluentasserts.core.operations.arrayEqual 10/20(50%) line coverage

      
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
1628
1728
180
1928
2028
210
2228
23332
24124
250
260
270
280
290
300
310
320
3328
340
350
360
3728
3828
390
400
410
420
430
440
450
460
470
480
490
500
510
module fluentasserts.core.operations.arrayEqual; import fluentasserts.core.results; import fluentasserts.core.evaluation; import fluentasserts.core.lifecycle; version(unittest) { import fluentasserts.core.expect; } static immutable arrayEqualDescription = "Asserts that the target is strictly == equal to the given val."; /// IResult[] arrayEqual(ref Evaluation evaluation) @safe nothrow { evaluation.message.addText("."); bool result = true; EquableValue[] expectedPieces = evaluation.expectedValue.proxyValue.toArray; EquableValue[] testData = evaluation.currentValue.proxyValue.toArray; if(testData.length == expectedPieces.length) { foreach(index, testedValue; testData) { if(testedValue !is null && !testedValue.isEqualTo(expectedPieces[index])) { result = false; break; } } } else { result = false; } if(evaluation.isNegated) { result = !result; } if(result) { return []; } IResult[] results = []; if(evaluation.isNegated) { try results ~= new ExpectedActualResult("not " ~ evaluation.expectedValue.strValue, evaluation.currentValue.strValue); catch(Exception) {} } else { try results ~= new DiffResult(evaluation.expectedValue.strValue, evaluation.currentValue.strValue); catch(Exception) {} try results ~= new ExpectedActualResult(evaluation.expectedValue.strValue, evaluation.currentValue.strValue); catch(Exception) {} } return results; }