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

      
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
1655
170
1855
1955
200
210
2255
2355
240
250
260
270
2855
290
3055
3122
320
330
3455
3533
360
370
3822
3922
400
4122
420
4322
4411
4511
460
4711
4811
490
500
5122
5222
530
5422
550
module fluentasserts.core.operations.greaterOrEqualTo; import fluentasserts.core.results; import fluentasserts.core.evaluation; import fluentasserts.core.lifecycle; import std.conv; version(unittest) { import fluentasserts.core.expect; } /// IResult[] greaterOrEqualTo(T)(ref Evaluation evaluation) @safe nothrow { evaluation.message.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 []; } evaluation.message.addText(" "); evaluation.message.addValue(evaluation.currentValue.strValue); IResult[] results = []; if(evaluation.isNegated) { evaluation.message.addText(" is greater or equal than "); results ~= new ExpectedActualResult("less than " ~ evaluation.expectedValue.strValue, evaluation.currentValue.strValue); } else { evaluation.message.addText(" is less than "); results ~= new ExpectedActualResult("greater or equal than " ~ evaluation.expectedValue.strValue, evaluation.currentValue.strValue); } evaluation.message.addValue(evaluation.expectedValue.strValue); evaluation.message.addText("."); return results; }