From: <gc...@us...> - 2003-04-01 01:44:02
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory sc8-pr-cvs1:/tmp/cvs-serv20364/DotNetMock.Tests Modified Files: AssemblyInfo.cs ExpectationArrayListTests.cs ExpectationBoolTests.cs ExpectationCounterTests.cs ExpectationStringTests.cs ExpectationValueTests.cs MockObjectTests.cs NullTests.cs Log Message: Comments and multiple changes Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/AssemblyInfo.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AssemblyInfo.cs 7 Oct 2002 00:09:45 -0000 1.1 --- AssemblyInfo.cs 1 Apr 2003 01:43:58 -0000 1.2 *************** *** 10,14 **** [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] - [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] --- 10,13 ---- Index: ExpectationArrayListTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationArrayListTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExpectationArrayListTests.cs 25 Oct 2002 03:56:52 -0000 1.3 --- ExpectationArrayListTests.cs 1 Apr 2003 01:43:58 -0000 1.4 *************** *** 69,73 **** [Test] ! public void HasNotExpectations() { _expectationArrayList.AddActual("A"); --- 69,73 ---- [Test] ! public void HasNoExpectations() { _expectationArrayList.AddActual("A"); *************** *** 100,104 **** NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } ! catch (NUnit.Framework.AssertionException ex) { } --- 100,104 ---- NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } ! catch { } Index: ExpectationBoolTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationBoolTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExpectationBoolTests.cs 25 Oct 2002 03:02:26 -0000 1.2 --- ExpectationBoolTests.cs 1 Apr 2003 01:43:58 -0000 1.3 *************** *** 64,68 **** NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } ! catch (NUnit.Framework.AssertionException ex) { } --- 64,68 ---- NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } ! catch { } Index: ExpectationCounterTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationCounterTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExpectationCounterTests.cs 25 Oct 2002 03:02:26 -0000 1.2 --- ExpectationCounterTests.cs 1 Apr 2003 01:43:58 -0000 1.3 *************** *** 1,10 **** ! namespace DotNetMock.Tests { ! using System; ! using NUnit.Framework; ! ! ! /// <summary> ! /// Test case for ExpectationCounter ! /// </summary> [TestFixture] public class ExpectationCounterTests { --- 1,7 ---- ! using System; ! using NUnit.Framework; ! ! namespace DotNetMock.Tests ! { [TestFixture] public class ExpectationCounterTests { *************** *** 12,18 **** private ExpectationCounter _counter; - public ExpectationCounterTests(): base() {} - public ExpectationCounterTests(String name) : base() {} - [SetUp] public void SetUp() --- 9,12 ---- *************** *** 57,82 **** [Test] public void FailOnVerify() { _counter.Expected = 1; _counter.Inc(); ! ! try ! { ! _counter.Inc(); ! } ! catch(AssertionException ae) ! { ! Assertion.Fail("Should not have thrown an exception"); ! } ! ! try ! { ! _counter.Verify(); ! NUnit.Framework.Assertion.Fail("Should have thrown an exception."); ! } ! catch(AssertionException ae) ! { ! } } --- 51,61 ---- [Test] + [ExpectedException(typeof(AssertionException))] public void FailOnVerify() { _counter.Expected = 1; _counter.Inc(); ! _counter.Inc(); ! _counter.Verify(); } Index: ExpectationStringTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationStringTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExpectationStringTests.cs 25 Oct 2002 03:56:52 -0000 1.3 --- ExpectationStringTests.cs 1 Apr 2003 01:43:58 -0000 1.4 *************** *** 11,16 **** { ExpectationString _expectationString = null; - public ExpectationStringTests(string name) : base() {} - public ExpectationStringTests() : base() {} [SetUp] --- 11,14 ---- *************** *** 34,37 **** --- 32,36 ---- _expectationString.Actual = test1; NUnit.Framework.Assertion.AssertNotNull(_expectationString.Actual); + Assertion.AssertEquals(test1, _expectationString.Actual); _expectationString.ClearActual(); NUnit.Framework.Assertion.AssertNull(_expectationString.Actual); *************** *** 59,62 **** --- 58,62 ---- _expectationString.Expected = test3; NUnit.Framework.Assertion.AssertNotNull(_expectationString.Expected); + Assertion.AssertEquals(test3, _expectationString.Expected); NUnit.Framework.Assertion.Assert(_expectationString.HasExpectations); *************** *** 65,69 **** [Test] - [ExpectedException(typeof(AssertionException))] public void Verify() { --- 65,68 ---- *************** *** 75,79 **** _expectationString.Expected = test5; ! _expectationString.Verify(); _expectationString.Expected = test6; --- 74,84 ---- _expectationString.Expected = test5; ! try ! { ! _expectationString.Verify(); ! } ! catch ! { ! } _expectationString.Expected = test6; Index: ExpectationValueTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationValueTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExpectationValueTests.cs 25 Oct 2002 03:56:52 -0000 1.3 --- ExpectationValueTests.cs 1 Apr 2003 01:43:58 -0000 1.4 *************** *** 12,18 **** private ExpectationValue _expectationValue; - public ExpectationValueTests(string name) : base() {} - public ExpectationValueTests() : base() {} - [SetUp] public void SetUp() { --- 12,15 ---- Index: MockObjectTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/MockObjectTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MockObjectTests.cs 25 Oct 2002 03:02:26 -0000 1.2 --- MockObjectTests.cs 1 Apr 2003 01:43:58 -0000 1.3 *************** *** 1,8 **** namespace DotNetMock.Tests { - using System; - using NUnit.Framework; - using DotNetMock; - /// <summary> /// Summary description for MockObjectTests. --- 1,9 ---- + + using System; + using NUnit.Framework; + using DotNetMock; + namespace DotNetMock.Tests { /// <summary> /// Summary description for MockObjectTests. *************** *** 14,28 **** [SetUp] ! public void SetUp() { _mockObject = new MockObject(); } ! [ExpectedException(typeof(NotImplementedException))] public void NotImplemented() { _mockObject.NotImplemented("Fake Class Name"); - NUnit.Framework.Assertion.Fail("Assertion Failed: NotImplemented"); - } --- 15,31 ---- [SetUp] ! public void Init() { _mockObject = new MockObject(); } ! [TearDown] ! public void Destroy() ! { ! _mockObject = null; ! } [ExpectedException(typeof(NotImplementedException))] public void NotImplemented() { _mockObject.NotImplemented("Fake Class Name"); } *************** *** 43,47 **** _mockObject.AssertEquals("", object1, object2); - NUnit.Framework.Assertion.Fail("Assertion Failed: testAssertFalse"); } --- 46,49 ---- *************** *** 57,61 **** { _mockObject.AssertTrue("", false); - throw new System.ApplicationException("Assertion Failed: testAssertFalse"); } --- 59,62 ---- *************** *** 65,77 **** { _mockObject.Fail("Failed"); - NUnit.Framework.Assertion.Fail("Assertion Failed: testFail"); } - - [Test] - public void Verify() - { - _mockObject.Verify(); - } - } } --- 66,70 ---- Index: NullTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/NullTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullTests.cs 30 Oct 2002 04:16:33 -0000 1.3 --- NullTests.cs 1 Apr 2003 01:43:58 -0000 1.4 *************** *** 1,7 **** namespace DotNetMock.Tests { - using System; - using NUnit.Framework; - using DotNetMock; /// <summary> /// Summary description for Null Class. --- 1,8 ---- + using System; + using NUnit.Framework; + using DotNetMock; + namespace DotNetMock.Tests { /// <summary> /// Summary description for Null Class. *************** *** 11,37 **** { private NullObject _null = null; - - public NullTests(string name) : base() {} - public NullTests() : base() {} [SetUp] ! public void SetUp() { _null = new NullObject(); } [TearDown] ! public void TearDown() { _null = null; } [Test] ! public void Null() { ! NUnit.Framework.Assertion.AssertEquals("null", _null.ToString()); ! _null = new NullObject("Null Object"); ! NUnit.Framework.Assertion.AssertEquals("Null Object", _null.ToString()); NullObject null2 = new NullObject(); int int1 = 3; NUnit.Framework.Assertion.Assert(!_null.Equals(int1)); NUnit.Framework.Assertion.Assert(_null.Equals(null2)); } } --- 12,40 ---- { private NullObject _null = null; [SetUp] ! public void Init() { _null = new NullObject(); } [TearDown] ! public void Destroy() { _null = null; } [Test] ! public void NullObjectMethods() { ! Assertion.AssertEquals("null", _null.ToString()); ! _null.Name = "Null Object"; ! Assertion.AssertEquals("Null Object", _null.ToString()); NullObject null2 = new NullObject(); int int1 = 3; NUnit.Framework.Assertion.Assert(!_null.Equals(int1)); NUnit.Framework.Assertion.Assert(_null.Equals(null2)); + } + [Test] + public void NullHashCode() + { + Assertion.AssertEquals("null".GetHashCode(), _null.GetHashCode()); } } |