From: Griffin C. <gc...@us...> - 2005-01-05 14:43:33
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30231/DotNetMock.Tests Modified Files: AbstractIListExpectationTests.cs ExpectationBoolTests.cs ExpectationCounterTests.cs ExpectationStringTests.cs ExpectationTypeTests.cs ExpectationValueTests.cs NullTests.cs Log Message: - Added tests to round out code coverage Index: NullTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/NullTests.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NullTests.cs 9 Oct 2004 21:14:12 -0000 1.6 --- NullTests.cs 5 Jan 2005 14:43:17 -0000 1.7 *************** *** 1,3 **** - using System; using NUnit.Framework; using DotNetMock; --- 1,2 ---- *************** *** 38,41 **** --- 37,46 ---- Assertion.AssertEquals("null".GetHashCode(), _null.GetHashCode()); } + [Test] + public void NullName() + { + _null = new NullObject("null"); + Assert.AreEqual( "null", _null.Name ); + } } } Index: ExpectationBoolTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationBoolTests.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExpectationBoolTests.cs 10 Oct 2004 07:25:05 -0000 1.4 --- ExpectationBoolTests.cs 5 Jan 2005 14:43:17 -0000 1.5 *************** *** 1,3 **** - using System; using NUnit.Framework; --- 1,2 ---- *************** *** 103,106 **** --- 102,112 ---- NUnit.Framework.Assertion.Assert(!_expectationBool.Expected); } + [Test] + public void ShouldCheckImmediate() + { + _expectationBool.Expected = false; + _expectationBool.VerifyImmediate = true; + _expectationBool.Actual = false; + } } } Index: ExpectationCounterTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationCounterTests.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExpectationCounterTests.cs 10 Oct 2004 07:53:31 -0000 1.8 --- ExpectationCounterTests.cs 5 Jan 2005 14:43:17 -0000 1.9 *************** *** 1,3 **** - using System; using NUnit.Framework; --- 1,2 ---- *************** *** 88,91 **** --- 87,98 ---- } [Test] + public void NonStrictCallsNoExpectations() + { + _counter.Strict = false; + _counter.Inc(); + _counter.Inc(); + _counter.Verify(); + } + [Test] public void FlushActual() { Index: ExpectationTypeTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationTypeTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExpectationTypeTests.cs 9 Oct 2004 21:14:12 -0000 1.5 --- ExpectationTypeTests.cs 5 Jan 2005 14:43:17 -0000 1.6 *************** *** 129,132 **** --- 129,144 ---- _expectationType.Verify(); } + [Test] + public void ShouldCheckImmediate() + { + _expectationType.Expected = typeof(string); + _expectationType.VerifyImmediate = true; + _expectationType.Actual = typeof(string); + } + [Test] + public void NoExpectations() + { + _expectationType.Verify(); + } } } Index: AbstractIListExpectationTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/AbstractIListExpectationTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractIListExpectationTests.cs 10 Oct 2004 06:52:32 -0000 1.1 --- AbstractIListExpectationTests.cs 5 Jan 2005 14:43:17 -0000 1.2 *************** *** 62,65 **** --- 62,73 ---- ExpectedCollection.Add( null ); Verify(); + + ClearActual(); + try + { + Verify(); + Assertion.Fail( "should throw an exception." ); + } + catch {} } private void setGeneralExpectations() *************** *** 67,71 **** this.HasExpectations = true; } ! public override System.Collections.IList ActualCollection { get --- 75,79 ---- this.HasExpectations = true; } ! public override IList ActualCollection { get *************** *** 80,84 **** } ! public override System.Collections.IList ExpectedCollection { get --- 88,92 ---- } ! public override IList ExpectedCollection { get Index: ExpectationValueTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationValueTests.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ExpectationValueTests.cs 9 Oct 2004 21:14:12 -0000 1.7 --- ExpectationValueTests.cs 5 Jan 2005 14:43:17 -0000 1.8 *************** *** 1,10 **** namespace DotNetMock.Tests { - using System; - using NUnit.Framework; - using DotNetMock; - /// <summary> - /// Summary description for ExpectationValueTests. - /// </summary> [TestFixture] public class ExpectationValueTests --- 1,8 ---- + using System; + using NUnit.Framework; + using DotNetMock; + namespace DotNetMock.Tests { [TestFixture] public class ExpectationValueTests *************** *** 114,118 **** object6 = null; } ! [Test] public void NullValues() --- 112,123 ---- object6 = null; } ! [Test] ! public void ShouldCheckImmediate() ! { ! object object7 = new object(); ! _expectationValue.Expected = object7; ! _expectationValue.VerifyImmediate = true; ! _expectationValue.Actual = object7; ! } [Test] public void NullValues() Index: ExpectationStringTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationStringTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExpectationStringTests.cs 22 Mar 2004 03:51:48 -0000 1.5 --- ExpectationStringTests.cs 5 Jan 2005 14:43:17 -0000 1.6 *************** *** 1,10 **** namespace DotNetMock.Tests { - using System; - using NUnit.Framework; - using DotNetMock; - /// <summary> - /// Summary description for ExpectationStringTests. - /// </summary> [TestFixture] public class ExpectationStringTests --- 1,7 ---- + using NUnit.Framework; + using DotNetMock; + namespace DotNetMock.Tests { [TestFixture] public class ExpectationStringTests *************** *** 132,135 **** --- 129,140 ---- test9 = null; } + [Test] + public void ShouldCheckImmediate() + { + string test10 = "Testing"; + _expectationString.Expected = test10; + _expectationString.VerifyImmediate = true; + _expectationString.Actual = test10; + } } } |