|
From: Owen R. <exo...@us...> - 2004-09-17 03:33:58
|
Update of /cvsroot/nmock/nmock/src/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9698/src/NMock Modified Files: DynamicMock.cs Method.cs Mock.cs MockCall.cs SingleMethod.cs TypeCheckedMock.cs VerifyException.cs Added Files: DefaultSignature.cs ISignature.cs Removed Files: MethodSignature.cs Log Message: - committing jim's changes to add support for mocking methods with ref arguments - refactored signature class to encapsulate methods and properties Index: Method.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/Method.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Method.cs 24 Aug 2004 21:15:28 -0000 1.7 --- Method.cs 17 Sep 2004 03:33:46 -0000 1.8 *************** *** 8,16 **** private static object NO_RETURN_VALUE = new object(); ! private MethodSignature signature; private int timesCalled = 0; private CallSequence expectations; ! public Method(MethodSignature signature) { this.signature = signature; --- 8,16 ---- private static object NO_RETURN_VALUE = new object(); ! private ISignature signature; private int timesCalled = 0; private CallSequence expectations; ! public Method(ISignature signature) { this.signature = signature; *************** *** 28,32 **** } ! public virtual void SetExpectation(MockCall aCall) { expectations.Add(aCall); --- 28,32 ---- } ! public virtual void SetExpectation(MockCall aCall) { expectations.Add(aCall); *************** *** 40,44 **** } ! public virtual void Verify() { if (expectations.CountExpectedCalls > timesCalled) --- 40,44 ---- } ! public virtual void Verify() { if (expectations.CountExpectedCalls > timesCalled) *************** *** 54,67 **** public class CallSequence { ! private MethodSignature signature; private ArrayList sequence = new ArrayList(); ! public CallSequence(MethodSignature signature) { this.signature = signature; } public MockCall this[int timesCalled] { ! get { if (sequence.Count <= timesCalled) --- 54,68 ---- public class CallSequence { ! private ISignature signature; private ArrayList sequence = new ArrayList(); ! public CallSequence(ISignature signature) { this.signature = signature; } + public MockCall this[int timesCalled] { ! get { if (sequence.Count <= timesCalled) *************** *** 69,76 **** throw VerifyException.TooManyCalls(signature, sequence.Count, timesCalled + 1); } ! return (MockCall)sequence[timesCalled]; } } ! public int Count { get { return sequence.Count; } --- 70,78 ---- throw VerifyException.TooManyCalls(signature, sequence.Count, timesCalled + 1); } ! return (MockCall) sequence[timesCalled]; } } ! ! public int Count { get { return sequence.Count; } *************** *** 79,86 **** public int CountExpectedCalls { ! get { int count = 0; ! foreach (Object mockCall in sequence) { if (! (mockCall is MockNoCall)) --- 81,88 ---- public int CountExpectedCalls { ! get { int count = 0; ! foreach (Object mockCall in sequence) { if (! (mockCall is MockNoCall)) *************** *** 89,97 **** } } ! return count; } } ! public void Add(MockCall aCall) { sequence.Add(aCall); --- 91,99 ---- } } ! return count; } } ! public void Add(MockCall aCall) { sequence.Add(aCall); *************** *** 100,102 **** } ! } --- 102,104 ---- } ! } \ No newline at end of file --- MethodSignature.cs DELETED --- Index: DynamicMock.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/DynamicMock.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** DynamicMock.cs 24 Aug 2004 21:15:28 -0000 1.23 --- DynamicMock.cs 17 Sep 2004 03:33:30 -0000 1.24 *************** *** 1,19 **** using System; using System.Collections; - using System.Reflection; - using NMock.Dynamic; namespace NMock { ! public class DynamicMock : TypeCheckedMock { private object mockInstance; private IList ignoredMethodNames; private readonly Type superclassIfTypeIsInterface; - - public DynamicMock(Type type) : this(type, "Mock" + type.Name) {} ! public DynamicMock(Type type, string name) : this (type, name, null) {} public DynamicMock(Type type, string name, Type superclassIfTypeIsInterface) : base(type, name) --- 1,21 ---- using System; using System.Collections; using NMock.Dynamic; namespace NMock { ! public class DynamicMock : TypeCheckedMock { private object mockInstance; private IList ignoredMethodNames; private readonly Type superclassIfTypeIsInterface; ! public DynamicMock(Type type) : this(type, "Mock" + type.Name) ! { ! } ! ! public DynamicMock(Type type, string name) : this(type, name, null) ! { ! } public DynamicMock(Type type, string name, Type superclassIfTypeIsInterface) : base(type, name) *************** *** 25,29 **** public override object MockInstance { ! get { if (mockInstance == null) --- 27,31 ---- public override object MockInstance { ! get { if (mockInstance == null) *************** *** 38,51 **** /// Don't generate mock method for suppied methodName. /// </summary> ! public virtual void Ignore(string methodName) { ignoredMethodNames.Add(methodName); } ! protected override void ValidateMethodInfo(MethodInfo methodInfo) { ! if(!methodInfo.IsVirtual) throw new ArgumentException( ! string.Format("method <{0}> is not virtual", methodInfo.Name)); } --- 40,53 ---- /// Don't generate mock method for suppied methodName. /// </summary> ! public virtual void Ignore(string methodName) { ignoredMethodNames.Add(methodName); } ! protected override void ValidateSignature(ISignature signature) { ! if (!signature.IsVirtual) throw new ArgumentException( ! string.Format("method <{0}> is not virtual", signature)); } *************** *** 55,57 **** } } ! } --- 57,59 ---- } } ! } \ No newline at end of file --- NEW FILE: DefaultSignature.cs --- using System; using System.Text; using NMock.Constraints; namespace NMock { public class DefaultSignature : ISignature { private string typeName; private string methodName; private Type[] argumentTypes; public DefaultSignature(string typeName, string methodName, params Type[] argumentTypes) { this.typeName = typeName; this.methodName = methodName; this.argumentTypes = argumentTypes; } public string TypeName { get { return typeName; } } public string MethodName { get { return methodName; } } public Type[] ArgumentTypes { get { return argumentTypes; } } public Type ReturnType { get { throw new NotImplementedException(); } } public override string ToString() { StringBuilder argumentList = new StringBuilder(); foreach (Type type in ArgumentTypes) { if (argumentList.Length > 0) argumentList.Append(", "); if (typeof(IConstraint).IsAssignableFrom(type)) { argumentList.Append("<constraint>"); } else { argumentList.Append(type.FullName); } } return string.Format("{0}.{1}({2})", TypeName, MethodName, argumentList); } public bool HasAConstraintArgument { get { foreach(Type argType in ArgumentTypes) { if(typeof(IConstraint).IsAssignableFrom(argType)) return true; } return false; } } public bool IsVirtual { get { return false; } } } } Index: VerifyException.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/VerifyException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VerifyException.cs 24 Aug 2004 16:00:24 -0000 1.3 --- VerifyException.cs 17 Sep 2004 03:33:46 -0000 1.4 *************** *** 7,30 **** public class VerifyException : Exception { - private string reason; private string expected; private object actual; - ! public VerifyException(MethodSignature signature, string reason) { this.reason = signature + " " + reason; } ! public VerifyException(MethodSignature signature, string reason, ! object expected, object actual) : this(signature, reason) { this.expected = "<" + expected + ">"; this.actual = actual; } ! ! public VerifyException(MethodSignature signature, ! IConstraint constraint, object actual, int index) { reason = string.Format("{0} called with incorrect parameter ({1})", signature, index + 1); --- 7,26 ---- public class VerifyException : Exception { private string reason; private string expected; private object actual; ! public VerifyException(ISignature signature, string reason) { this.reason = signature + " " + reason; } ! public VerifyException(ISignature signature, string reason, object expected, object actual) : this(signature, reason) { this.expected = "<" + expected + ">"; this.actual = actual; } ! ! public VerifyException(ISignature signature, IConstraint constraint, object actual, int index) { reason = string.Format("{0} called with incorrect parameter ({1})", signature, index + 1); *************** *** 32,39 **** this.actual = constraint.ExtractActualValue(actual); } - ! public static VerifyException TooManyCalls(MethodSignature signature, ! int expected, int actual) { if (expected >= actual) --- 28,34 ---- this.actual = constraint.ExtractActualValue(actual); } ! ! public static VerifyException TooManyCalls(ISignature signature, int expected, int actual) { if (expected >= actual) *************** *** 45,50 **** } ! public static VerifyException NotEnoughCalls(MethodSignature signature, ! int expected, int actual) { if (expected <= actual) --- 40,44 ---- } ! public static VerifyException NotEnoughCalls(ISignature signature, int expected, int actual) { if (expected <= actual) *************** *** 52,56 **** throw new ArgumentException("expected <= actual"); } ! string message = (actual == 0)? "never called" : "not called enough times"; return new VerifyException(signature, message, expected, actual); } --- 46,50 ---- throw new ArgumentException("expected <= actual"); } ! string message = (actual == 0) ? "never called" : "not called enough times"; return new VerifyException(signature, message, expected, actual); } *************** *** 61,79 **** get { return reason; } } ! public object Expected { get { return expected; } } ! public object Actual { get { return actual; } } ! public override string Message { ! get ! { StringBuilder message = new StringBuilder(); message.AppendFormat("\n\t{0}", reason); --- 55,73 ---- get { return reason; } } ! public object Expected { get { return expected; } } ! public object Actual { get { return actual; } } ! public override string Message { ! get ! { StringBuilder message = new StringBuilder(); message.AppendFormat("\n\t{0}", reason); *************** *** 87,89 **** } } ! } --- 81,83 ---- } } ! } \ No newline at end of file Index: TypeCheckedMock.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/TypeCheckedMock.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypeCheckedMock.cs 24 Aug 2004 21:15:28 -0000 1.1 --- TypeCheckedMock.cs 17 Sep 2004 03:33:46 -0000 1.2 *************** *** 1,5 **** using System; using System.Reflection; - using NMock.Dynamic; --- 1,4 ---- *************** *** 17,86 **** public Type MockedType { ! get ! { ! return type; ! } } public override void SetupResult(string methodName, object returnVal, params Type[] argTypes) { ! MethodSignature signature = new MethodSignature(Name, methodName, argTypes); CheckReturnTypeIsValid(signature, returnVal); SetupResult(signature, returnVal); } ! protected override IMethod getMethod(MethodSignature signature) { - CheckMethodIsValidIfNoConstraints(signature); return base.getMethod(signature); } ! protected void CheckReturnTypeIsValid(MethodSignature signature, object returnVal) { if (returnVal == null) return; ! if (signature.HasAConstraintArgument) return; ! Type realReturnType = GetReturnTypeForSignature(signature); if (!realReturnType.IsAssignableFrom(returnVal.GetType())) { throw new ArgumentException( string.Format("method <{0}> should return a {1}", ! signature, realReturnType)); ! } ! } ! ! protected void CheckMethodIsValidIfNoConstraints(MethodSignature signature) ! { ! if (signature.HasAConstraintArgument) ! return; ! ! GetReturnTypeForSignature(signature); ! } ! ! protected Type GetReturnTypeForSignature(MethodSignature signature) ! { ! foreach (Type t in new InterfaceLister().List(MockedType)) ! { ! MethodInfo method = FindMatchingMethodIn(signature, t); ! if (method != null) ! return method.ReturnType; ! ! PropertyInfo property = FindMatchingPropertyOn(signature, t); ! if (property != null) ! return property.PropertyType; } - - throw new MissingMethodException( - string.Format("method <{0}> not defined", signature)); } ! ! internal static string StripGetSetPrefix(string methodName) { ! if (methodName.StartsWith("get_") || methodName.StartsWith("set_")) { methodName = methodName.Substring(4); --- 16,61 ---- public Type MockedType { ! get { return type; } } public override void SetupResult(string methodName, object returnVal, params Type[] argTypes) { ! ISignature signature = CreateMethodSignature(methodName, argTypes); CheckReturnTypeIsValid(signature, returnVal); SetupResult(signature, returnVal); } + protected override ISignature CreateMethodSignature(string methodName, Type[] args) + { + ISignature signature = new SignatureFactory(MockedType).CreateMethodSignature(methodName, args); + ValidateSignature(signature); + return signature; + } ! protected override IMethod getMethod(ISignature signature) { return base.getMethod(signature); } ! protected void CheckReturnTypeIsValid(ISignature signature, object returnVal) { if (returnVal == null) return; ! if (signature.HasAConstraintArgument) return; ! Type realReturnType = signature.ReturnType; if (!realReturnType.IsAssignableFrom(returnVal.GetType())) { throw new ArgumentException( string.Format("method <{0}> should return a {1}", ! signature, realReturnType)); } } ! internal static string StripGetSetPrefix(string methodName) { ! if (methodName.StartsWith("get_") || methodName.StartsWith("set_")) { methodName = methodName.Substring(4); *************** *** 90,164 **** } ! ! private PropertyInfo FindMatchingPropertyOn(MethodSignature signature, Type type) ! { ! return type.GetProperty( ! signature.MethodName, ClassGenerator.ALL_INSTANCE_METHODS); ! } ! ! private MethodInfo FindMatchingMethodIn(MethodSignature signature, Type type) ! { ! foreach (MethodInfo methodInfo in type.GetMethods(ClassGenerator.ALL_INSTANCE_METHODS)) ! { ! if (MatchesNameAndAllNonNullArguments(signature, methodInfo)) ! { ! return methodInfo; ! } ! } ! return null; ! } ! ! private bool IsPropertyOn(MethodSignature signature, Type type) ! { ! return type.GetProperty(signature.MethodName, ! ClassGenerator.ALL_INSTANCE_METHODS) != null; ! } ! ! private bool HasMatchingMethodIn(MethodSignature signature, Type type) ! { ! foreach (MethodInfo methodInfo in type.GetMethods(ClassGenerator.ALL_INSTANCE_METHODS)) ! { ! if (MatchesNameAndAllNonNullArguments(signature, methodInfo)) ! { ! return true; ! } ! } ! return false; ! } ! ! private bool MatchesNameAndAllNonNullArguments(MethodSignature signature, MethodInfo methodInfo) ! { ! if (!signature.MethodName.Equals(methodInfo.Name)) ! return false; ! ! if (! MatchNonNullArguments(signature, methodInfo.GetParameters())) ! return false; ! ! ValidateMethodInfo(methodInfo); ! return true; ! } ! ! private bool MatchNonNullArguments(MethodSignature signature, ParameterInfo[] parameters) ! { ! if ( signature.ArgumentTypes.Length != parameters.Length ) ! return false; ! ! for ( int pi=0; pi<parameters.Length; pi++ ) ! { ! Type argumentType = signature.ArgumentTypes[pi]; ! if (argumentType == null) ! continue; ! ! Type parameterType = parameters[pi].ParameterType; ! if (!parameterType.IsAssignableFrom(argumentType)) ! return false; ! } ! return true; ! } ! ! ! protected virtual void ValidateMethodInfo(MethodInfo methodInfo) { } } ! } --- 65,71 ---- } ! protected virtual void ValidateSignature(ISignature signature) { } } ! } \ No newline at end of file Index: SingleMethod.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/SingleMethod.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SingleMethod.cs 24 Aug 2004 21:15:28 -0000 1.4 --- SingleMethod.cs 17 Sep 2004 03:33:46 -0000 1.5 *************** *** 6,14 **** public class SingleMethod : IMethod { ! private MethodSignature signature; private MockCall expectation; private int timesCalled = 0; ! public SingleMethod(MethodSignature signature) { this.signature = signature; --- 6,14 ---- public class SingleMethod : IMethod { ! private DefaultSignature signature; private MockCall expectation; private int timesCalled = 0; ! public SingleMethod(DefaultSignature signature) { this.signature = signature; Index: MockCall.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/MockCall.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MockCall.cs 24 Aug 2004 21:15:28 -0000 1.9 --- MockCall.cs 17 Sep 2004 03:33:46 -0000 1.10 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Reflection; using NMock.Constraints; *************** *** 6,15 **** public class MockCall { ! protected MethodSignature signature; private IConstraint[] expectedArgs; private object returnValue; private Exception e; ! public MockCall(MethodSignature signature, object returnValue, Exception e, object[] expectedArgs) { this.signature = signature; --- 7,16 ---- public class MockCall { ! protected ISignature signature; private IConstraint[] expectedArgs; private object returnValue; private Exception e; ! public MockCall(ISignature signature, object returnValue, Exception e, object[] expectedArgs) { this.signature = signature; *************** *** 53,57 **** public virtual object Call(string methodName, object[] actualArgs) { ! checkArguments(methodName, actualArgs); if (e != null) --- 54,58 ---- public virtual object Call(string methodName, object[] actualArgs) { ! checkArguments(actualArgs); if (e != null) *************** *** 63,67 **** } ! private void checkArguments(string methodName, object[] actualArgs) { if ( HasExpectations ) --- 64,68 ---- } ! private void checkArguments(object[] actualArgs) { if ( HasExpectations ) *************** *** 72,81 **** for (int i = 0; i < expectedArgs.Length; i++) { ! checkConstraint(methodName, expectedArgs[i], actualArgs[i], i); } } } ! private void checkConstraint(string methodName, IConstraint expected, object actual, int index) { if (!expected.Eval(actual)) --- 73,82 ---- for (int i = 0; i < expectedArgs.Length; i++) { ! checkConstraint(expectedArgs[i], actualArgs[i], i); } } } ! private void checkConstraint(IConstraint expected, object actual, int index) { if (!expected.Eval(actual)) *************** *** 107,115 **** return result; } } public class MockNoCall : MockCall { ! public MockNoCall(MethodSignature signature) : base(signature, null, null, null) { } --- 108,129 ---- return result; } + + public static Type[] GetArgTypes(MethodBase method) + { + ParameterInfo[] parameters = method.GetParameters(); + Type[] argTypes = new Type[parameters.Length]; + + for(int i = 0; i < parameters.Length; i++) + { + argTypes[i] = parameters[i].ParameterType; + } + + return argTypes; + } } public class MockNoCall : MockCall { ! public MockNoCall(ISignature signature) : base(signature, null, null, null) { } --- NEW FILE: ISignature.cs --- using System; namespace NMock { public interface ISignature { string TypeName { get; } string MethodName { get; } Type[] ArgumentTypes { get; } Type ReturnType { get; } bool HasAConstraintArgument { get; } bool IsVirtual { get; } } } Index: Mock.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/Mock.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Mock.cs 26 Aug 2004 10:19:11 -0000 1.17 --- Mock.cs 17 Sep 2004 03:33:46 -0000 1.18 *************** *** 1,8 **** using System; using System.Collections; - using System.Reflection; - using NMock.Constraints; ! namespace NMock { public class Mock : IMock --- 1,6 ---- using System; using System.Collections; ! namespace NMock { public class Mock : IMock *************** *** 12,17 **** private bool strict; protected IDictionary methods; ! ! public Mock(string name) { this.name = name; --- 10,15 ---- private bool strict; protected IDictionary methods; ! ! public Mock(string name) { this.name = name; *************** *** 19,28 **** } ! public virtual string Name { get { return name; } set { name = value; } } ! public virtual object MockInstance { --- 17,26 ---- } ! public virtual string Name { get { return name; } set { name = value; } } ! public virtual object MockInstance { *************** *** 36,41 **** set { strict = value; } } ! ! public virtual void Expect(string methodName, params object[] args) { ExpectAndReturn(methodName, null, args); --- 34,39 ---- set { strict = value; } } ! ! public virtual void Expect(string methodName, params object[] args) { ExpectAndReturn(methodName, null, args); *************** *** 44,65 **** public virtual void ExpectNoCall(string methodName, params Type[] argTypes) { ! addExpectation(methodName, new MockNoCall(new MethodSignature(Name, methodName, argTypes))); } ! public virtual void ExpectAndReturn(string methodName, object result, params object[] args) { ! addExpectation(methodName, ! new MockCall(new MethodSignature(Name, methodName, MockCall.GetArgTypes(args)), result, null, args)); } ! public virtual void ExpectAndThrow(string methodName, Exception e, params object[] args) { ! addExpectation(methodName, ! new MockCall(new MethodSignature(Name, methodName, MockCall.GetArgTypes(args)), null, e, args)); } private void addExpectation(string methodName, MockCall call) { ! MethodSignature signature = new MethodSignature(Name, methodName, call.ArgTypes); IMethod method = getMethod(signature); if (method == null) --- 42,61 ---- public virtual void ExpectNoCall(string methodName, params Type[] argTypes) { ! addExpectation(methodName, new MockNoCall(CreateMethodSignature(methodName, argTypes))); } ! public virtual void ExpectAndReturn(string methodName, object result, params object[] args) { ! addExpectation(methodName, new MockCall(CreateMethodSignature(methodName, MockCall.GetArgTypes(args)), result, null, args)); } ! public virtual void ExpectAndThrow(string methodName, Exception e, params object[] args) { ! addExpectation(methodName, new MockCall(CreateMethodSignature(methodName, MockCall.GetArgTypes(args)), null, e, args)); } private void addExpectation(string methodName, MockCall call) { ! ISignature signature = CreateMethodSignature(methodName, call.ArgTypes); IMethod method = getMethod(signature); if (method == null) *************** *** 70,80 **** method.SetExpectation(call); } ! public virtual void SetupResult(string methodName, object returnVal, params Type[] argTypes) { ! SetupResult(new MethodSignature(Name, methodName, argTypes), returnVal); } ! protected void SetupResult(MethodSignature signature, object returnVal) { IMethod method = getMethod(signature); --- 66,76 ---- method.SetExpectation(call); } ! public virtual void SetupResult(string methodName, object returnVal, params Type[] argTypes) { ! SetupResult(CreateMethodSignature(methodName, argTypes), returnVal); } ! protected void SetupResult(ISignature signature, object returnVal) { IMethod method = getMethod(signature); *************** *** 84,97 **** methods[signature.MethodName] = method; } ! method.SetExpectation(new MockCall(signature, returnVal, null, null)); } ! ! public virtual object Invoke(string methodName, params object[] args) { ! MethodSignature signature = new MethodSignature(Name, methodName, MockCall.GetArgTypes(args)); IMethod method = getMethod(signature); if (method == null) { ! if (strict) { throw VerifyException.TooManyCalls(signature, 0, 1); --- 80,93 ---- methods[signature.MethodName] = method; } ! method.SetExpectation(new MockCall(signature, returnVal, null, null)); } ! ! public virtual object Invoke(string methodName, params object[] args) { ! ISignature signature = CreateMethodSignature(methodName, MockCall.GetArgTypes(args)); IMethod method = getMethod(signature); if (method == null) { ! if (strict) { throw VerifyException.TooManyCalls(signature, 0, 1); *************** *** 102,106 **** } ! public virtual void Verify() { foreach (IMethod method in methods.Values) --- 98,102 ---- } ! public virtual void Verify() { foreach (IMethod method in methods.Values) *************** *** 110,123 **** } ! protected virtual IMethod getMethod(MethodSignature signature) { ! return (IMethod)methods[signature.MethodName]; } ! public class Assertion { ! public static void Assert(MethodSignature signature, string message, bool expression) { ! if (!expression) { throw new VerifyException(signature, message); --- 106,124 ---- } ! protected virtual ISignature CreateMethodSignature(string methodName, Type[] args) { ! return new DefaultSignature(Name, methodName, args); } ! ! protected virtual IMethod getMethod(ISignature signature) ! { ! return (IMethod) methods[signature.MethodName]; ! } ! public class Assertion { ! public static void Assert(DefaultSignature signature, string message, bool expression) { ! if (!expression) { throw new VerifyException(signature, message); *************** *** 125,132 **** } ! public static void AssertEquals(MethodSignature signature, string message, ! object expected, object actual) { ! if (!expected.Equals(actual)) { throw new VerifyException(signature, message, expected, actual); --- 126,132 ---- } ! public static void AssertEquals(ISignature signature, string message, object expected, object actual) { ! if (!expected.Equals(actual)) { throw new VerifyException(signature, message, expected, actual); *************** *** 135,137 **** } } ! } --- 135,137 ---- } } ! } \ No newline at end of file |