fluentasserts.core.operations.beNull 6/11(54%) line coverage

      
10
20
30
40
50
60
70
80
90
100
110
120
138
140
1516
160
178
183
190
200
218
228
230
240
250
260
270
280
290
300
310
320
330
module fluentasserts.core.operations.beNull; import fluentasserts.core.results; import fluentasserts.core.evaluation; import fluentasserts.core.lifecycle; import std.algorithm; static immutable beNullDescription = "Asserts that the value is null."; /// IResult[] beNull(ref Evaluation evaluation) @safe nothrow { evaluation.message.addText("."); auto result = evaluation.currentValue.typeNames.canFind("null") || evaluation.currentValue.strValue == "null"; if(evaluation.isNegated) { result = !result; } if(result) { return []; } IResult[] results = []; try results ~= new ExpectedActualResult( evaluation.isNegated ? "not null" : "null", evaluation.currentValue.typeNames.length ? evaluation.currentValue.typeNames[0] : "unknown"); catch(Exception) {} return results; }