Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/Predicates
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16618/DotNetMock/Dynamic/Predicates
Modified Files:
IsEqual.cs IsNull.cs
Log Message:
RFE 1108902 - The cheapest way to make the error messages nicer.
- Identify the method call that failed and the argument index that failed.
- For a couple predicates (IsNull & IsEqual) provide more info through the ToString() method.
- Need to add more ToString implementations for the rest of the predicates.
- Roman's MethodCall abstraction is useful here. stringification of method calls could be done there.
Index: IsEqual.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/Predicates/IsEqual.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** IsEqual.cs 1 Jan 2005 21:13:54 -0000 1.5
--- IsEqual.cs 16 Feb 2005 10:39:26 -0000 1.6
***************
*** 17,20 ****
--- 17,30 ----
_compare = compare;
}
+
+ /// <summary>
+ /// The condition this evaluates as text.
+ /// </summary>
+ /// <returns>"value equals (xxx)"</returns>
+ public override string ToString()
+ {
+ return String.Format("value equals ({0})", _compare);
+ }
+
/// <summary>
/// Evaluates input value against original value for equality
Index: IsNull.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/Predicates/IsNull.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IsNull.cs 1 Jan 2005 21:13:54 -0000 1.3
--- IsNull.cs 16 Feb 2005 10:39:26 -0000 1.4
***************
*** 7,10 ****
--- 7,19 ----
{
/// <summary>
+ /// The condition this evaluates as text.
+ /// </summary>
+ /// <returns>"value is null"</returns>
+ public override string ToString()
+ {
+ return "value is null";
+ }
+
+ /// <summary>
/// Evaluates the input value against null
/// </summary>
|