fluentasserts.core.operations.greaterThan 21/22(95%) line coverage

      
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
1688
170
1888
1988
200
210
2288
2388
240
250
260
270
2888
290
3088
3138
320
330
3488
3552
360
370
3836
3936
400
4136
420
4336
4412
4512
460
4724
4824
490
500
510
5236
5336
540
550
5636
570
module fluentasserts.core.operations.greaterThan; import fluentasserts.core.results; import fluentasserts.core.evaluation; import fluentasserts.core.lifecycle; import std.conv; version(unittest) { import fluentasserts.core.expect; } /// IResult[] greaterThan(T)(ref Evaluation evaluation) @safe nothrow { Lifecycle.instance.addText("."); T expectedValue; T currentValue; try { expectedValue = evaluation.expectedValue.strValue.to!T; currentValue = evaluation.currentValue.strValue.to!T; } catch(Exception e) { return [ new MessageResult("Can't convert the values to " ~ T.stringof) ]; } auto result = currentValue > expectedValue; if(evaluation.isNegated) { result = !result; } if(result) { return []; } Lifecycle.instance.addText(" "); Lifecycle.instance.addValue(evaluation.currentValue.strValue); IResult[] results = []; if(evaluation.isNegated) { Lifecycle.instance.addText(" is greater than "); results ~= new ExpectedActualResult("less than or equal to " ~ evaluation.expectedValue.strValue, evaluation.currentValue.strValue); } else { Lifecycle.instance.addText(" is less than or equal to "); results ~= new ExpectedActualResult("greater than " ~ evaluation.expectedValue.strValue, evaluation.currentValue.strValue); } Lifecycle.instance.addValue(evaluation.expectedValue.strValue); Lifecycle.instance.addText("."); return results; }