From: Griffin C. <gc...@us...> - 2005-02-12 18:10:46
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6085/DotNetMock.Tests Modified Files: AbstractIListExpectationTests.cs ExpectationArrayListTests.cs ExpectationArrayTests.cs ExpectationBoolTests.cs ExpectationCounterTests.cs ExpectationStringTests.cs ExpectationTypeTests.cs ExpectationValueTests.cs MockObjectTests.cs NullTests.cs ReturnValueTest.cs Log Message: - Upgraded Tests to use NUnit 2.2 Index: NullTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/NullTests.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NullTests.cs 5 Jan 2005 14:43:17 -0000 1.7 --- NullTests.cs 12 Feb 2005 18:10:36 -0000 1.8 *************** *** 24,39 **** [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()); } [Test] --- 24,39 ---- [Test] public void NullObjectMethods() { ! Assert.AreEqual("null", _null.ToString()); _null.Name = "Null Object"; ! Assert.AreEqual("Null Object", _null.ToString()); NullObject null2 = new NullObject(); int int1 = 3; ! Assert.IsTrue(!_null.Equals(int1)); ! Assert.IsTrue(_null.Equals(null2)); } [Test] public void NullHashCode() { ! Assert.AreEqual("null".GetHashCode(), _null.GetHashCode()); } [Test] Index: ExpectationArrayTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationArrayTests.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExpectationArrayTests.cs 10 Oct 2004 18:20:05 -0000 1.4 --- ExpectationArrayTests.cs 12 Feb 2005 18:10:36 -0000 1.5 *************** *** 1,5 **** - using System; using NUnit.Framework; - namespace DotNetMock.Tests { --- 1,3 ---- *************** *** 8,159 **** { private ExpectationArray _expectationArray = null; - [SetUp] ! public void Init() { _expectationArray = new ExpectationArray( "My Expectation Array" ); } [TearDown] ! public void Destroy() { _expectationArray = null; } [Test] ! public void Empty() { ! _expectationArray.Verify(); } [Test] ! public void HasExpectations() ! { ! NUnit.Framework.Assertion.Assert("Should not have expectations.", !_expectationArray.HasExpectations); ! _expectationArray.Expected = new object[] { "a" }; ! NUnit.Framework.Assertion.Assert("Should have expectations.", _expectationArray.HasExpectations); } [Test] ! public void HasExpectationsFromArray() { ! object[] objects = new object[] { "a", "b", "c" }; ! NUnit.Framework.Assertion.Assert("Should not have expectations.", !_expectationArray.HasExpectations); _expectationArray.Expected = objects; ! NUnit.Framework.Assertion.Assert("Should have expectations.", _expectationArray.HasExpectations); } [Test] ! public void HasNoExpectations() { ! _expectationArray.Expected = new object[] { "a" }; ! _expectationArray.ClearExpected(); ! NUnit.Framework.Assertion.Assert("Should not have expectations.", !_expectationArray.HasExpectations); } [Test] ! public void VerfyLotsOfAdds() { ! object[] objects1 = new object[] { 3, 4, 5 }; ! object[] objects2 = new object[] { 6, 7, 8 }; ! object[] objects3 = new object[] { 3, 4, 5 }; ! _expectationArray.Expected = objects2; _expectationArray.Actual = objects1; ! try { ! _expectationArray.Verify(); ! NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } ! catch {} ! _expectationArray.ClearExpected(); _expectationArray.Expected = objects3; ! _expectationArray.Verify(); } [Test] ! [ExpectedException(typeof(DotNetMock.AssertionException))] ! public void FailImmediately() { ! _expectationArray.Expected = new object[] { "a", "b" }; _expectationArray.VerifyImmediate = true; ! _expectationArray.Actual = new object[] { "a", "c" }; } [Test] ! public void FlushExpected() { ! _expectationArray.Expected = new object[] { "a" }; ! NUnit.Framework.Assertion.Assert( " should have expectations", _expectationArray.HasExpectations ); ! _expectationArray.ExpectNothing(); ! NUnit.Framework.Assertion.Assert( " should have expectations", _expectationArray.HasExpectations ); ! _expectationArray.Actual = new object[] { "a" }; ! try { ! _expectationArray.Verify(); ! NUnit.Framework.Assertion.Fail( "Should have thrown an exception" ); ! } ! catch {} } [Test] ! [ExpectedException(typeof(DotNetMock.AssertionException))] ! public void FailingVerify() { ! _expectationArray.Expected = new object[] { "A", "B", "C" }; ! _expectationArray.Actual = new object[] { "A", "B", "B" }; ! _expectationArray.Verify(); } [Test] ! public void AddSingleItem() { int int1 = 2; ! ! _expectationArray.Expected = new object[] { int1 }; ! _expectationArray.Actual = new object[] { int1 }; ! _expectationArray.Verify(); } [Test] ! public void AddMany() { string[] array = new string[3]; ! array[0] = "A"; ! array[1] = "B"; ! array[2] = "C"; ! _expectationArray.Expected = array; _expectationArray.Actual = array; ! _expectationArray.Verify(); } [Test] ! [ExpectedException(typeof(DotNetMock.AssertionException))] ! public void StrictAdding() { _expectationArray.Strict = true; ! _expectationArray.Expected = new object[] { "a" }; ! _expectationArray.Actual = new object[] { "a", "b" }; ! _expectationArray.Verify(); } [Test] ! public void NoStrictAdding() { ! _expectationArray.Expected = new object[] { "a" }; ! _expectationArray.Actual = new object[] { "a", "b" }; ! _expectationArray.Verify(); } [Test] ! public void NullValuesBoth() { _expectationArray.Expected = null; _expectationArray.Actual = null; ! _expectationArray.Verify(); } [Test] ! [ExpectedException(typeof(DotNetMock.AssertionException))] ! public void NullValuesExpected() { _expectationArray.Expected = null; ! _expectationArray.Actual = new object[] { "a" }; ! _expectationArray.Verify(); } [Test] ! [ExpectedException(typeof(DotNetMock.AssertionException))] ! public void NullValuesActual() { ! _expectationArray.Expected = new object[] { "a" }; _expectationArray.Actual = null; ! _expectationArray.Verify(); } } ! } --- 6,157 ---- { private ExpectationArray _expectationArray = null; [SetUp] ! public void Init( ) { _expectationArray = new ExpectationArray( "My Expectation Array" ); } [TearDown] ! public void Destroy( ) { _expectationArray = null; } [Test] ! public void Empty( ) { ! _expectationArray.Verify( ); } [Test] ! public void HasExpectations( ) ! { ! Assert.IsTrue( !_expectationArray.HasExpectations, "Should not have expectations." ); ! _expectationArray.Expected = new object[] {"a"}; ! Assert.IsTrue( _expectationArray.HasExpectations, "Should have expectations." ); } [Test] ! public void HasExpectationsFromArray( ) { ! object[] objects = new object[] {"a", "b", "c"}; ! Assert.IsTrue( !_expectationArray.HasExpectations, "Should not have expectations." ); _expectationArray.Expected = objects; ! Assert.IsTrue( _expectationArray.HasExpectations, "Should have expectations." ); } [Test] ! public void HasNoExpectations( ) { ! _expectationArray.Expected = new object[] {"a"}; ! _expectationArray.ClearExpected( ); ! Assert.IsTrue( !_expectationArray.HasExpectations, "Should not have expectations." ); } [Test] ! public void VerfyLotsOfAdds( ) { ! object[] objects1 = new object[] {3, 4, 5}; ! object[] objects2 = new object[] {6, 7, 8}; ! object[] objects3 = new object[] {3, 4, 5}; _expectationArray.Expected = objects2; _expectationArray.Actual = objects1; ! try { ! _expectationArray.Verify( ); ! Assert.Fail( "Should have thrown an exception." ); } ! catch ! { ! } ! _expectationArray.ClearExpected( ); _expectationArray.Expected = objects3; ! _expectationArray.Verify( ); } [Test] ! [ExpectedException( typeof ( AssertionException ) )] ! public void FailImmediately( ) { ! _expectationArray.Expected = new object[] {"a", "b"}; _expectationArray.VerifyImmediate = true; ! _expectationArray.Actual = new object[] {"a", "c"}; } [Test] ! public void FlushExpected( ) { ! _expectationArray.Expected = new object[] {"a"}; ! Assert.IsTrue( _expectationArray.HasExpectations, " should have expectations" ); ! _expectationArray.ExpectNothing( ); ! Assert.IsTrue( _expectationArray.HasExpectations, " should have expectations" ); ! _expectationArray.Actual = new object[] {"a"}; ! try { ! _expectationArray.Verify( ); ! Assert.Fail( "Should have thrown an exception" ); ! } ! catch ! { ! } } [Test] ! [ExpectedException( typeof ( AssertionException ) )] ! public void FailingVerify( ) { ! _expectationArray.Expected = new object[] {"A", "B", "C"}; ! _expectationArray.Actual = new object[] {"A", "B", "B"}; ! _expectationArray.Verify( ); } [Test] ! public void AddSingleItem( ) { int int1 = 2; ! _expectationArray.Expected = new object[] {int1}; ! _expectationArray.Actual = new object[] {int1}; ! _expectationArray.Verify( ); } [Test] ! public void AddMany( ) { string[] array = new string[3]; ! array[ 0 ] = "A"; ! array[ 1 ] = "B"; ! array[ 2 ] = "C"; _expectationArray.Expected = array; _expectationArray.Actual = array; ! _expectationArray.Verify( ); } [Test] ! [ExpectedException( typeof ( AssertionException ) )] ! public void StrictAdding( ) { _expectationArray.Strict = true; ! _expectationArray.Expected = new object[] {"a"}; ! _expectationArray.Actual = new object[] {"a", "b"}; ! _expectationArray.Verify( ); } [Test] ! public void NoStrictAdding( ) { ! _expectationArray.Expected = new object[] {"a"}; ! _expectationArray.Actual = new object[] {"a", "b"}; ! _expectationArray.Verify( ); } [Test] ! public void NullValuesBoth( ) { _expectationArray.Expected = null; _expectationArray.Actual = null; ! _expectationArray.Verify( ); } [Test] ! [ExpectedException( typeof ( AssertionException ) )] ! public void NullValuesExpected( ) { _expectationArray.Expected = null; ! _expectationArray.Actual = new object[] {"a"}; ! _expectationArray.Verify( ); } [Test] ! [ExpectedException( typeof ( AssertionException ) )] ! public void NullValuesActual( ) { ! _expectationArray.Expected = new object[] {"a"}; _expectationArray.Actual = null; ! _expectationArray.Verify( ); } } ! } \ No newline at end of file Index: ExpectationArrayListTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationArrayListTests.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExpectationArrayListTests.cs 10 Oct 2004 07:25:05 -0000 1.8 --- ExpectationArrayListTests.cs 12 Feb 2005 18:10:36 -0000 1.9 *************** *** 37,43 **** arrayList3.Add("A"); ! NUnit.Framework.Assertion.Assert("Should not have expectations.", !_expectationArrayList.HasExpectations); _expectationArrayList.AddExpectedMany(arrayList3); ! NUnit.Framework.Assertion.Assert("Should have expectations.", _expectationArrayList.HasExpectations); arrayList3 = null; --- 37,43 ---- arrayList3.Add("A"); ! Assert.IsTrue(!_expectationArrayList.HasExpectations, "Should not have expectations."); _expectationArrayList.AddExpectedMany(arrayList3); ! Assert.IsTrue(_expectationArrayList.HasExpectations, "Should have expectations."); arrayList3 = null; *************** *** 52,58 **** strings[2] = "C"; ! NUnit.Framework.Assertion.Assert(!_expectationArrayList.HasExpectations); _expectationArrayList.AddExpectedMany(strings); ! NUnit.Framework.Assertion.Assert(_expectationArrayList.HasExpectations); } --- 52,58 ---- strings[2] = "C"; ! Assert.IsTrue(!_expectationArrayList.HasExpectations); _expectationArrayList.AddExpectedMany(strings); ! Assert.IsTrue(_expectationArrayList.HasExpectations); } *************** *** 63,69 **** table.Add("mock", "objects"); ! NUnit.Framework.Assertion.Assert(!_expectationArrayList.HasExpectations); _expectationArrayList.AddExpectedMany(table); ! NUnit.Framework.Assertion.Assert(_expectationArrayList.HasExpectations); } --- 63,69 ---- table.Add("mock", "objects"); ! Assert.IsTrue(!_expectationArrayList.HasExpectations); _expectationArrayList.AddExpectedMany(table); ! Assert.IsTrue(_expectationArrayList.HasExpectations); } *************** *** 72,76 **** { _expectationArrayList.AddActual("A"); ! NUnit.Framework.Assertion.Assert(!_expectationArrayList.HasExpectations); } [Test] --- 72,76 ---- { _expectationArrayList.AddActual("A"); ! Assert.IsTrue(!_expectationArrayList.HasExpectations); } [Test] *************** *** 98,102 **** { _expectationArrayList.Verify(); ! NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch --- 98,102 ---- { _expectationArrayList.Verify(); ! Assert.Fail("Should have thrown an exception."); } catch *************** *** 138,147 **** _expectationArrayList.AddExpected("A"); _expectationArrayList.ExpectNothing(); ! NUnit.Framework.Assertion.Assert( _expectationArrayList.HasExpectations ); _expectationArrayList.AddActual( "A" ); try { _expectationArrayList.Verify(); ! NUnit.Framework.Assertion.Fail( "Should have thrown an exception" ); } catch {} --- 138,147 ---- _expectationArrayList.AddExpected("A"); _expectationArrayList.ExpectNothing(); ! Assert.IsTrue( _expectationArrayList.HasExpectations ); _expectationArrayList.AddActual( "A" ); try { _expectationArrayList.Verify(); ! Assert.Fail( "Should have thrown an exception" ); } catch {} Index: AbstractIListExpectationTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/AbstractIListExpectationTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractIListExpectationTests.cs 5 Jan 2005 14:43:17 -0000 1.2 --- AbstractIListExpectationTests.cs 12 Feb 2005 18:10:36 -0000 1.3 *************** *** 67,71 **** { Verify(); ! Assertion.Fail( "should throw an exception." ); } catch {} --- 67,71 ---- { Verify(); ! Assert.Fail( "should throw an exception." ); } catch {} Index: ExpectationValueTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationValueTests.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExpectationValueTests.cs 5 Jan 2005 14:43:17 -0000 1.8 --- ExpectationValueTests.cs 12 Feb 2005 18:10:36 -0000 1.9 *************** *** 24,30 **** Object object1 = new Object(); ! NUnit.Framework.Assertion.AssertNull(_expectationValue.Actual); _expectationValue.Actual = object1; ! NUnit.Framework.Assertion.AssertEquals(object1, _expectationValue.Actual); object1 = null; --- 24,30 ---- Object object1 = new Object(); ! Assert.IsNull(_expectationValue.Actual); _expectationValue.Actual = object1; ! Assert.AreEqual(object1, _expectationValue.Actual); object1 = null; *************** *** 35,41 **** Object object2 = new Object(); ! NUnit.Framework.Assertion.AssertNull(_expectationValue.Expected); _expectationValue.Expected = object2; ! NUnit.Framework.Assertion.AssertEquals(object2, _expectationValue.Expected); object2 = null; --- 35,41 ---- Object object2 = new Object(); ! Assert.IsNull(_expectationValue.Expected); _expectationValue.Expected = object2; ! Assert.AreEqual(object2, _expectationValue.Expected); object2 = null; *************** *** 47,51 **** _expectationValue.Expected = object3; ! NUnit.Framework.Assertion.Assert(_expectationValue.HasExpectations); object3 = null; --- 47,51 ---- _expectationValue.Expected = object3; ! Assert.IsTrue(_expectationValue.HasExpectations); object3 = null; *************** *** 76,83 **** _expectationValue.Expected = object4; ! NUnit.Framework.Assertion.Assert(_expectationValue.HasExpectations); ! NUnit.Framework.Assertion.Assert(!(_expectationValue.ShouldCheckImmediate)); _expectationValue.VerifyImmediate = true; ! NUnit.Framework.Assertion.Assert(_expectationValue.ShouldCheckImmediate); object4 = null; --- 76,83 ---- _expectationValue.Expected = object4; ! Assert.IsTrue(_expectationValue.HasExpectations); ! Assert.IsTrue(!(_expectationValue.ShouldCheckImmediate)); _expectationValue.VerifyImmediate = true; ! Assert.IsTrue(_expectationValue.ShouldCheckImmediate); object4 = null; *************** *** 89,97 **** Object object5 = new Object(); ! NUnit.Framework.Assertion.AssertNull(_expectationValue.Actual); _expectationValue.Actual = object5; ! NUnit.Framework.Assertion.AssertNotNull(_expectationValue.Actual); _expectationValue.ClearActual(); ! NUnit.Framework.Assertion.AssertNull(_expectationValue.Actual); object5 = null; --- 89,97 ---- Object object5 = new Object(); ! Assert.IsNull(_expectationValue.Actual); _expectationValue.Actual = object5; ! Assert.IsNotNull(_expectationValue.Actual); _expectationValue.ClearActual(); ! Assert.IsNull(_expectationValue.Actual); object5 = null; *************** *** 103,112 **** Object object6 = new Object(); ! NUnit.Framework.Assertion.AssertNull(_expectationValue.Expected); _expectationValue.Expected = object6; ! NUnit.Framework.Assertion.AssertNotNull(_expectationValue.Expected); ! NUnit.Framework.Assertion.Assert(_expectationValue.HasExpectations); _expectationValue.ClearExpected(); ! NUnit.Framework.Assertion.AssertNull(_expectationValue.Expected); object6 = null; --- 103,112 ---- Object object6 = new Object(); ! Assert.IsNull(_expectationValue.Expected); _expectationValue.Expected = object6; ! Assert.IsNotNull(_expectationValue.Expected); ! Assert.IsTrue(_expectationValue.HasExpectations); _expectationValue.ClearExpected(); ! Assert.IsNull(_expectationValue.Expected); object6 = null; Index: ExpectationStringTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationStringTests.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExpectationStringTests.cs 5 Jan 2005 14:43:17 -0000 1.6 --- ExpectationStringTests.cs 12 Feb 2005 18:10:36 -0000 1.7 *************** *** 26,35 **** string test1 = "Mock Objects are Cool"; ! NUnit.Framework.Assertion.AssertNull(_expectationString.Actual); _expectationString.Actual = test1; ! NUnit.Framework.Assertion.AssertNotNull(_expectationString.Actual); ! NUnit.Framework.Assertion.AssertEquals(test1, _expectationString.Actual); _expectationString.ClearActual(); ! NUnit.Framework.Assertion.AssertNull(_expectationString.Actual); } --- 26,35 ---- string test1 = "Mock Objects are Cool"; ! Assert.IsNull(_expectationString.Actual); _expectationString.Actual = test1; ! Assert.IsNotNull(_expectationString.Actual); ! Assert.AreEqual(test1, _expectationString.Actual); _expectationString.ClearActual(); ! Assert.IsNull(_expectationString.Actual); } *************** *** 39,48 **** string test2 = "Unit Testing helps code."; ! NUnit.Framework.Assertion.AssertNull(_expectationString.Expected); _expectationString.Expected = test2; ! NUnit.Framework.Assertion.AssertNotNull(_expectationString.Expected); ! NUnit.Framework.Assertion.AssertEquals(test2, _expectationString.Expected); _expectationString.ClearExpected(); ! NUnit.Framework.Assertion.AssertNull(_expectationString.Expected); } --- 39,48 ---- string test2 = "Unit Testing helps code."; ! Assert.IsNull(_expectationString.Expected); _expectationString.Expected = test2; ! Assert.IsNotNull(_expectationString.Expected); ! Assert.AreEqual(test2, _expectationString.Expected); _expectationString.ClearExpected(); ! Assert.IsNull(_expectationString.Expected); } *************** *** 52,60 **** string test3 = "Sourceforge is nice."; ! NUnit.Framework.Assertion.AssertNull(_expectationString.Expected); _expectationString.Expected = test3; ! NUnit.Framework.Assertion.AssertNotNull(_expectationString.Expected); ! NUnit.Framework.Assertion.AssertEquals(test3, _expectationString.Expected); ! NUnit.Framework.Assertion.Assert(_expectationString.HasExpectations); test3 = null; --- 52,60 ---- string test3 = "Sourceforge is nice."; ! Assert.IsNull(_expectationString.Expected); _expectationString.Expected = test3; ! Assert.IsNotNull(_expectationString.Expected); ! Assert.AreEqual(test3, _expectationString.Expected); ! Assert.IsTrue(_expectationString.HasExpectations); test3 = null; *************** *** 94,101 **** _expectationString.Expected = test7; ! NUnit.Framework.Assertion.Assert(_expectationString.HasExpectations); ! NUnit.Framework.Assertion.Assert(!(_expectationString.ShouldCheckImmediate)); _expectationString.VerifyImmediate = true; ! NUnit.Framework.Assertion.Assert(_expectationString.ShouldCheckImmediate); test7 = null; --- 94,101 ---- _expectationString.Expected = test7; ! Assert.IsTrue(_expectationString.HasExpectations); ! Assert.IsTrue(!(_expectationString.ShouldCheckImmediate)); _expectationString.VerifyImmediate = true; ! Assert.IsTrue(_expectationString.ShouldCheckImmediate); test7 = null; *************** *** 107,115 **** string test8 = "Testing"; ! NUnit.Framework.Assertion.AssertNull(_expectationString.Actual); _expectationString.Actual = test8; ! NUnit.Framework.Assertion.AssertNotNull(_expectationString.Actual); _expectationString.ClearActual(); ! NUnit.Framework.Assertion.AssertNull(_expectationString.Actual); test8 = null; --- 107,115 ---- string test8 = "Testing"; ! Assert.IsNull(_expectationString.Actual); _expectationString.Actual = test8; ! Assert.IsNotNull(_expectationString.Actual); _expectationString.ClearActual(); ! Assert.IsNull(_expectationString.Actual); test8 = null; *************** *** 121,129 **** string test9 = "Testing"; ! NUnit.Framework.Assertion.AssertNull(_expectationString.Expected); _expectationString.Expected = test9; ! NUnit.Framework.Assertion.AssertNotNull(_expectationString.Expected); _expectationString.ClearExpected(); ! NUnit.Framework.Assertion.AssertNull(_expectationString.Expected); test9 = null; --- 121,129 ---- string test9 = "Testing"; ! Assert.IsNull(_expectationString.Expected); _expectationString.Expected = test9; ! Assert.IsNotNull(_expectationString.Expected); _expectationString.ClearExpected(); ! Assert.IsNull(_expectationString.Expected); test9 = null; Index: ExpectationTypeTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationTypeTests.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExpectationTypeTests.cs 5 Jan 2005 14:43:17 -0000 1.6 --- ExpectationTypeTests.cs 12 Feb 2005 18:10:36 -0000 1.7 *************** *** 30,36 **** Type type1 = typeof(string); ! NUnit.Framework.Assertion.AssertNull(_expectationType.Actual); _expectationType.Actual = type1; ! NUnit.Framework.Assertion.AssertEquals(type1, _expectationType.Actual); type1 = null; --- 30,36 ---- Type type1 = typeof(string); ! Assert.IsNull(_expectationType.Actual); _expectationType.Actual = type1; ! Assert.AreEqual(type1, _expectationType.Actual); type1 = null; *************** *** 42,48 **** Type type2 = typeof(int); ! NUnit.Framework.Assertion.AssertNull(_expectationType.Expected); _expectationType.Expected = type2; ! NUnit.Framework.Assertion.AssertEquals(type2, _expectationType.Expected); type2 = null; --- 42,48 ---- Type type2 = typeof(int); ! Assert.IsNull(_expectationType.Expected); _expectationType.Expected = type2; ! Assert.AreEqual(type2, _expectationType.Expected); type2 = null; *************** *** 55,59 **** _expectationType.Expected = type3; ! NUnit.Framework.Assertion.Assert(_expectationType.HasExpectations); type3 = null; --- 55,59 ---- _expectationType.Expected = type3; ! Assert.IsTrue(_expectationType.HasExpectations); type3 = null; *************** *** 85,92 **** _expectationType.Expected = type4; ! NUnit.Framework.Assertion.Assert(_expectationType.HasExpectations); ! NUnit.Framework.Assertion.Assert(!(_expectationType.ShouldCheckImmediate)); _expectationType.VerifyImmediate = true; ! NUnit.Framework.Assertion.Assert(_expectationType.ShouldCheckImmediate); type4 = null; --- 85,92 ---- _expectationType.Expected = type4; ! Assert.IsTrue(_expectationType.HasExpectations); ! Assert.IsTrue(!(_expectationType.ShouldCheckImmediate)); _expectationType.VerifyImmediate = true; ! Assert.IsTrue(_expectationType.ShouldCheckImmediate); type4 = null; *************** *** 98,106 **** Type type5 = typeof(string); ! NUnit.Framework.Assertion.AssertNull(_expectationType.Actual); _expectationType.Actual = type5; ! NUnit.Framework.Assertion.AssertNotNull(_expectationType.Actual); _expectationType.ClearActual(); ! NUnit.Framework.Assertion.AssertNull(_expectationType.Actual); type5 = null; --- 98,106 ---- Type type5 = typeof(string); ! Assert.IsNull(_expectationType.Actual); _expectationType.Actual = type5; ! Assert.IsNotNull(_expectationType.Actual); _expectationType.ClearActual(); ! Assert.IsNull(_expectationType.Actual); type5 = null; *************** *** 112,121 **** Type type6 = typeof(string); ! NUnit.Framework.Assertion.AssertNull(_expectationType.Expected); _expectationType.Expected = type6; ! NUnit.Framework.Assertion.AssertNotNull(_expectationType.Expected); ! NUnit.Framework.Assertion.Assert(_expectationType.HasExpectations); _expectationType.ClearExpected(); ! NUnit.Framework.Assertion.AssertNull(_expectationType.Expected); type6 = null; --- 112,121 ---- Type type6 = typeof(string); ! Assert.IsNull(_expectationType.Expected); _expectationType.Expected = type6; ! Assert.IsNotNull(_expectationType.Expected); ! Assert.IsTrue(_expectationType.HasExpectations); _expectationType.ClearExpected(); ! Assert.IsNull(_expectationType.Expected); type6 = null; Index: ExpectationBoolTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationBoolTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExpectationBoolTests.cs 5 Jan 2005 14:43:17 -0000 1.5 --- ExpectationBoolTests.cs 12 Feb 2005 18:10:36 -0000 1.6 *************** *** 26,34 **** public void SetActual() { ! NUnit.Framework.Assertion.Assert(!_expectationBool.Actual); _expectationBool.Actual = true; ! NUnit.Framework.Assertion.Assert(_expectationBool.Actual); _expectationBool.ClearActual(); ! NUnit.Framework.Assertion.Assert(!_expectationBool.Actual); } --- 26,34 ---- public void SetActual() { ! Assert.IsTrue(!_expectationBool.Actual); _expectationBool.Actual = true; ! Assert.IsTrue(_expectationBool.Actual); _expectationBool.ClearActual(); ! Assert.IsTrue(!_expectationBool.Actual); } *************** *** 36,44 **** public void SetExpected() { ! NUnit.Framework.Assertion.Assert(!_expectationBool.Expected); _expectationBool.Expected = true; ! NUnit.Framework.Assertion.Assert(_expectationBool.Expected); _expectationBool.ClearExpected(); ! NUnit.Framework.Assertion.Assert(!_expectationBool.Expected); } --- 36,44 ---- public void SetExpected() { ! Assert.IsTrue(!_expectationBool.Expected); _expectationBool.Expected = true; ! Assert.IsTrue(_expectationBool.Expected); _expectationBool.ClearExpected(); ! Assert.IsTrue(!_expectationBool.Expected); } *************** *** 46,55 **** public void HasExpectations() { ! NUnit.Framework.Assertion.Assert(!_expectationBool.Expected); _expectationBool.Expected = true; ! NUnit.Framework.Assertion.Assert(_expectationBool.Expected); ! NUnit.Framework.Assertion.Assert(_expectationBool.HasExpectations); _expectationBool.ClearExpected(); ! NUnit.Framework.Assertion.Assert(!_expectationBool.HasExpectations); } --- 46,55 ---- public void HasExpectations() { ! Assert.IsTrue(!_expectationBool.Expected); _expectationBool.Expected = true; ! Assert.IsTrue(_expectationBool.Expected); ! Assert.IsTrue(_expectationBool.HasExpectations); _expectationBool.ClearExpected(); ! Assert.IsTrue(!_expectationBool.HasExpectations); } *************** *** 63,67 **** { _expectationBool.Verify(); ! NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch --- 63,67 ---- { _expectationBool.Verify(); ! Assert.Fail("Should have thrown an exception."); } catch *************** *** 77,84 **** _expectationBool.Expected = true; ! NUnit.Framework.Assertion.Assert(_expectationBool.HasExpectations); ! NUnit.Framework.Assertion.Assert(!(_expectationBool.ShouldCheckImmediate)); _expectationBool.VerifyImmediate = true; ! NUnit.Framework.Assertion.Assert(_expectationBool.ShouldCheckImmediate); } --- 77,84 ---- _expectationBool.Expected = true; ! Assert.IsTrue(_expectationBool.HasExpectations); ! Assert.IsTrue(!(_expectationBool.ShouldCheckImmediate)); _expectationBool.VerifyImmediate = true; ! Assert.IsTrue(_expectationBool.ShouldCheckImmediate); } *************** *** 86,94 **** public void ClearActual() { ! NUnit.Framework.Assertion.Assert(!_expectationBool.Actual); _expectationBool.Actual = true; ! NUnit.Framework.Assertion.Assert(_expectationBool.Actual); _expectationBool.ClearActual(); ! NUnit.Framework.Assertion.Assert(!_expectationBool.Actual); } --- 86,94 ---- public void ClearActual() { ! Assert.IsTrue(!_expectationBool.Actual); _expectationBool.Actual = true; ! Assert.IsTrue(_expectationBool.Actual); _expectationBool.ClearActual(); ! Assert.IsTrue(!_expectationBool.Actual); } *************** *** 96,104 **** public void ClearExpected() { ! NUnit.Framework.Assertion.Assert(!_expectationBool.Expected); _expectationBool.Expected = true; ! NUnit.Framework.Assertion.Assert(_expectationBool.Expected); _expectationBool.ClearExpected(); ! NUnit.Framework.Assertion.Assert(!_expectationBool.Expected); } [Test] --- 96,104 ---- public void ClearExpected() { ! Assert.IsTrue(!_expectationBool.Expected); _expectationBool.Expected = true; ! Assert.IsTrue(_expectationBool.Expected); _expectationBool.ClearExpected(); ! Assert.IsTrue(!_expectationBool.Expected); } [Test] Index: ExpectationCounterTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ExpectationCounterTests.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ExpectationCounterTests.cs 5 Jan 2005 14:43:17 -0000 1.9 --- ExpectationCounterTests.cs 12 Feb 2005 18:10:36 -0000 1.10 *************** *** 24,28 **** _counter.ExpectNothing(); ! Assertion.Assert("Has expectation", _counter.HasExpectations); _counter.Verify(); } --- 24,28 ---- _counter.ExpectNothing(); ! Assert.IsTrue( _counter.HasExpectations, "Has expectation"); _counter.Verify(); } *************** *** 35,39 **** _counter.VerifyImmediate = true; ! Assertion.Assert("Has expectation", _counter.HasExpectations); _counter.Inc(); } --- 35,39 ---- _counter.VerifyImmediate = true; ! Assert.IsTrue( _counter.HasExpectations, "Has expectation"); _counter.Inc(); } *************** *** 108,112 **** { _counter.Inc(); ! Assertion.Assert("Should have no expectations", !_counter.HasExpectations); _counter.Verify(); } --- 108,112 ---- { _counter.Inc(); ! Assert.IsTrue( !_counter.HasExpectations, "Should have no expectations"); _counter.Verify(); } Index: MockObjectTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/MockObjectTests.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MockObjectTests.cs 9 Oct 2004 21:14:12 -0000 1.8 --- MockObjectTests.cs 12 Feb 2005 18:10:36 -0000 1.9 *************** *** 31,37 **** public void MockVerified() { ! Assertion.Assert( !_mockObject.IsVerified ); _mockObject.Verify(); ! Assertion.Assert( _mockObject.IsVerified ); } } --- 31,37 ---- public void MockVerified() { ! Assert.IsTrue( !_mockObject.IsVerified ); _mockObject.Verify(); ! Assert.IsTrue( _mockObject.IsVerified ); } } Index: ReturnValueTest.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/ReturnValueTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReturnValueTest.cs 9 Oct 2004 21:14:12 -0000 1.6 --- ReturnValueTest.cs 12 Feb 2005 18:10:36 -0000 1.7 *************** *** 23,28 **** r.Add("B"); ! Assertion.AssertEquals("A", r.Next()); ! Assertion.AssertEquals("B", r.Next()); } --- 23,28 ---- r.Add("B"); ! Assert.AreEqual("A", r.Next()); ! Assert.AreEqual("B", r.Next()); } *************** *** 34,42 **** r.Add("B"); ! Assertion.AssertEquals("A", r.Next()); ! Assertion.AssertEquals("B", r.Next()); ! Assertion.AssertEquals("B", r.Next()); ! Assertion.AssertEquals("B", r.Next()); ! Assertion.AssertEquals("B", r.Next()); } --- 34,42 ---- r.Add("B"); ! Assert.AreEqual("A", r.Next()); ! Assert.AreEqual("B", r.Next()); ! Assert.AreEqual("B", r.Next()); ! Assert.AreEqual("B", r.Next()); ! Assert.AreEqual("B", r.Next()); } *************** *** 48,53 **** r.Add("B"); ! Assertion.AssertEquals("A", r.Next()); ! Assertion.AssertEquals("B", r.Next()); r.Next(); } --- 48,53 ---- r.Add("B"); ! Assert.AreEqual("A", r.Next()); ! Assert.AreEqual("B", r.Next()); r.Next(); } *************** *** 63,69 **** r.AddCollection(args); ! Assertion.AssertEquals("A", r.Next()); ! Assertion.AssertEquals("B", r.Next()); ! Assertion.AssertEquals("C", r.Next()); } --- 63,69 ---- r.AddCollection(args); ! Assert.AreEqual("A", r.Next()); ! Assert.AreEqual("B", r.Next()); ! Assert.AreEqual("C", r.Next()); } *************** *** 75,79 **** r.Add(new SystemException("Deliberate exception")); ! Assertion.AssertEquals("A", r.Next()); r.Next(); } --- 75,79 ---- r.Add(new SystemException("Deliberate exception")); ! Assert.AreEqual("A", r.Next()); r.Next(); } |