This list is closed, nobody may subscribe to it.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
(49) |
Nov
(1) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(42) |
Mar
(61) |
Apr
(36) |
May
(20) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(7) |
2004 |
Jan
(29) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2005 |
Jan
(12) |
Feb
(5) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(15) |
Nov
(89) |
Dec
(85) |
2006 |
Jan
(17) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gc...@us...> - 2002-10-11 03:08:03
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory usw-pr-cvs1:/tmp/cvs-serv27329/DotNetMock.Tests Modified Files: DotNetMock.Tests.build Log Message: Added XML comments to most files Added NDoc documentation task to Master.Build file Index: DotNetMock.Tests.build =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/DotNetMock.Tests.build,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DotNetMock.Tests.build 11 Oct 2002 00:24:38 -0000 1.1 --- DotNetMock.Tests.build 11 Oct 2002 03:07:59 -0000 1.2 *************** *** 3,7 **** <description>Build file for .NET Mock Objects Tests module</description> <property name="debug" value="true"/> ! <property name="build.dir" value="build/"/> <property name="project.name" value="DotNetMock.Tests"/> <tstamp/> --- 3,7 ---- <description>Build file for .NET Mock Objects Tests module</description> <property name="debug" value="true"/> ! <property name="build.dir" value="../build/"/> <property name="project.name" value="DotNetMock.Tests"/> <tstamp/> |
From: <gc...@us...> - 2002-10-11 03:08:02
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Data In directory usw-pr-cvs1:/tmp/cvs-serv27329/DotNetMock/Data Modified Files: MockDataParameter.cs Log Message: Added XML comments to most files Added NDoc documentation task to Master.Build file Index: MockDataParameter.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Data/MockDataParameter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MockDataParameter.cs 11 Oct 2002 00:24:38 -0000 1.2 --- MockDataParameter.cs 11 Oct 2002 03:07:59 -0000 1.3 *************** *** 54,58 **** } /// <summary> ! /// Sets expected name /// </summary> /// <param name="name">Parameter name to expect</param> --- 54,58 ---- } /// <summary> ! /// Sets expected parameter name /// </summary> /// <param name="name">Parameter name to expect</param> *************** *** 61,76 **** --- 61,92 ---- _parameterName.Expected = name; } + /// <summary> + /// Sets expected parameter value + /// </summary> + /// <param name="value">Value to expect</param> public void SetExpectedValue(string value) { _parameterValue.Expected = value; } + /// <summary> + /// Sets IsNullable or not + /// </summary> + /// <param name="nullable">True/False</param> public void SetExpectedNullable(bool nullable) { _nullable.Expected = nullable; } + /// <summary> + /// Sets expected parameter type + /// </summary> + /// <param name="expectedType">Type to expect</param> public void SetExpectedType(DbType expectedType) { _parameterType.Expected = expectedType; } + /// <summary> + /// Sets expected source column + /// </summary> + /// <param name="column">Expected source column</param> public void SetExpectedSourceColumn(string column) { *************** *** 80,85 **** #region Implementation of IDataParameter ! // TODO: Implement complete directions: Input, Output, InputOutput, and ReturnValue public System.Data.ParameterDirection Direction { --- 96,104 ---- #region Implementation of IDataParameter ! // TODO: Implement complete directions: Input, Output, InputOutput, and ReturnValue + /// <summary> + /// Parameter Direction + /// </summary> public System.Data.ParameterDirection Direction { *************** *** 92,96 **** } } ! public System.Data.DbType DbType { --- 111,117 ---- } } ! /// <summary> ! /// Paramter Type ! /// </summary> public System.Data.DbType DbType { *************** *** 103,107 **** } } ! public object Value { --- 124,130 ---- } } ! /// <summary> ! /// Parameter Value ! /// </summary> public object Value { *************** *** 116,120 **** } } ! public bool IsNullable { --- 139,145 ---- } } ! /// <summary> ! /// Is Nullable ! /// </summary> public bool IsNullable { *************** *** 128,132 **** } } ! /// TODO: Implement different DataRowVersion information: Current, Proposed, Default, and Original public System.Data.DataRowVersion SourceVersion { --- 153,160 ---- } } ! // TODO: Implement different DataRowVersion information: Current, Proposed, Default, and Original ! /// <summary> ! /// Parameter Source Version to use ! /// </summary> public System.Data.DataRowVersion SourceVersion { *************** *** 139,143 **** } } ! public string ParameterName { --- 167,173 ---- } } ! /// <summary> ! /// Paramter Name ! /// </summary> public string ParameterName { *************** *** 150,154 **** } } ! public string SourceColumn { --- 180,186 ---- } } ! /// <summary> ! /// Source Column for the parameter ! /// </summary> public string SourceColumn { *************** *** 162,166 **** } #endregion ! private DbType inferType(Object value) { --- 194,202 ---- } #endregion ! /// <summary> ! /// Infers corresponding DbType from the given value ! /// </summary> ! /// <param name="value">Value to use</param> ! /// <returns>Inferred DbType from given value</returns> private DbType inferType(Object value) { |
From: <gc...@us...> - 2002-10-11 03:08:02
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv27329/DotNetMock Modified Files: AbstractExpectationCollection.cs AssemblyInfo.cs DotNetMock.build Expectation.cs ExpectationArrayList.cs ExpectationCounter.cs ExpectationValue.cs MockObject.cs Null.cs Log Message: Added XML comments to most files Added NDoc documentation task to Master.Build file Index: AbstractExpectationCollection.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/AbstractExpectationCollection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractExpectationCollection.cs 29 Sep 2002 23:15:57 -0000 1.2 --- AbstractExpectationCollection.cs 11 Oct 2002 03:07:59 -0000 1.3 *************** *** 10,19 **** public abstract class AbstractExpectationCollection : AbstractExpectation, ExpectationCollection { public AbstractExpectationCollection(string name) : base(name) {} ! abstract protected void CheckImmediateValues(object actual); abstract protected IList GetActualCollection(); abstract protected IList GetExpectedCollection(); ! public void AddActual(object actual) { --- 10,37 ---- public abstract class AbstractExpectationCollection : AbstractExpectation, ExpectationCollection { + /// <summary> + /// Default Constructor + /// </summary> + /// <param name="name">Name for AbstractExpectationCollection</param> public AbstractExpectationCollection(string name) : base(name) {} ! /// <summary> ! /// Checks the given values immediatly ! /// </summary> ! /// <param name="actual">Values to check</param> abstract protected void CheckImmediateValues(object actual); + /// <summary> + /// Returns Actual Collection + /// </summary> + /// <returns>Actual Collection</returns> abstract protected IList GetActualCollection(); + /// <summary> + /// Returns Expected Collection + /// </summary> + /// <returns>Expected Collection</returns> abstract protected IList GetExpectedCollection(); ! /// <summary> ! /// Adds value to actual collection ! /// </summary> ! /// <param name="actual">Value to add</param> public void AddActual(object actual) { *************** *** 24,28 **** } } ! public void AddActualMany(object[] actualMany) { --- 42,49 ---- } } ! /// <summary> ! /// Adds serveral values to the actual collection ! /// </summary> ! /// <param name="actualMany">Values to add</param> public void AddActualMany(object[] actualMany) { *************** *** 32,35 **** --- 53,60 ---- } } + /// <summary> + /// Adds several values to the actual collection + /// </summary> + /// <param name="actualMany">Values to add</param> public void AddActualMany(IEnumerable actualMany) { *************** *** 40,43 **** --- 65,72 ---- } } + /// <summary> + /// Adds several values to the actual collection + /// </summary> + /// <param name="actualMany">Values to add</param> public void AddActualMany(IList actualMany) { *************** *** 47,50 **** --- 76,83 ---- } } + /// <summary> + /// Adds value to the expected collection + /// </summary> + /// <param name="expected">Value to add</param> public void AddExpected(object expected) { *************** *** 52,56 **** this.HasExpectations = true; } ! public void AddExpectedMany(object[] expectedMany) { --- 85,92 ---- this.HasExpectations = true; } ! /// <summary> ! /// Adds several values to the expected collection ! /// </summary> ! /// <param name="actualMany">Values to add</param> public void AddExpectedMany(object[] expectedMany) { *************** *** 60,63 **** --- 96,103 ---- } } + /// <summary> + /// Adds several values to the expected collection + /// </summary> + /// <param name="actualMany">Values to add</param> public void AddExpectedMany(IEnumerable expectedMany) { *************** *** 68,71 **** --- 108,115 ---- } } + /// <summary> + /// Adds several values to the expected collection + /// </summary> + /// <param name="actualMany">Values to add</param> public void AddExpectedMany(IList expectedMany) { *************** *** 75,86 **** --- 119,139 ---- } } + /// <summary> + /// Clears actual collection + /// </summary> public override void ClearActual() { GetActualCollection().Clear(); } + /// <summary> + /// Clears expected collection + /// </summary> public override void ClearExpected() { GetExpectedCollection().Clear(); } + /// <summary> + /// Sets expectations to nothing + /// </summary> public override void ExpectNothing() { *************** *** 88,91 **** --- 141,147 ---- this.HasExpectations = true; } + /// <summary> + /// Verifies expectation collection + /// </summary> public override void Verify() { Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/AssemblyInfo.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AssemblyInfo.cs 11 Oct 2002 00:24:37 -0000 1.3 --- AssemblyInfo.cs 11 Oct 2002 03:07:59 -0000 1.4 *************** *** 27,31 **** // by using the '*' as shown below: ! [assembly: AssemblyVersion("0.0.0.*")] // --- 27,31 ---- // by using the '*' as shown below: ! [assembly: AssemblyVersion("0.1.0.*")] // Index: DotNetMock.build =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/DotNetMock.build,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DotNetMock.build 11 Oct 2002 00:24:37 -0000 1.1 --- DotNetMock.build 11 Oct 2002 03:07:59 -0000 1.2 *************** *** 3,7 **** <description>Build file for main .NET Mock Objects module</description> <property name="debug" value="true"/> ! <property name="build.dir" value="build/"/> <property name="project.name" value="DotNetMock"/> --- 3,7 ---- <description>Build file for main .NET Mock Objects module</description> <property name="debug" value="true"/> ! <property name="build.dir" value="../build/"/> <property name="project.name" value="DotNetMock"/> *************** *** 18,22 **** <target name="build" description="Builds .NET Mock Object main module" depends="init"> ! <csc target="library" output="${build.dir}/${project.name}.dll" debug="${debug}"> <sources basedir="."> <includes name="**/*.cs"/> --- 18,22 ---- <target name="build" description="Builds .NET Mock Object main module" depends="init"> ! <csc target="library" output="${build.dir}/${project.name}.dll" debug="${debug}" doc="${build.dir}\${project.name}.xml"> <sources basedir="."> <includes name="**/*.cs"/> Index: Expectation.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Expectation.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Expectation.cs 21 Sep 2002 06:19:18 -0000 1.3 --- Expectation.cs 11 Oct 2002 03:07:59 -0000 1.4 *************** *** 3,12 **** using System; /// <summary> ! /// Summary description for Expectation Interface. /// </summary> public interface Expectation : Verifiable { bool HasExpectations {get;set;} bool VerifyImmediate {set;} bool ShouldCheckImmediate {get;} } --- 3,21 ---- using System; /// <summary> ! /// Interface that all expectation implement. Also implements the Verifiable interface /// </summary> public interface Expectation : Verifiable { + /// <summary> + /// Gets/Sets Has Expectations + /// </summary> bool HasExpectations {get;set;} + /// <summary> + /// Sets the verify immediate flag + /// </summary> bool VerifyImmediate {set;} + /// <summary> + /// Gets should check immediate + /// </summary> bool ShouldCheckImmediate {get;} } Index: ExpectationArrayList.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationArrayList.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExpectationArrayList.cs 25 Sep 2002 00:12:21 -0000 1.5 --- ExpectationArrayList.cs 11 Oct 2002 03:07:59 -0000 1.6 *************** *** 4,8 **** using System.Collections; /// <summary> ! /// Summary description for ArrayList Expectation. /// </summary> public class ExpectationArrayList : AbstractExpectationCollection --- 4,8 ---- using System.Collections; /// <summary> ! /// Expectation ArrayList implementation. Extends AbstractExpectationCollection /// </summary> public class ExpectationArrayList : AbstractExpectationCollection *************** *** 10,27 **** private ArrayList _actualArrayList = null; private ArrayList _expectedArrayList = null; ! public ExpectationArrayList(string name) : base(name) { _actualArrayList = new ArrayList(); _expectedArrayList = new ArrayList(); } ! protected override IList GetActualCollection() { return _actualArrayList; } protected override IList GetExpectedCollection() { return _expectedArrayList; } protected override void CheckImmediateValues(object actual) { --- 10,42 ---- private ArrayList _actualArrayList = null; private ArrayList _expectedArrayList = null; ! ! /// <summary> ! /// Constructor ! /// </summary> ! /// <param name="name"></param> public ExpectationArrayList(string name) : base(name) { _actualArrayList = new ArrayList(); _expectedArrayList = new ArrayList(); } ! /// <summary> ! /// Returns actual collection ! /// </summary> ! /// <returns>Actual Collection</returns> protected override IList GetActualCollection() { return _actualArrayList; } + /// <summary> + /// Returns expected collection + /// </summary> + /// <returns>Expected Collection</returns> protected override IList GetExpectedCollection() { return _expectedArrayList; } + /// <summary> + /// Checks an Immediate value + /// </summary> + /// <param name="actual">Value to check</param> protected override void CheckImmediateValues(object actual) { Index: ExpectationCounter.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationCounter.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExpectationCounter.cs 21 Sep 2002 06:19:18 -0000 1.4 --- ExpectationCounter.cs 11 Oct 2002 03:07:59 -0000 1.5 *************** *** 3,7 **** using NUnit.Framework; /// <summary> ! /// Summary for Counter Expectation. /// </summary> public class ExpectationCounter : AbstractExpectation { --- 3,7 ---- using NUnit.Framework; /// <summary> ! /// Expectation Counter implementation. Extends AbstractExpectation /// </summary> public class ExpectationCounter : AbstractExpectation { Index: ExpectationValue.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationValue.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ExpectationValue.cs 29 Sep 2002 23:15:57 -0000 1.7 --- ExpectationValue.cs 11 Oct 2002 03:07:59 -0000 1.8 *************** *** 3,7 **** using System; /// <summary> ! /// Summary description for Value Expectation. /// </summary> public class ExpectationValue : AbstractExpectation --- 3,7 ---- using System; /// <summary> ! /// Expectation Value implementation. /// </summary> public class ExpectationValue : AbstractExpectation Index: MockObject.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/MockObject.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MockObject.cs 29 Sep 2002 23:15:57 -0000 1.4 --- MockObject.cs 11 Oct 2002 03:07:59 -0000 1.5 *************** *** 4,8 **** using NUnit.Framework; /// <summary> ! /// Summary description for Base Mock Object. /// </summary> public class MockObject : Verifiable --- 4,8 ---- using NUnit.Framework; /// <summary> ! /// Base Mock Object. All custom Mock Objects should extend this object. /// </summary> public class MockObject : Verifiable Index: Null.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Null.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Null.cs 21 Sep 2002 06:19:18 -0000 1.2 --- Null.cs 11 Oct 2002 03:07:59 -0000 1.3 *************** *** 1,4 **** - - namespace DotNetMock { --- 1,2 ---- |
From: <gc...@us...> - 2002-10-11 00:24:43
|
Update of /cvsroot/dotnetmock/dotnetmock In directory usw-pr-cvs1:/tmp/cvs-serv16044 Added Files: DotNetMock.Master.build Removed Files: dotnetmock.snk Log Message: Added NAnt build files --- NEW FILE: DotNetMock.Master.build --- <?xml version="1.0"?> <project name=".NET Mock Objects master build file"> <description>Master build file for .NET Mock Objects project</description> <property name="debug" value="true"/> <property name="DotNetMock.Core" value="DotNetMock"/> <property name="DotNetMock.Tests" value="DotNetMock.Tests"/> <property name="project.name" value="DotNetMock"/> <property name="version" value="0.1"/> <property name="build.dir" value="build/"/> <property name="package.dir" value="${build.dir}/${project.name}-${version}"/> <property name="bin.dir" value="${package.dir}/bin/"/> <property name="src.dir" value="${package.dir}/src"/> <tstamp/> <target name="init" description="Setup environment"> <mkdir dir="${build.dir}" failonerror="false"/> <mkdir dir="${package.dir}" failonerror="false"/> <mkdir dir="${bin.dir}" failonerror="false"/> <mkdir dir="${src.dir}" failonerror="false"/> </target> <target name="clean" description="Cleans project to pre-build state"> <delete dir="${bin.dir}" failonerror="false"/> <delete dir="${src.dir}" failonerror="false"/> <delete dir="${package.dir}" failonerror="false"/> <delete dir="${build.dir}" failonerror="false"/> </target> <target name="clean-all" description="Cleans all sub-projects to pre-build state"> <nant buildfile="${DotNetMock.Core}/${DotNetMock.Core}.build" target="clean"/> <nant buildfile="${DotNetMock.Tests}/${DotNetMock.Tests}.build" target="clean"/> <call target="clean"/> </target> <target name="build-all" description="Builds .NET Mock Object modules" depends="init"> <nant buildfile="${DotNetMock.Core}/${DotNetMock.Core}.build" target="build"/> <nant buildfile="${DotNetMock.Tests}/${DotNetMock.Tests}.build" target="build"/> </target> <target name="package" description="Collects and packs up the distribution" depends="build-all"> <copy file="${DotNetMock.Core}/build/${DotNetMock.Core}.dll" tofile="${bin.dir}/${DotNetMock.Core}.dll"/> <copy file="${DotNetMock.Tests}/build/${DotNetMock.Tests}.dll" tofile="${bin.dir}/${DotNetMock.Tests}.dll"/> <copy file="lib/nunit.framework.dll" tofile="${bin.dir}/nunit.framework.dll"/> <copy todir="${src.dir}/${DotNetMock.Core}"> <fileset basedir="${DotNetMock.Core}"> <includes name="**/*.cs"/> </fileset> </copy> <copy todir="${src.dir}/${DotNetMock.Tests}"> <fileset basedir="${DotNetMock.Tests}"> <includes name="**/*.cs"/> </fileset> </copy> <zip zipfile="${build.dir}/${project.name}-${version}.zip"> <fileset basedir="${build.dir}"> <includes name="**/*"/> </fileset> </zip> </target> </project> --- dotnetmock.snk DELETED --- |
From: <gc...@us...> - 2002-10-11 00:24:42
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv16044/DotNetMock Modified Files: AssemblyInfo.cs Added Files: DotNetMock.build Log Message: Added NAnt build files --- NEW FILE: DotNetMock.build --- <?xml version="1.0"?> <project name=".NET Mock Objects"> <description>Build file for main .NET Mock Objects module</description> <property name="debug" value="true"/> <property name="build.dir" value="build/"/> <property name="project.name" value="DotNetMock"/> <tstamp/> <target name="init" description="Setup environment"> <mkdir dir="${build.dir}" failonerror="false"/> </target> <target name="clean" description="Cleans environment to pre-build state"> <delete dir="${build.dir}" failonerror="false"/> <delete file="../lib/${project.name}.dll" failonerror="false"/> </target> <target name="build" description="Builds .NET Mock Object main module" depends="init"> <csc target="library" output="${build.dir}/${project.name}.dll" debug="${debug}"> <sources basedir="."> <includes name="**/*.cs"/> </sources> <references basedir="../lib"> <includes name="nunit.framework.dll" /> </references> </csc> <copy file="${build.dir}/${project.name}.dll" todir="../lib"/> </target> </project> Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssemblyInfo.cs 21 Sep 2002 06:19:18 -0000 1.2 --- AssemblyInfo.cs 11 Oct 2002 00:24:37 -0000 1.3 *************** *** 55,58 **** // [assembly: AssemblyDelaySign(false)] ! [assembly: AssemblyKeyFile(@"..\..\..\dotnetmock.snk")] [assembly: AssemblyKeyName("")] --- 55,58 ---- // [assembly: AssemblyDelaySign(false)] ! [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] |
From: <gc...@us...> - 2002-10-11 00:24:42
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Data In directory usw-pr-cvs1:/tmp/cvs-serv16044/DotNetMock/Data Modified Files: MockDataParameter.cs Log Message: Added NAnt build files Index: MockDataParameter.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Data/MockDataParameter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MockDataParameter.cs 7 Oct 2002 00:07:43 -0000 1.1 --- MockDataParameter.cs 11 Oct 2002 00:24:38 -0000 1.2 *************** *** 6,10 **** { /// <summary> ! /// Summary description for MockDataParameter. /// </summary> public class MockDataParameter : MockObject, IDataParameter --- 6,10 ---- { /// <summary> ! /// This is a Mock object that implements the IDataParameter interface. /// </summary> public class MockDataParameter : MockObject, IDataParameter *************** *** 16,20 **** --- 16,28 ---- private ExpectationValue _parameterType = new ExpectationValue("MockDataParameter.Type"); + /// <summary> + /// Default, Empty Constructor + /// </summary> public MockDataParameter() {} + /// <summary> + /// Initializes a new MockDataParameter with the supplied name and of the supplied type + /// </summary> + /// <param name="name">Name for new parameter</param> + /// <param name="newType">Type for new parameter</param> public MockDataParameter(string name, DbType newType) { *************** *** 22,25 **** --- 30,38 ---- _parameterType.Actual = newType; } + /// <summary> + /// Initializes a new MockDataParameter with the supplied name and value + /// </summary> + /// <param name="name">Name for the new parameter</param> + /// <param name="value">Value for the new parameter</param> public MockDataParameter(string name, string value) { *************** *** 27,30 **** --- 40,50 ---- _parameterValue.Actual = value; } + /// <summary> + /// Initializes a new MockDataParameter with supplied name, and of the supplied type, corresponding to the + /// supplied column + /// </summary> + /// <param name="name">Name for the new parameter</param> + /// <param name="newType">Type for new parameter</param> + /// <param name="sourceColumn">Corresponding column for the parameter</param> public MockDataParameter(string name, DbType newType, string sourceColumn) { *************** *** 33,37 **** _parameterSourceColumn.Actual = sourceColumn; } ! public void SetExpectedName(string name) { --- 53,60 ---- _parameterSourceColumn.Actual = sourceColumn; } ! /// <summary> ! /// Sets expected name ! /// </summary> ! /// <param name="name">Parameter name to expect</param> public void SetExpectedName(string name) { |
From: <gc...@us...> - 2002-10-11 00:24:42
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory usw-pr-cvs1:/tmp/cvs-serv16044/DotNetMock.Tests Added Files: DotNetMock.Tests.build Log Message: Added NAnt build files --- NEW FILE: DotNetMock.Tests.build --- <?xml version="1.0"?> <project name=".NET Mock Objects Tests"> <description>Build file for .NET Mock Objects Tests module</description> <property name="debug" value="true"/> <property name="build.dir" value="build/"/> <property name="project.name" value="DotNetMock.Tests"/> <tstamp/> <target name="init" description="Setup environment"> <mkdir dir="${build.dir}" failonerror="false"/> </target> <target name="clean" description="Cleans environment to pre-build state"> <delete dir="${build.dir}" failonerror="false"/> </target> <target name="build" description="Builds .NET Mock Object tests module" depends="init"> <csc target="library" output="${build.dir}/${project.name}.dll" debug="${debug}"> <sources basedir="."> <includes name="**/*.cs"/> </sources> <references basedir="../lib"> <includes name="nunit.framework.dll"/> <includes name="DotNetMock.dll"/> </references> </csc> </target> </project> |
From: <gc...@us...> - 2002-10-07 00:10:38
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory usw-pr-cvs1:/tmp/cvs-serv29443/DotNetMock.Tests Added Files: DotNetMock.Tests.csproj Log Message: --- NEW FILE: DotNetMock.Tests.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.0.9466" SchemaVersion = "1.0" ProjectGuid = "{0FBE418F-86AF-4E83-B66F-C0177CE582BC}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "DotNetMock.Tests" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" RootNamespace = "DotNetMock.tests" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "true" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" /> <Reference Name = "DotNetMock" Project = "{1AD0CD00-16FA-4456-B2ED-A47406957228}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "nunit.framework" AssemblyName = "nunit.framework" HintPath = "..\..\..\dev_utils\nunit\bin\nunit.framework.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ExpectationArrayListTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ExpectationBoolTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ExpectationCounterTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ExpectationStringTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ExpectationTypeTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ExpectationValueTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "MockObjectTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "NullTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ReturnValueTest.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "VerifierTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Data\MockDataParameterTests.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> |
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests In directory usw-pr-cvs1:/tmp/cvs-serv28945/DotNetMock.Tests Added Files: AssemblyInfo.cs ExpectationArrayListTests.cs ExpectationBoolTests.cs ExpectationCounterTests.cs ExpectationListTest.cs ExpectationStringTests.cs ExpectationTypeTests.cs ExpectationValueTests.cs MockObjectTests.cs NullTests.cs ReturnValueTest.cs VerifierTests.cs Log Message: Moved testdotnetmock -> DotNetMock.Tests --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] --- NEW FILE: ExpectationArrayListTests.cs --- namespace DotNetMock.tests { using System; using System.Collections; using NUnit.Framework; using DotNetMock; /// <summary> /// Summary description for ExpectationArrayListTests. /// </summary> [TestFixture] public class ExpectationArrayListTests { private ExpectationArrayList _expectationArrayList = null; [SetUp] public void SetUp() { _expectationArrayList = new ExpectationArrayList("ExpectationArrayList"); } [TearDown] public void TearDown() { _expectationArrayList = null; } [Test] public void Empty() { _expectationArrayList.Verify(); } [Test] public void HasExpectations() { ArrayList arrayList3 = new ArrayList(); 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; } [Test] public void HasExpectationsFromArray() { string[] strings = new String[3]; strings[0] = "A"; strings[1] = "B"; strings[2] = "C"; NUnit.Framework.Assertion.Assert(!_expectationArrayList.HasExpectations); _expectationArrayList.AddExpectedMany(strings); NUnit.Framework.Assertion.Assert(_expectationArrayList.HasExpectations); } [Test] public void HasExpectationsFromEnumerator() { Hashtable table = new Hashtable(); table.Add("mock", "objects"); NUnit.Framework.Assertion.Assert(!_expectationArrayList.HasExpectations); _expectationArrayList.AddExpectedMany(table); NUnit.Framework.Assertion.Assert(_expectationArrayList.HasExpectations); } [Test] public void HasNotExpectations() { _expectationArrayList.AddActual("A"); NUnit.Framework.Assertion.Assert(!_expectationArrayList.HasExpectations); } [Test] public void Verify() { ArrayList arrayList4 = new ArrayList(); ArrayList arrayList5 = new ArrayList(); ArrayList arrayList6 = new ArrayList(); arrayList4.Add(3); arrayList4.Add(4); arrayList4.Add(5); arrayList5.Add(6); arrayList5.Add(7); arrayList5.Add(8); arrayList6.Add(3); arrayList6.Add(4); arrayList6.Add(5); _expectationArrayList.AddActualMany(arrayList4); _expectationArrayList.AddExpectedMany(arrayList5); try { _expectationArrayList.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } _expectationArrayList.ClearExpected(); _expectationArrayList.AddExpectedMany(arrayList6); _expectationArrayList.Verify(); arrayList4 = null; arrayList5 = null; arrayList6 = null; } [Test] public void FailImmediately() { _expectationArrayList.AddExpected("A"); _expectationArrayList.AddExpected("B"); _expectationArrayList.AddActual("A"); try { _expectationArrayList.AddActual("C"); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } } [Test] public void FailImmediatelyTooMany() { _expectationArrayList.AddExpected("A"); _expectationArrayList.AddActual("A"); try { _expectationArrayList.AddActual("C"); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } } [Test] public void FlushExpected() { _expectationArrayList.AddExpected("A"); _expectationArrayList.ExpectNothing(); _expectationArrayList.Verify(); } [Test] [ExpectedException(typeof(AssertionException))] public void FailingVerify() { _expectationArrayList.AddExpected("A"); _expectationArrayList.AddExpected("B"); _expectationArrayList.AddExpected("C"); _expectationArrayList.AddActual("A"); _expectationArrayList.AddActual("B"); _expectationArrayList.AddActual("B"); _expectationArrayList.Verify(); } [Test] public void AddSingleItem() { int int1 = 2; _expectationArrayList.AddExpected(int1); _expectationArrayList.AddActual(int1); _expectationArrayList.Verify(); } [Test] public void AddManyFromArray() { string[] array = new string[3]; array[0] = "A"; array[1] = "B"; array[2] = "C"; _expectationArrayList.AddExpectedMany(array); _expectationArrayList.AddActualMany(array); _expectationArrayList.Verify(); } [Test] public void AddManyFromEnumerator() { Hashtable hashExpected = new Hashtable(); hashExpected.Add("mock", "objects"); hashExpected.Add("source", "forge"); Hashtable hashActual = new Hashtable(); hashActual.Add("mock", "objects"); hashActual.Add("source", "forge"); _expectationArrayList.AddExpectedMany(hashExpected); _expectationArrayList.AddActualMany(hashActual); _expectationArrayList.Verify(); } } } --- NEW FILE: ExpectationBoolTests.cs --- using System; using NUnit.Framework; namespace DotNetMock.tests { /// <summary> /// Summary description for ExpectationBoolTests. /// </summary> [TestFixture] public class ExpectationBoolTests { private ExpectationBool _expectationBool = null; [SetUp] public void Init() { _expectationBool = new ExpectationBool("ExpectationBool.Tests"); } [TearDown] public void Desstroy() { _expectationBool = null; } [Test] 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); } [Test] 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); } [Test] public void HasExpectations() { NUnit.Framework.Assertion.Assert(!_expectationBool.Expected); _expectationBool.Expected = true; NUnit.Framework.Assertion.Assert(_expectationBool.Expected); NUnit.Framework.Assertion.Assert(_expectationBool.HasExpectations); } [Test] public void Verify() { _expectationBool.Actual = true; _expectationBool.Expected = false; try { _expectationBool.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } _expectationBool.Expected = true; _expectationBool.Verify(); } [Test] public void FailureMode() { _expectationBool.Expected = true; NUnit.Framework.Assertion.Assert(_expectationBool.HasExpectations); NUnit.Framework.Assertion.Assert(!(_expectationBool.ShouldCheckImmediate)); _expectationBool.VerifyImmediate = true; NUnit.Framework.Assertion.Assert(_expectationBool.ShouldCheckImmediate); } [Test] 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); } [Test] 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); } } } --- NEW FILE: ExpectationCounterTests.cs --- namespace DotNetMock.tests { using System; using NUnit.Framework; /// <summary> /// Test case for ExpectationCounter /// </summary> [TestFixture] public class ExpectationCounterTests { private ExpectationCounter _counter; public ExpectationCounterTests(): base() {} public ExpectationCounterTests(String name) : base() {} [SetUp] public void SetUp() { _counter = new ExpectationCounter("ExpectationCounter"); } [TearDown] public void TearDown() { _counter = null; } [Test] public void ExpectNothing() { _counter.ExpectNothing(); Assertion.Assert("Has expectation", _counter.HasExpectations); _counter.Verify(); } [Test] [ExpectedException(typeof(AssertionException))] public void ExpectNothingFailure() { _counter.ExpectNothing(); _counter.VerifyImmediate = true; Assertion.Assert("Has expectation", _counter.HasExpectations); _counter.Inc(); } [Test] [ExpectedException(typeof(AssertionException))] public void FailImmediately() { _counter.Expected = 1; _counter.VerifyImmediate = true; _counter.Inc(); _counter.Inc(); } [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) { } } [Test] [ExpectedException(typeof(AssertionException))] public void NotEnoughCalls() { _counter.Expected = 1; _counter.Verify(); } [Test] public void FlushActual() { _counter.Inc(); _counter.ClearActual(); _counter.Expected = 1; _counter.Inc(); _counter.Verify(); } [Test] public void HasNoExpectations() { _counter.Inc(); Assertion.Assert("Should have no expectations", !_counter.HasExpectations); } [Test] public void Success() { _counter.Expected = 1; _counter.Inc(); _counter.Verify(); } } } --- NEW FILE: ExpectationListTest.cs --- namespace DotNetMock.tests { using System; using System.Collections; using NUnit.Framework; [TestFixture] public class ExpectationListTests { private ExpectationList el; [SetUp] public void SetUp() { el = new ExpectationList("Test expectation list"); } [Test] public void testEmpty() { el.verify(); } [Test] [ExpectedException(typeof(AssertionException))] public void testFailImmediately() { el.AddExpected("A"); el.AddExpected("B"); el.verifyImmediate = true; el.AddActual("A"); el.AddActual("C"); } [Test] [ExpectedException(typeof(AssertionException))] public void testFailImmediatelyTooMany() { el.verifyImmediate = true; el.AddExpected("A"); el.AddActual("A"); el.AddActual("A"); } [Test] public void testFailOnVerify() { el.AddExpected("A"); try { el.AddActual("B"); } catch (AssertionException ae) { Assertion.Fail("Exception should not have been thrown yet"); } try { el.verify(); } catch (AssertionException ae) { // Success } } [Test] public void testHasExpectations() { Assertion.Assert("Should not have any expectations", !el.hasExpectations); el.AddExpected("A"); Assertion.Assert("Should have expectation",el.hasExpectations); } [Test] public void testExpectedFromArrayList(){ ArrayList expected = new ArrayList(); expected.Add("A"); expected.Add("B"); el.AddExpectedCollection(expected); el.AddActual("A"); el.AddActual("B"); el.verify(); } [Test] public void testActualFromArrayList(){ ArrayList actual = new ArrayList(); actual.Add("A"); actual.Add("B"); el.AddActualCollection(actual); el.AddExpected("A"); el.AddExpected("B"); el.verify(); } [Test] public void testStringArray() { String[] actual = new String[] {"A", "B"}; el.AddExpected("A"); el.AddExpected("B"); el.AddActualCollection(actual); el.verify(); } [Test] [ExpectedException(typeof(AssertionException))] public void testFailingStringArray() { String[] expected = new String[] {"A", "B"}; el.AddExpectedCollection(expected); el.verifyImmediate = true; el.AddActual("A"); el.AddActual("C"); } [Test] [ExpectedException(typeof(AssertionException))] public void testFailingStringArrayOnVerify() { String[] expected = new String[] {"A", "B", "C"}; el.AddExpectedCollection(expected); el.verifyImmediate = false; el.AddActual("A"); el.AddActual("B"); el.AddActual("D"); el.verify(); } [Test] public void testSorted() { el.AddExpected("A"); el.AddExpected("B"); el.AddActual("A"); el.AddActual("B"); el.verify(); } } } --- NEW FILE: ExpectationStringTests.cs --- namespace DotNetMock.tests { using System; using NUnit.Framework; using DotNetMock; /// <summary> /// Summary description for ExpectationStringTests. /// </summary> [TestFixture] public class ExpectationStringTests { ExpectationString _expectationString = null; public ExpectationStringTests(string name) : base() {} public ExpectationStringTests() : base() {} [SetUp] public void SetUp() { _expectationString = new ExpectationString("ExpectationString"); } [TearDown] public void TearDown() { _expectationString = null; } [Test] public void SetActual() { string test1 = "Mock Objects are Cool"; NUnit.Framework.Assertion.AssertNull(_expectationString.Actual); _expectationString.Actual = test1; NUnit.Framework.Assertion.AssertNotNull(_expectationString.Actual); _expectationString.ClearActual(); NUnit.Framework.Assertion.AssertNull(_expectationString.Actual); } [Test] public void SetExpected() { 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); } [Test] public void HasExpectations() { string test3 = "Sourceforge is nice."; NUnit.Framework.Assertion.AssertNull(_expectationString.Expected); _expectationString.Expected = test3; NUnit.Framework.Assertion.AssertNotNull(_expectationString.Expected); NUnit.Framework.Assertion.Assert(_expectationString.HasExpectations); test3 = null; } [Test] public void Verify() { string test4 = "Mock Objects are cool."; string test5 = "Sourceforge is nice."; string test6 = "Mock Objects are cool."; _expectationString.Actual = test4; _expectationString.Expected = test5; try { _expectationString.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } _expectationString.Expected = test6; _expectationString.Verify(); test4 = null; test5 = null; test6 = null; } [Test] public void FailureMode() { string test7 = ""; _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; } [Test] public void ClearActual() { 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; } [Test] public void ClearExpected() { 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; } } } --- NEW FILE: ExpectationTypeTests.cs --- using System; using DotNetMock; using NUnit.Framework; namespace DotNetMock.tests { /// <summary> /// Summary description for ExpectationTypeTests. /// </summary> [TestFixture] public class ExpectationTypeTests { private ExpectationType _expectationType = null; [SetUp] public void SetUp() { _expectationType = new ExpectationType("ExpectationValue"); } [TearDown] public void TearDown() { _expectationType = null; } [Test] public void SetActual() { Type type1 = typeof(string); NUnit.Framework.Assertion.AssertNull(_expectationType.Actual); _expectationType.Actual = type1; NUnit.Framework.Assertion.AssertEquals(type1, _expectationType.Actual); type1 = null; } [Test] public void SetExpected() { Type type2 = typeof(int); NUnit.Framework.Assertion.AssertNull(_expectationType.Expected); _expectationType.Expected = type2; NUnit.Framework.Assertion.AssertEquals(type2, _expectationType.Expected); type2 = null; } [Test] public void HasExpectations() { Type type3 = typeof(float); _expectationType.Expected = type3; NUnit.Framework.Assertion.Assert(_expectationType.HasExpectations); type3 = null; } [Test] public void Verify() { Type type1 = typeof(string); Type type2 = typeof(int); Type type3 = typeof(string); _expectationType.Actual = type1 ; _expectationType.Expected = type2 ; try { _expectationType.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } _expectationType.Expected = type3 ; _expectationType.Verify(); } [Test] public void FailureMode() { Type type4 = typeof(double); _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; } [Test] public void ClearActual() { 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; } [Test] public void ClearExpected() { 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; } [Test] public void NullValues() { _expectationType.ExpectNothing(); _expectationType.ClearActual(); _expectationType.Verify(); } } } --- NEW FILE: ExpectationValueTests.cs --- namespace DotNetMock.tests { using System; using NUnit.Framework; using DotNetMock; /// <summary> /// Summary description for ExpectationValueTests. /// </summary> [TestFixture] public class ExpectationValueTests { private ExpectationValue _expectationValue; public ExpectationValueTests(string name) : base() {} public ExpectationValueTests() : base() {} [SetUp] public void SetUp() { _expectationValue = new ExpectationValue("ExpectationValue"); } [TearDown] public void TearDown() { _expectationValue = null; } [Test] public void SetActual() { Object object1 = new Object(); NUnit.Framework.Assertion.AssertNull(_expectationValue.Actual); _expectationValue.Actual = object1; NUnit.Framework.Assertion.AssertEquals(object1, _expectationValue.Actual); object1 = null; } [Test] public void SetExpected() { Object object2 = new Object(); NUnit.Framework.Assertion.AssertNull(_expectationValue.Expected); _expectationValue.Expected = object2; NUnit.Framework.Assertion.AssertEquals(object2, _expectationValue.Expected); object2 = null; } [Test] public void HasExpectations() { Object object3 = new Object(); _expectationValue.Expected = object3; NUnit.Framework.Assertion.Assert(_expectationValue.HasExpectations); object3 = null; } [Test] public void Verify() { int int1 = 3; int int2 = 5; int int3 = 3; _expectationValue.Actual = int1 ; _expectationValue.Expected = int2 ; try { _expectationValue.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } _expectationValue.Expected = int3 ; _expectationValue.Verify(); } [Test] public void FailureMode() { Object object4 = new Object(); _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; } [Test] public void ClearActual() { 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; } [Test] public void ClearExpected() { 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; } [Test] public void NullValues() { _expectationValue.ExpectNothing(); _expectationValue.ClearActual(); _expectationValue.Verify(); } } } --- NEW FILE: MockObjectTests.cs --- namespace DotNetMock.tests { using System; using NUnit.Framework; using DotNetMock; /// <summary> /// Summary description for MockObjectTests. /// </summary> [TestFixture] public class MockObjectTests { private MockObject _mockObject; [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"); } public void AssertEquals() { Object object1 = new Object(); Object object2 = object1; _mockObject.AssertEquals("", object1, object2); } [Test] [ExpectedException(typeof(AssertionException))] public void NotAssertEquals() { Object object1 = new Object(); Object object2 = new Object(); _mockObject.AssertEquals("", object1, object2); NUnit.Framework.Assertion.Fail("Assertion Failed: testAssertFalse"); } [Test] public void AssertTrue() { _mockObject.AssertTrue("", true); } [Test] [ExpectedException(typeof(AssertionException))] public void AssertFalse() { _mockObject.AssertTrue("", false); throw new System.ApplicationException("Assertion Failed: testAssertFalse"); } [Test] [ExpectedException(typeof(AssertionException))] public void Fail() { _mockObject.Fail("Failed"); NUnit.Framework.Assertion.Fail("Assertion Failed: testFail"); } [Test] public void Verify() { _mockObject.Verify(); } } } --- NEW FILE: NullTests.cs --- namespace DotNetMock.tests { using System; using NUnit.Framework; using DotNetMock; /// <summary> /// Summary description for Null Class. /// </summary> [TestFixture] public class NullTests { private Null _null = null; public NullTests(string name) : base() {} public NullTests() : base() {} [SetUp] public void SetUp() { _null = new Null(); } [TearDown] public void TearDown() { _null = null; } [Test] public void Null() { NUnit.Framework.Assertion.AssertEquals("null", _null.ToString()); _null = new Null("Null Object"); NUnit.Framework.Assertion.AssertEquals("Null Object", _null.ToString()); Null null2 = new Null(); int int1 = 3; NUnit.Framework.Assertion.Assert(!_null.Equals(int1)); NUnit.Framework.Assertion.Assert(_null.Equals(null2)); } } } --- NEW FILE: ReturnValueTest.cs --- namespace DotNetMock.tests { using System; using System.Collections; using NUnit.Framework; [TestFixture] public class ReturnValueTest { private ReturnValue r; [SetUp] public void SetUp() { r = new ReturnValue("Test Return Value"); } [Test] public void ValidAddAndRetrieve() { r.RepeatFinalValue = false; r.Add("A"); r.Add("B"); Assertion.AssertEquals("A", r.Next()); Assertion.AssertEquals("B", r.Next()); } [Test] public void ValidRepeatedRetrieve() { r.RepeatFinalValue = true; r.Add("A"); 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()); } [Test] [ExpectedException(typeof(AssertionException))] public void InvalidRepeatedRetrieve() { r.Add("A"); r.Add("B"); Assertion.AssertEquals("A", r.Next()); Assertion.AssertEquals("B", r.Next()); r.Next(); } [Test] public void AddCollection() { ArrayList args = new ArrayList(); args.Add("A"); args.Add("B"); args.Add("C"); r.AddCollection(args); Assertion.AssertEquals("A", r.Next()); Assertion.AssertEquals("B", r.Next()); Assertion.AssertEquals("C", r.Next()); } [Test] [ExpectedException(typeof(SystemException))] public void ExceptionalValues() { r.Add("A"); r.Add(new SystemException("Deliberate exception")); Assertion.AssertEquals("A", r.Next()); r.Next(); } } } --- NEW FILE: VerifierTests.cs --- namespace DotNetMock.tests { using System; using NUnit.Framework; using DotNetMock; /// <summary> /// Summary description for VerifierTests. /// </summary> [TestFixture] public class VerifierTests { /// /// <summary>Inner class to test single values</summary> /// private class OneVerifiable : MockObject { private ExpectationValue _expectationValue = new ExpectationValue("Should Fail"); // Non-Verifiable fields to check it correctly ignores them. private String _stringField; public int _intField = 5; // Non-Verifiable Property public String StringField { set { _stringField = value; } get { return _stringField; } } public OneVerifiable() : base() { _expectationValue.Expected = "Good"; } public Object ActualValue { set { _expectationValue.Actual = value; } get { return _expectationValue.Actual; } } } ///<summary>Check inheritence works</summary> private class InheritVerifiable : OneVerifiable {} private OneVerifiable _mockObject = null; public VerifierTests(string name) : base() {} public VerifierTests() {} [SetUp] public void SetUp() { _mockObject = new OneVerifiable(); } [TearDown] public void TearDown() {} [Test] public void OneVerifiablePasses() { _mockObject.ActualValue = "Good"; _mockObject.Verify(); } [Test] [ExpectedException(typeof(AssertionException))] public void OneVerifiableFails() { _mockObject.ActualValue = "bad"; _mockObject.Verify(); } [Test] [ExpectedException(typeof(AssertionException))] public void InheritVerifiableFails() { InheritVerifiable inheritVerifiable = new InheritVerifiable(); inheritVerifiable.ActualValue = "bad"; inheritVerifiable.Verify(); } [Test] public void InheritVerifiablePasses() { InheritVerifiable inheritVerifiable = new InheritVerifiable(); inheritVerifiable.ActualValue = "Good"; inheritVerifiable.Verify(); } [Test] public void NoVerifiables() { new MockObject().Verify(); } } } |
From: <gc...@us...> - 2002-10-07 00:09:47
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/data In directory usw-pr-cvs1:/tmp/cvs-serv28945/DotNetMock.Tests/data Added Files: MockDataParameterTests.cs Log Message: Moved testdotnetmock -> DotNetMock.Tests --- NEW FILE: MockDataParameterTests.cs --- using System; using System.Data; using NUnit.Framework; using DotNetMock.Data; namespace DotNetMock.tests.Data { /// <summary> /// Summary description for MockDataParameterTests. /// </summary> [TestFixture] public class MockDataParameterTests { private MockDataParameter _mockDataParameter = null; [SetUp] public void Init() { } [TearDown] public void Destroy() { _mockDataParameter = null; } [Test] public void IsNullable() { _mockDataParameter = new MockDataParameter(); _mockDataParameter.SetExpectedNullable(true); _mockDataParameter.IsNullable = true; _mockDataParameter.Verify(); _mockDataParameter.SetExpectedNullable(false); try { _mockDataParameter.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } } [Test] public void ConstructorNameValue() { _mockDataParameter = new MockDataParameter("@inpID", "123456"); _mockDataParameter.SetExpectedName("@inpID"); _mockDataParameter.SetExpectedValue("123456"); _mockDataParameter.Verify(); _mockDataParameter.SetExpectedName("@inpPassword"); _mockDataParameter.SetExpectedValue("654321"); try { _mockDataParameter.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } } [Test] public void ConstructorNameTypeSourceColumn() { _mockDataParameter = new MockDataParameter("@inpID", DbType.String, "ID"); _mockDataParameter.SetExpectedName("@inpID"); _mockDataParameter.SetExpectedType(DbType.String); _mockDataParameter.SetExpectedSourceColumn("ID"); _mockDataParameter.Verify(); _mockDataParameter.SetExpectedType(DbType.Int32); try { _mockDataParameter.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } _mockDataParameter.SetExpectedSourceColumn("Fake"); _mockDataParameter.SetExpectedType(DbType.String); try { _mockDataParameter.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } } [Test] public void ConstructorNameType() { _mockDataParameter = new MockDataParameter("@inpID", DbType.String); _mockDataParameter.SetExpectedName("@inpID"); _mockDataParameter.SetExpectedType(DbType.String); _mockDataParameter.Verify(); _mockDataParameter.SetExpectedType(DbType.Int32); try { _mockDataParameter.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } } [Test] public void SetValue() { _mockDataParameter = new MockDataParameter(); _mockDataParameter.SetExpectedValue("ID"); _mockDataParameter.SetExpectedType(DbType.String); _mockDataParameter.Value = "ID"; _mockDataParameter.Verify(); _mockDataParameter.SetExpectedType(DbType.Int32); try { _mockDataParameter.Verify(); NUnit.Framework.Assertion.Fail("Should have thrown an exception."); } catch (NUnit.Framework.AssertionException ex) { } } } } |
From: <gc...@us...> - 2002-10-07 00:08:50
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/data In directory usw-pr-cvs1:/tmp/cvs-serv28854/data Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/data added to the repository |
From: <gc...@us...> - 2002-10-07 00:07:47
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Data In directory usw-pr-cvs1:/tmp/cvs-serv28500 Added Files: MockDataParameter.cs Log Message: --- NEW FILE: MockDataParameter.cs --- using System; using System.Data; using DotNetMock; namespace DotNetMock.Data { /// <summary> /// Summary description for MockDataParameter. /// </summary> public class MockDataParameter : MockObject, IDataParameter { private ExpectationBool _nullable = new ExpectationBool("MockDataParameter.IsNullable"); private ExpectationString _parameterName = new ExpectationString("MockDataParameter.Name"); private ExpectationValue _parameterValue = new ExpectationValue("MockDataParameter.Value"); private ExpectationString _parameterSourceColumn = new ExpectationString("MockDataParameter.SourceColumn"); private ExpectationValue _parameterType = new ExpectationValue("MockDataParameter.Type"); public MockDataParameter() {} public MockDataParameter(string name, DbType newType) { _parameterName.Actual = name; _parameterType.Actual = newType; } public MockDataParameter(string name, string value) { _parameterName.Actual = name; _parameterValue.Actual = value; } public MockDataParameter(string name, DbType newType, string sourceColumn) { _parameterName.Actual = name; _parameterType.Actual = newType; _parameterSourceColumn.Actual = sourceColumn; } public void SetExpectedName(string name) { _parameterName.Expected = name; } public void SetExpectedValue(string value) { _parameterValue.Expected = value; } public void SetExpectedNullable(bool nullable) { _nullable.Expected = nullable; } public void SetExpectedType(DbType expectedType) { _parameterType.Expected = expectedType; } public void SetExpectedSourceColumn(string column) { _parameterSourceColumn.Expected = column; } #region Implementation of IDataParameter // TODO: Implement complete directions: Input, Output, InputOutput, and ReturnValue public System.Data.ParameterDirection Direction { get { return new System.Data.ParameterDirection(); } set { } } public System.Data.DbType DbType { get { return (DbType)_parameterType.Actual; } set { } } public object Value { get { return _parameterValue.Actual; } set { _parameterValue.Actual = value; _parameterType.Actual = inferType(value); } } public bool IsNullable { set { _nullable.Actual = value; } get { return _nullable.Actual; } } /// TODO: Implement different DataRowVersion information: Current, Proposed, Default, and Original public System.Data.DataRowVersion SourceVersion { get { return DataRowVersion.Current; } set { } } public string ParameterName { get { return _parameterName.Actual; } set { } } public string SourceColumn { get { return _parameterSourceColumn.Actual; } set { } } #endregion private DbType inferType(Object value) { switch (Type.GetTypeCode(value.GetType())) { case TypeCode.Empty: throw new SystemException("Invalid data type"); case TypeCode.Object: return DbType.Object; case TypeCode.DBNull: case TypeCode.Char: case TypeCode.SByte: case TypeCode.UInt16: case TypeCode.UInt32: case TypeCode.UInt64: // Throw a SystemException for unsupported data types. throw new SystemException("Invalid data type"); case TypeCode.Boolean: return DbType.Boolean; case TypeCode.Byte: return DbType.Byte; case TypeCode.Int16: return DbType.Int16; case TypeCode.Int32: return DbType.Int32; case TypeCode.Int64: return DbType.Int64; case TypeCode.Single: return DbType.Single; case TypeCode.Double: return DbType.Double; case TypeCode.Decimal: return DbType.Decimal; case TypeCode.DateTime: return DbType.DateTime; case TypeCode.String: return DbType.String; default: throw new SystemException("Value is of unknown data type"); } } } } |
From: <gc...@us...> - 2002-10-07 00:06:32
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Data In directory usw-pr-cvs1:/tmp/cvs-serv28083/Data Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock/Data added to the repository |
From: <gc...@us...> - 2002-10-07 00:06:17
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv27946/DotNetMock Modified Files: DotNetMock.csproj Log Message: Index: DotNetMock.csproj =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/DotNetMock.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DotNetMock.csproj 29 Sep 2002 23:15:57 -0000 1.7 --- DotNetMock.csproj 7 Oct 2002 00:06:14 -0000 1.8 *************** *** 163,172 **** /> <File ! RelPath = "sql\MockDataParameter.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "sql\MockDataParameterCollection.cs" SubType = "Code" BuildAction = "Compile" --- 163,167 ---- /> <File ! RelPath = "Data\MockDataParameter.cs" SubType = "Code" BuildAction = "Compile" |
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv22770/DotNetMock Modified Files: AbstractExpectationCollection.cs DotNetMock.csproj ExpectationString.cs ExpectationValue.cs MockObject.cs Log Message: Added MockDataParameter Index: AbstractExpectationCollection.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/AbstractExpectationCollection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractExpectationCollection.cs 25 Sep 2002 00:12:21 -0000 1.1 --- AbstractExpectationCollection.cs 29 Sep 2002 23:15:57 -0000 1.2 *************** *** 90,93 **** --- 90,94 ---- public override void Verify() { + NUnit.Framework.Assertion.AssertEquals(GetExpectedCollection().Count, GetActualCollection().Count); for (int i = 0; i < GetActualCollection().Count; i++) { Index: DotNetMock.csproj =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/DotNetMock.csproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DotNetMock.csproj 25 Sep 2002 00:12:21 -0000 1.6 --- DotNetMock.csproj 29 Sep 2002 23:15:57 -0000 1.7 *************** *** 108,111 **** --- 108,116 ---- /> <File + RelPath = "ExpectationBool.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ExpectationCollection.cs" SubType = "Code" *************** *** 123,126 **** --- 128,136 ---- /> <File + RelPath = "ExpectationType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ExpectationValue.cs" SubType = "Code" *************** *** 149,152 **** --- 159,172 ---- <File RelPath = "Verifier.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "sql\MockDataParameter.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "sql\MockDataParameterCollection.cs" SubType = "Code" BuildAction = "Compile" Index: ExpectationString.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationString.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExpectationString.cs 21 Sep 2002 06:19:18 -0000 1.3 --- ExpectationString.cs 29 Sep 2002 23:15:57 -0000 1.4 *************** *** 65,69 **** if (this.HasExpectations) { ! NUnit.Framework.Assertion.AssertEquals(this._expectedString, this._actualString); } } --- 65,69 ---- if (this.HasExpectations) { ! NUnit.Framework.Assertion.AssertEquals("String values not equal.", this._expectedString, this._actualString); } } Index: ExpectationValue.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationValue.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExpectationValue.cs 21 Sep 2002 06:19:18 -0000 1.6 --- ExpectationValue.cs 29 Sep 2002 23:15:57 -0000 1.7 *************** *** 66,70 **** if (this.HasExpectations) { ! NUnit.Framework.Assertion.AssertEquals(this._expectedValue, this._actualValue); } } --- 66,70 ---- if (this.HasExpectations) { ! NUnit.Framework.Assertion.AssertEquals("Object values do not equal.",this._expectedValue, this._actualValue); } } Index: MockObject.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/MockObject.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MockObject.cs 21 Sep 2002 06:19:18 -0000 1.3 --- MockObject.cs 29 Sep 2002 23:15:57 -0000 1.4 *************** *** 8,12 **** public class MockObject : Verifiable { ! public MockObject() {} /// <summary> /// Asserts two objects are equal. --- 8,19 ---- public class MockObject : Verifiable { ! protected string _name = null; ! public MockObject(string name) { ! _name = name; ! } ! public MockObject() ! { ! _name = "MockObject"; ! } /// <summary> /// Asserts two objects are equal. |
From: <gc...@us...> - 2002-09-29 23:16:00
|
Update of /cvsroot/dotnetmock/dotnetmock In directory usw-pr-cvs1:/tmp/cvs-serv22770 Modified Files: DotNetMock.sln Log Message: Added MockDataParameter Index: DotNetMock.sln =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.sln,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DotNetMock.sln 21 Sep 2002 06:28:15 -0000 1.2 --- DotNetMock.sln 29 Sep 2002 23:15:57 -0000 1.3 *************** *** 21,27 **** {0FBE418F-86AF-4E83-B66F-C0177CE582BC}.Release.Build.0 = Release|.NET EndGlobalSection - GlobalSection(SolutionItems) = postSolution - Item:1 = DotNetMock.build - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection --- 21,24 ---- |
From: Griffin C. <gri...@at...> - 2002-09-29 23:05:24
|
I am on Central time here in Chicago, IL. I am on MSN, AIM, and Yahoo. So any of those would be fine. First question: What should be the first things implemented? What type of Mock Object would be most reequested? Right now I am doing the System.Data namespace: IDataParameter IDataParameterCollection etc.. Griffin -----Original Message----- From: Darren Hobbs [mailto:da...@ds...] Sent: Sunday, September 29, 2002 6:19 AM To: gri...@at... Subject: Re: .NET Mock Objects Status That sounds like a good idea. How and when do you want to go about it? I'm on GMT, which I think is about 5 hours ahead of you. So saturday or sunday morning / early afternoon your time would be best. I'll need to get set up on an IM system, which one are you on? Regards, -Darren On Saturday 28 September 2002 17:47, gri...@at... wrote: > I feel that we need to get together and plan out what is > going to happen with the .NET Mock Objects. What > direction we are going in and how to get there. > > Right now, I feel as if we as two independent coders > syncing up source every now and then. > > Plus, I don't want any of us wasting time rehashing each > others code. > > Sound good? > > Griffin |
From: Darren H. <da...@fa...> - 2002-09-25 09:36:55
|
ExpectationCollection looks a lot like ExpectationList. Also, I think so= me of=20 the methods might be redundant - I have a feeling that arrays automatical= ly=20 implement ICollection or IEnumerable - you can use the 'foreach' keyword = with=20 them. -Darren |
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv8794/DotNetMock Modified Files: DotNetMock.csproj ExpectationArrayList.cs ExpectationCollection.cs Added Files: AbstractExpectationCollection.cs Log Message: Added AbstractExpectationCollection class COmpleted ExpectationCollection interface Refactored EcpectationArrayList class to utilize new abstract class --- NEW FILE: AbstractExpectationCollection.cs --- using System; using System.Collections; using NUnit.Framework; namespace DotNetMock { /// <summary> /// Summary description for AbstractExpectationCollection. /// </summary> public abstract class AbstractExpectationCollection : AbstractExpectation, ExpectationCollection { public AbstractExpectationCollection(string name) : base(name) {} abstract protected void CheckImmediateValues(object actual); abstract protected IList GetActualCollection(); abstract protected IList GetExpectedCollection(); public void AddActual(object actual) { GetActualCollection().Add(actual); if (ShouldCheckImmediate) { CheckImmediateValues(actual); } } public void AddActualMany(object[] actualMany) { for (int i = 0; i < actualMany.Length; i++) { AddActual(actualMany[i]); } } public void AddActualMany(IEnumerable actualMany) { IEnumerator enumerator = actualMany.GetEnumerator(); while (enumerator.MoveNext()) { AddActual(enumerator.Current); } } public void AddActualMany(IList actualMany) { for (int i = 0; i < actualMany.Count; i++) { AddActual(actualMany[i]); } } public void AddExpected(object expected) { GetExpectedCollection().Add(expected); this.HasExpectations = true; } public void AddExpectedMany(object[] expectedMany) { for (int i = 0; i < expectedMany.Length; i++) { AddExpected(expectedMany[i]); } } public void AddExpectedMany(IEnumerable expectedMany) { IEnumerator enumerator = expectedMany.GetEnumerator(); while (enumerator.MoveNext()) { AddExpected(enumerator.Current); } } public void AddExpectedMany(IList expectedMany) { for (int i = 0; i < expectedMany.Count; i++) { AddExpected(expectedMany[i]); } } public override void ClearActual() { GetActualCollection().Clear(); } public override void ClearExpected() { GetExpectedCollection().Clear(); } public override void ExpectNothing() { ClearExpected(); this.HasExpectations = true; } public override void Verify() { for (int i = 0; i < GetActualCollection().Count; i++) { NUnit.Framework.Assertion.AssertEquals("Collection items not equal.", GetExpectedCollection()[i], GetActualCollection()[i]); } } } } Index: DotNetMock.csproj =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/DotNetMock.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DotNetMock.csproj 21 Sep 2002 06:28:15 -0000 1.5 --- DotNetMock.csproj 25 Sep 2002 00:12:21 -0000 1.6 *************** *** 88,91 **** --- 88,96 ---- /> <File + RelPath = "AbstractExpectationCollection.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "AssemblyInfo.cs" SubType = "Code" *************** *** 129,132 **** --- 134,142 ---- <File RelPath = "Null.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ReturnValue.cs" SubType = "Code" BuildAction = "Compile" Index: ExpectationArrayList.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationArrayList.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExpectationArrayList.cs 21 Sep 2002 06:19:18 -0000 1.4 --- ExpectationArrayList.cs 25 Sep 2002 00:12:21 -0000 1.5 *************** *** 6,105 **** /// Summary description for ArrayList Expectation. /// </summary> ! public class ExpectationArrayList : AbstractExpectation { private ArrayList _actualArrayList = null; private ArrayList _expectedArrayList = null; ! public ExpectationArrayList(string name) : base(name) {} ! /// <summary> ! /// Gets/Sets actual array list. ! /// </summary> ! public ArrayList Actual ! { ! get { return this._actualArrayList; } ! set ! { ! CheckActual(); ! foreach (Object obj in value) ! { ! this._actualArrayList.Add(obj); ! } ! } } ! /// <summary> ! /// Gets/Sets expected array list. ! /// </summary> ! public ArrayList Expected { ! get{ return this._expectedArrayList;} ! set ! { ! CheckExpected(); ! foreach (Object obj in value) ! { ! this._expectedArrayList.Add(obj); ! } ! ! this.HasExpectations = true; ! } ! } ! /// <summary> ! /// Clears Actual array list. ! /// </summary> ! public override void ClearActual() { ! this._actualArrayList = null; ! } ! /// <summary> ! /// Clears Expected array list. ! /// </summary> ! public override void ClearExpected() { ! this._expectedArrayList = null; ! } ! /// <summary> ! /// Verifies Object. ! /// </summary> ! public override void Verify() { ! ! NUnit.Framework.Assertion.AssertEquals("Different lengths", this._expectedArrayList.Count, this._actualArrayList.Count); ! for (int i = 0; i < _expectedArrayList.Count; i++) ! { ! NUnit.Framework.Assertion.AssertEquals(this._expectedArrayList[i], this._actualArrayList[i]); ! } ! } ! /// <summary> ! /// Adds object to actual array list. ! /// </summary> ! /// <param name="actualObject">Object to add.</param> ! public void AddActual(Object actualObject) { ! CheckActual(); ! this._actualArrayList.Add(actualObject); ! } ! /// <summary> ! /// Adds object to expected array list. ! /// </summary> ! /// <param name="expectedObject">Object to add.</param> ! public void AddExpected(Object expectedObject) { ! CheckExpected(); ! this._expectedArrayList.Add(expectedObject); } ! /// <summary> ! /// Checks if actual arraylist exists yet. ! /// </summary> ! private void CheckActual() { ! if (this._actualArrayList == null) ! { ! this._actualArrayList = new ArrayList(); ! } } ! /// <summary> ! /// Checks if expected arraylist exists yet. ! /// </summary> ! private void CheckExpected() { ! if (this._expectedArrayList == null) ! { ! this._expectedArrayList = new ArrayList(); ! } } } --- 6,32 ---- /// Summary description for ArrayList Expectation. /// </summary> ! public class ExpectationArrayList : AbstractExpectationCollection { private ArrayList _actualArrayList = null; private ArrayList _expectedArrayList = null; ! public ExpectationArrayList(string name) : base(name) { ! _actualArrayList = new ArrayList(); ! _expectedArrayList = new ArrayList(); } ! ! protected override IList GetActualCollection() { ! return _actualArrayList; } ! protected override IList GetExpectedCollection() { ! return _expectedArrayList; } ! protected override void CheckImmediateValues(object actual) { ! int size = _actualArrayList.Count; ! NUnit.Framework.Assertion.Assert(_expectedArrayList.Count >= size); ! NUnit.Framework.Assertion.AssertEquals(_expectedArrayList[size -1], actual); } } Index: ExpectationCollection.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationCollection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExpectationCollection.cs 23 Sep 2002 20:13:26 -0000 1.3 --- ExpectationCollection.cs 25 Sep 2002 00:12:21 -0000 1.4 *************** *** 13,21 **** --- 13,51 ---- /// <param name="actual">object to add</param> void AddActual(object actual); + /// <summary> + /// Adds an array of objects to actual collection + /// </summary> + /// <param name="actualMany">array of objects to add</param> void AddActualMany(object[] actualMany); + /// <summary> + /// Adds a Collection that implements the IEnumerable interface to actual collection + /// </summary> + /// <param name="actualMany"></param> + void AddActualMany(IEnumerable actualMany); + /// <summary> + /// Adds the elements of an object that implements IList to the actual collection + /// </summary> + /// <param name="actualMany"></param> void AddActualMany(IList actualMany); + /// <summary> + /// Adds object to expected collection + /// </summary> + /// <param name="expected"></param> void AddExpected(object expected); + /// <summary> + /// Adds an array of objects to expected collection + /// </summary> + /// <param name="expectedMany"></param> void AddExpectedMany(object[] expectedMany); + /// <summary> + /// Adds a Collection that implements the IEnumerable interface to expected collection + /// </summary> + /// <param name="expectedMany"></param> + void AddExpectedMany(IEnumerable expectedMany); + /// <summary> + /// Adds the elements of an object that implements IList to the expected collection + /// </summary> + /// <param name="expectedMany"></param> void AddExpectedMany(IList expectedMany); } |
From: <dar...@us...> - 2002-09-23 20:16:04
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv16841/DotNetMock Modified Files: ReturnValue.cs Log Message: Added HasValues property, primarily for use with void methods - in normal use, no return value will be set, unless an exception is desired to be thrown. Index: ReturnValue.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ReturnValue.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReturnValue.cs 18 Sep 2002 16:24:52 -0000 1.2 --- ReturnValue.cs 23 Sep 2002 20:16:00 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- { private bool repeatFinal; + private bool hasReturnValues; private Queue returnValues = new Queue(); private string name = "Unnamed ReturnValue"; *************** *** 30,35 **** --- 31,49 ---- } + public bool HasValues + { + set + { + this.hasReturnValues = value; + } + get + { + return this.hasReturnValues; + } + } + public void Add(object nextReturnValue) { + HasValues = true; this.returnValues.Enqueue(nextReturnValue); } |
From: <dar...@us...> - 2002-09-23 20:14:43
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv16302/DotNetMock Modified Files: ExpectationList.cs Log Message: Changed method capitalisation Index: ExpectationList.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationList.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExpectationList.cs 18 Sep 2002 14:54:35 -0000 1.2 --- ExpectationList.cs 23 Sep 2002 20:14:41 -0000 1.3 *************** *** 28,32 **** { actual.Add(actualItem); ! if (shouldCheckImmediate) { CheckImmediateValues(actualItem); } --- 28,32 ---- { actual.Add(actualItem); ! if (ShouldCheckImmediate) { CheckImmediateValues(actualItem); } *************** *** 49,61 **** { expected.Add(expectedItem); ! hasExpectations = true; } ! public override void clearActual() { actual.Clear(); } ! public override void clearExpected() { expected.Clear(); --- 49,61 ---- { expected.Add(expectedItem); ! HasExpectations = true; } ! public override void ClearActual() { actual.Clear(); } ! public override void ClearExpected() { expected.Clear(); *************** *** 80,84 **** } ! public override void verify() { NUnit.Framework.Assertion.AssertEquals("Different lengths", expected.Count, actual.Count); --- 80,84 ---- } ! public override void Verify() { NUnit.Framework.Assertion.AssertEquals("Different lengths", expected.Count, actual.Count); |
From: <dar...@us...> - 2002-09-23 20:13:31
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv15995/DotNetMock Modified Files: ExpectationCollection.cs Log Message: Added using System.Collections line Index: ExpectationCollection.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationCollection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExpectationCollection.cs 21 Sep 2002 07:08:52 -0000 1.2 --- ExpectationCollection.cs 23 Sep 2002 20:13:26 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- { using System; + using System.Collections; /// <summary> /// Summary description for Expectation Collection Interface. |
From: Darren H. <da...@fa...> - 2002-09-21 09:47:16
|
Hi, I just did a CVS update, and all the unit tests are missing? Regards, -Darren |
From: <gc...@us...> - 2002-09-21 07:08:56
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock In directory usw-pr-cvs1:/tmp/cvs-serv32027/DotNetMock Modified Files: ExpectationCollection.cs Log Message: Index: ExpectationCollection.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/ExpectationCollection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExpectationCollection.cs 21 Sep 2002 06:19:18 -0000 1.1 --- ExpectationCollection.cs 21 Sep 2002 07:08:52 -0000 1.2 *************** *** 7,10 **** --- 7,14 ---- public interface ExpectationCollection : Expectation { + /// <summary> + /// Adds object to actual collection + /// </summary> + /// <param name="actual">object to add</param> void AddActual(object actual); void AddActualMany(object[] actualMany); |
From: Griffin C. <gri...@ho...> - 2002-09-21 06:58:38
|
Updates I mentioned before have been rolled in. Update your working directory. Make sure to include the -P option, as a directory was moved. Griffin Caprio _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |