anchor.diff:      function TryGetMethod(const AName: string; out AMethod: TRttiMethod): Boolean;
     end;
   
  +function CompareValue(const Left, Right: TValue): Integer;
  +function SameValue(const Left, Right: TValue): Boolean;
  +
   
   implementation
   
   uses
     SysUtils,
  +  Math,
     TypInfo;
   
  +function CompareValue(const Left, Right: TValue): Integer;
  +begin
  +  if Left.IsOrdinal and Right.IsOrdinal then
  +  begin
  +    Result := Math.CompareValue(Left.AsOrdinal, Right.AsOrdinal);
  +  end else
  +  if Left.IsFloat and Right.IsFloat then
  +  begin
  +    Result := Math.CompareValue(Left.AsFloat, Right.AsFloat);
  +  end else
  +  if Left.IsString and Right.IsString then
  +  begin
  +    Result := SysUtils.CompareStr(Left.AsString, Right.AsString);
  +  end else
  +  begin
  +    Result := 0;
  +  end;
  +end;
  +
  +function SameValue(const Left, Right: TValue): Boolean;
  +begin
  +  if Left.IsNumeric and Right.IsNumeric then
  +  begin
  +    if Left.IsOrdinal then
  +    begin
  +      if Right.IsOrdinal then
  +      begin
  +        Result := Left.AsOrdinal = Right.AsOrdinal;
  +      end else
  +      if Right.IsSingle then
  +      begin
  +        Result := Math.SameValue(Left.AsOrdinal, Right.AsSingle);
  +      end else
  +      if Right.IsDouble then
  +      begin
  +        Result := Math.SameValue(Left.AsOrdinal, Right.AsDouble);
  +      end
  +      else
  +      begin
  +        Result := Math.SameValue(Left.AsOrdinal, Right.AsExtended);
  +      end;
  +    end else
  +    if Left.IsSingle then
  +    begin
  +      if Right.IsOrdinal then
  +      begin
  +        Result := Math.SameValue(Left.AsSingle, Right.AsOrdinal);
  +      end else
  +      if Right.IsSingle then
  +      begin
  +        Result := Math.SameValue(Left.AsSingle, Right.AsSingle);
  +      end else
  +      if Right.IsDouble then
  +      begin
  +        Result := Math.SameValue(Left.AsSingle, Right.AsDouble);
  +      end
  +      else
  +      begin
  +        Result := Math.SameValue(Left.AsSingle, Right.AsExtended);
  +      end;
  +    end else
  +    if Left.IsDouble then
  +    begin
  +      if Right.IsOrdinal then
  +      begin
  +        Result := Math.SameValue(Left.AsDouble, Right.AsOrdinal);
  +      end else
  +      if Right.IsSingle then
  +      begin
  +        Result := Math.SameValue(Left.AsDouble, Right.AsSingle);
  +      end else
  +      if Right.IsDouble then
  +      begin
  +        Result := Math.SameValue(Left.AsDouble, Right.AsDouble);
  +      end
  +      else
  +      begin
  +        Result := Math.SameValue(Left.AsDouble, Right.AsExtended);
  +      end;
  +    end
  +    else
  +    begin
  +      if Right.IsOrdinal then
  +      begin
  +        Result := Math.SameValue(Left.AsExtended, Right.AsOrdinal);
  +      end else
  +      if Right.IsSingle then
  +      begin
  +        Result := Math.SameValue(Left.AsExtended, Right.AsSingle);
  +      end else
  +      if Right.IsDouble then
  +      begin
  +        Result := Math.SameValue(Left.AsExtended, Right.AsDouble);
  +      end
  +      else
  +      begin
  +        Result := Math.SameValue(Left.AsExtended, Right.AsExtended);
  +      end;
  +    end;
  +  end else
  +  if Left.IsString and Right.IsString then
  +  begin
  +    Result := Left.AsString = Right.AsString;
  +  end else
  +  if Left.IsClass and Right.IsClass then
  +  begin
  +    Result := Left.AsClass = Right.AsClass;
  +  end else
  +  if Left.IsObject and Right.IsObject then
  +  begin
  +    Result := Left.AsObject = Right.AsObject;
  +  end else
  +  if Left.IsPointer and Right.IsPointer then
  +  begin
  +    Result := Left.AsPointer = Right.AsPointer;
  +  end else
  +  if Left.TypeInfo = Right.TypeInfo then
  +  begin
  +    Result := Left.AsPointer = Right.AsPointer;
  +  end else
  +  begin
  +    Result := False;
  +  end;
  +end;
  +
   { TValueHelper }
   
  +function TValueHelper.AsDouble: Double;
  +begin
  +  Result := AsType<Double>;
  +end;
  +
  +function TValueHelper.AsFloat: Extended;
  +begin
  +  Result := AsType<Extended>;
  +end;
  +
  +function TValueHelper.AsPointer: Pointer;
  +begin
  +  ExtractRawDataNoCopy(@Result);
  +end;
  +
  +function TValueHelper.AsSingle: Single;
  +begin
  +  Result := AsType<Single>;
  +end;
  +
   function TValueHelper.Equals(const value : TValue) : boolean;
   begin
  -  if Self.IsEmpty and value.IsEmpty then
  -    exit(true);
  -
  -  //Is this too simplistic??
  -  Exit(SameText(Self.ToString, value.ToString));
  -
  -
  -//
  -//  if value.IsEmpty then
  -//    exit;
  -//
  -//  //check the type
  -//  if Self.Kind <> value.Kind then
  -//    exit;
  -//
  -//  if (Self.IsObject and Value.IsObject) then
  -//    Exit(Self.AsObject = Value.AsObject);
  -//
  -//  if (Self.IsOrdinal and Value.IsOrdinal) then
  -//    Exit(Self.AsOrdinal = Value.AsOrdinal);
  -//
  -//  if (Self.IsClass and value.IsClass) then
  -//    Exit(Self.AsClass = value.AsClass);
  -//
  -//  //not sure if this is right.
  -//  if (Self.Kind = tkInterface) and (value.Kind = tkInterface) then
  -//    Exit(Pointer(Self.AsInterface) = Pointer(Value.AsInterface));
  -//
  -//  if (Self.Kind in [tkUString,tkString]) and (value.Kind in [tkUString,tkString]) then
  -//    Exit(SameText(Self.AsString,value.AsString));
  -//
  -//  if (Self.Kind = tkVariant) and (value.Kind = tkVariant) then
  -//    result := Self.AsVariant = value.AsVariant;
  -//
  -
  +  result := SameValue(Self, value);
  +end;
  +
  +function TValueHelper.IsBoolean: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Boolean);
  +end;
  +
  +function TValueHelper.IsByte: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Byte);
  +end;
  +
  +function TValueHelper.IsCardinal: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Cardinal);
  +end;
  +
  +function TValueHelper.IsCurrency: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Currency);
  +end;
  +
  +function TValueHelper.IsDate: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(TDate);
  +end;
  +
  +function TValueHelper.IsDateTime: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(TDateTime);
  +end;
  +
  +function TValueHelper.IsDouble: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Double);
  +end;
  +
  +function TValueHelper.IsFloat: Boolean;
  +begin
  +  Result := Kind = tkFloat;
  +end;
  +
  +function TValueHelper.IsInt64: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Int64);
  +end;
  +
  +function TValueHelper.IsInteger: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Integer);
  +end;
  +
  +function TValueHelper.IsNumeric: Boolean;
  +begin
  +  Result := Kind in [tkInteger, tkChar, tkEnumeration, tkFloat, tkWChar, tkInt64];
  +end;
  +
  +function TValueHelper.IsPointer: Boolean;
  +begin
  +  Result := Kind = tkPointer;
  +end;
  +
  +function TValueHelper.IsShortInt: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(ShortInt);
  +end;
  +
  +function TValueHelper.IsSingle: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Single);
  +end;
  +
  +function TValueHelper.IsSmallInt: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(SmallInt);
  +end;
  +
  +function TValueHelper.IsString: Boolean;
  +begin
  +  Result := Kind in [tkChar, tkString, tkWChar, tkLString, tkWString, tkUString];
  +end;
  +
  +function TValueHelper.IsTime: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(TTime);
  +end;
  +
  +function TValueHelper.IsUInt64: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(UInt64);
  +end;
  +
  +function TValueHelper.IsWord: Boolean;
  +begin
  +  Result := TypeInfo = System.TypeInfo(Word);
   end;
   
   { TRttiTypeHelper }
  
positive.code: {                                                                           }
  {***************************************************************************}
  
  unit Delphi.Mocks.Helpers;
  
  interface
  
negative.code:   Rtti;
  
  type
    //TValue really needs to have an Equals operator overload!
    TValueHelper = record helper for TValue
      function Equals(const value : TValue) : boolean;
      function IsFloat: Boolean;
      function IsNumeric: Boolean;
      function IsPointer: Boolean;
      function IsString: Boolean;
      function IsBoolean: Boolean;
      function IsByte: Boolean;
      function IsCardinal: Boolean;
      function IsCurrency: Boolean;
      function IsDate: Boolean;
      function IsDateTime: Boolean;
      function IsDouble: Boolean;
      function IsInteger: Boolean;
      function IsInt64: Boolean;
      function IsShortInt: Boolean;
      function IsSingle: Boolean;
      function IsSmallInt: Boolean;
      function IsTime: Boolean;
      function IsUInt64: Boolean;
      function IsWord: Boolean;
      function AsDouble: Double;
      function AsFloat: Extended;
      function AsSingle: Single;
      function AsPointer: Pointer;
    end;
  
  
  