1 module dmocks.call; 2 3 import dmocks.arguments; 4 public import dmocks.dynamic; 5 public import dmocks.model; 6 import dmocks.qualifiers; 7 import std.array; 8 9 /++ 10 + This class represents a single method call on a mock object while in replay phase 11 + All information about the call is stored here 12 +/ 13 class Call 14 { 15 MockId object; 16 string name; 17 string[] qualifiers; 18 Dynamic[] arguments; 19 20 override string toString() 21 { 22 string arguments = (arguments is null) ? "(<unknown>)" : arguments.formatArguments; 23 return name ~ " "~ arguments ~ " " ~ qualifiers.join(" "); 24 } 25 } 26 27 Call createCall(alias METHOD, ARGS...)(MockId object, string name, ARGS args) 28 { 29 auto ret = new Call; 30 ret.object = object; 31 ret.name = name; 32 ret.qualifiers = qualifiers!METHOD; 33 ret.arguments = arguments(args); 34 return ret; 35 }