From: Joe W. <joe...@us...> - 2002-10-14 18:43:33
|
Update of /cvsroot/mockobjects/nmock/src/NMock In directory usw-pr-cvs1:/tmp/cvs-serv6916/src/NMock Modified Files: Mock.cs Added Files: VerifyException.cs Log Message: Decoupled from NUnit. Use testing framework of choice. --- NEW FILE: VerifyException.cs --- using System; namespace NMock { public class VerifyException : Exception { public VerifyException(string msg) : base(msg) { } } } Index: Mock.cs =================================================================== RCS file: /cvsroot/mockobjects/nmock/src/NMock/Mock.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Mock.cs 6 Oct 2002 22:57:48 -0000 1.2 +++ Mock.cs 14 Oct 2002 18:43:29 -0000 1.3 @@ -1,6 +1,5 @@ using System; using System.Collections; -using NUnit.Framework; namespace NMock { @@ -134,7 +133,31 @@ return returnValue; } } - + + private class Assertion + { + public static void Assert(bool expression) + { + if (!expression) + { + Fail("Verification failed."); + } + } + + public static void AssertEquals(object a, object b) + { + if (! a.Equals(b)) + { + Fail("Verification failed."); + } + } + + public static void Fail(string msg) + { + throw new VerifyException(msg); + } + } + } |