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

      
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
1677
170
1877
1977
200
210
2277
2377
240
250
260
270
2877
290
3077
3138
320
330
3477
3553
360
370
3824
3924
400
4124
420
4324
4412
4512
460
4712
4812
490
500
510
5224
5324
540
550
5624
570
module fluentasserts.core.operations.lessThan; import fluentasserts.core.results; import fluentasserts.core.evaluation; import fluentasserts.core.lifecycle; import std.conv; version(unittest) { import fluentasserts.core.expect; } /// IResult[] lessThan(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 less than "); results ~= new ExpectedActualResult("greater than or equal to " ~ evaluation.expectedValue.strValue, evaluation.currentValue.strValue); } else { Lifecycle.instance.addText(" is greater than or equal to "); results ~= new ExpectedActualResult("less than " ~ evaluation.expectedValue.strValue, evaluation.currentValue.strValue); } Lifecycle.instance.addValue(evaluation.expectedValue.strValue); Lifecycle.instance.addText("."); return results; }