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...> - 2004-01-02 00:55:27
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/CustomExpectation
In directory sc8-pr-cvs1:/tmp/cvs-serv21618/DotNetMock.Examples/CustomExpectation
Modified Files:
ExpectationPerson.cs ExpectationPersonTests.cs
Log Message:
Index: ExpectationPerson.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/CustomExpectation/ExpectationPerson.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ExpectationPerson.cs 31 Dec 2003 19:28:58 -0000 1.1
--- ExpectationPerson.cs 2 Jan 2004 00:55:24 -0000 1.2
***************
*** 17,21 ****
{
get { return _expectedPerson; }
! set { _expectedPerson = value; }
}
public Person Actual
--- 17,24 ----
{
get { return _expectedPerson; }
! set {
! _expectedPerson = value;
! HasExpectations = true;
! }
}
public Person Actual
***************
*** 35,39 ****
public override void Verify()
{
! Assertion.AssertEquals( "People do not match. Expected name: " + _expectedPerson.Name + " , Actual name: " + _actualPerson.Name , _expectedPerson, _actualPerson );
}
}
--- 38,43 ----
public override void Verify()
{
! Assertion.AssertEquals( "People do not match. Expected Name: " + _expectedPerson.Name + " , Actual Name: " + _actualPerson.Name , _expectedPerson.Name, _actualPerson.Name );
! Assertion.AssertEquals( "People do not match. Expected Age: " + _expectedPerson.Age + " , Actual Age: " + _actualPerson.Age , _expectedPerson.Age, _actualPerson.Age );
}
}
Index: ExpectationPersonTests.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/CustomExpectation/ExpectationPersonTests.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ExpectationPersonTests.cs 31 Dec 2003 19:28:58 -0000 1.1
--- ExpectationPersonTests.cs 2 Jan 2004 00:55:24 -0000 1.2
***************
*** 8,11 ****
--- 8,13 ----
{
private ExpectationPerson _expectationPerson = null;
+ private Person _actualPerson = null;
+ private Person _expectedPerson = null;
[SetUp]
***************
*** 13,16 ****
--- 15,20 ----
{
_expectationPerson = new ExpectationPerson( "ExpectationPersonTests.ExpectationPerson" );
+ _actualPerson = new Person( "Bobby Fake", 35 );
+ _expectedPerson = new Person( "Bobby Fake", 35 );
}
[TearDown]
***************
*** 18,31 ****
{
_expectationPerson = null;
}
[Test]
! public void ExpectedPerson()
{
! Person expectedPerson = new Person( "Bobby Fake", 35 );
! Person actualPerson = new Person( "Bobby Fake", 35 );
! _expectationPerson.Expected = expectedPerson;
Assertion.Assert( _expectationPerson.HasExpectations );
! _expectationPerson.Actual = actualPerson;
_expectationPerson.Verify();
}
}
--- 22,74 ----
{
_expectationPerson = null;
+ _actualPerson = null;
+ _expectedPerson = null;
}
[Test]
! public void ExpectedPersonEqual()
{
! _expectationPerson.Expected = _expectedPerson;
Assertion.Assert( _expectationPerson.HasExpectations );
! _expectationPerson.Actual = _actualPerson;
_expectationPerson.Verify();
+ }
+ [Test]
+ public void ExpectedPersonFailure()
+ {
+ Person thirdWheel = new Person( "Bob De Niro", 56 );
+ _expectationPerson.Actual = _actualPerson;
+ _expectationPerson.Expected = thirdWheel;
+
+ try
+ {
+ _expectationPerson.Verify();
+ Assertion.Fail( "Should throw exception" );
+ }
+ catch
+ {
+
+ }
+ _expectationPerson.Expected = _expectedPerson;
+ _expectationPerson.Verify();
+ }
+ [Test]
+ public void ExpectationPersonActual()
+ {
+ Assertion.AssertNull( "Actual person", _expectationPerson.Actual );
+ _expectationPerson.Actual = _actualPerson;
+ Assertion.AssertNotNull( "Actual Person not null", _expectationPerson.Actual );
+ Assertion.AssertEquals( "People not equal", _actualPerson, _expectationPerson.Actual );
+ _expectationPerson.ClearActual();
+ Assertion.AssertNull( "Actual person null", _expectationPerson.Actual );
+ }
+ [Test]
+ public void ExpectationPersonExpected()
+ {
+ Assertion.AssertNull( "Expected person", _expectationPerson.Expected );
+ _expectationPerson.Expected = _expectedPerson;
+ Assertion.AssertNotNull( "Expected Person not null", _expectationPerson.Expected );
+ Assertion.AssertEquals( "People not equal", _expectedPerson, _expectationPerson.Expected );
+ _expectationPerson.ClearExpected();
+ Assertion.AssertNull( "Expected person null", _expectationPerson.Expected );
}
}
|
|
From: <gc...@us...> - 2003-12-31 19:29:01
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/CustomExpectation
In directory sc8-pr-cvs1:/tmp/cvs-serv15895/DotNetMock.Examples/CustomExpectation
Added Files:
ExpectationPerson.cs ExpectationPersonTests.cs Person.cs
Log Message:
Added Custom Expectation example
--- NEW FILE: ExpectationPerson.cs ---
using System;
using NUnit.Framework;
using DotNetMock;
namespace DotNetMock.Examples.CustomExpectation
{
public class ExpectationPerson : AbstractExpectation
{
private Person _actualPerson = null;
private Person _expectedPerson = null;
public ExpectationPerson( string name ) : base( name ) {
ClearActual();
}
public Person Expected
{
get { return _expectedPerson; }
set { _expectedPerson = value; }
}
public Person Actual
{
get { return _actualPerson; }
set { _actualPerson = value; }
}
public override void ClearActual()
{
_actualPerson = null;
}
public override void ClearExpected()
{
_expectedPerson = null;
}
public override void Verify()
{
Assertion.AssertEquals( "People do not match. Expected name: " + _expectedPerson.Name + " , Actual name: " + _actualPerson.Name , _expectedPerson, _actualPerson );
}
}
}
--- NEW FILE: ExpectationPersonTests.cs ---
using System;
using NUnit.Framework;
namespace DotNetMock.Examples.CustomExpectation
{
[TestFixture]
public class ExpectationPersonTests
{
private ExpectationPerson _expectationPerson = null;
[SetUp]
public void Init()
{
_expectationPerson = new ExpectationPerson( "ExpectationPersonTests.ExpectationPerson" );
}
[TearDown]
public void Destroy()
{
_expectationPerson = null;
}
[Test]
public void ExpectedPerson()
{
Person expectedPerson = new Person( "Bobby Fake", 35 );
Person actualPerson = new Person( "Bobby Fake", 35 );
_expectationPerson.Expected = expectedPerson;
Assertion.Assert( _expectationPerson.HasExpectations );
_expectationPerson.Actual = actualPerson;
_expectationPerson.Verify();
}
}
}
--- NEW FILE: Person.cs ---
using System;
namespace DotNetMock.Examples.CustomExpectation
{
public class Person
{
private string _name = String.Empty;
private int _age = Int32.MinValue;
public Person( string name, int age )
{
_name = name;
_age = age;
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public int Age
{
get { return _age; }
set { _age = value; }
}
}
}
|
|
From: <gc...@us...> - 2003-12-31 19:29:01
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests
In directory sc8-pr-cvs1:/tmp/cvs-serv15895/DotNetMock.Tests
Modified Files:
DotNetMock.Tests.csproj
Log Message:
Added Custom Expectation example
Index: DotNetMock.Tests.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/DotNetMock.Tests.csproj,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DotNetMock.Tests.csproj 11 Mar 2003 20:30:55 -0000 1.3
--- DotNetMock.Tests.csproj 31 Dec 2003 19:28:58 -0000 1.4
***************
*** 148,151 ****
--- 148,156 ----
/>
<File
+ RelPath = "Dynamic\DynamicTests.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Dynamic\MockTests.cs"
SubType = "Code"
|
|
From: <gc...@us...> - 2003-12-31 19:29:01
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/Generate
In directory sc8-pr-cvs1:/tmp/cvs-serv15895/DotNetMock.Tests/Dynamic/Generate
Modified Files:
ClassGeneratorTests.cs
Log Message:
Added Custom Expectation example
Index: ClassGeneratorTests.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/Generate/ClassGeneratorTests.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ClassGeneratorTests.cs 29 Dec 2002 02:47:39 -0000 1.3
--- ClassGeneratorTests.cs 31 Dec 2003 19:28:58 -0000 1.4
***************
*** 45,49 ****
protected internal virtual string protectedInternalMethod() { return "xx"; }
string defaultInternalMethod() { return "xx"; }
-
}
--- 45,48 ----
|
|
From: <gc...@us...> - 2003-12-31 19:29:01
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework
In directory sc8-pr-cvs1:/tmp/cvs-serv15895/DotNetMock.Framework
Modified Files:
DotNetMock.Framework.csproj
Log Message:
Added Custom Expectation example
Index: DotNetMock.Framework.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/DotNetMock.Framework.csproj,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** DotNetMock.Framework.csproj 30 May 2003 14:58:03 -0000 1.10
--- DotNetMock.Framework.csproj 31 Dec 2003 19:28:57 -0000 1.11
***************
*** 153,161 ****
/>
<File
- RelPath = "Xml\MockXmlValidatingReader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
RelPath = "Xml\XPath\MockXPathDocument.cs"
SubType = "Code"
--- 153,156 ----
|
|
From: <gc...@us...> - 2003-12-31 19:29:00
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples
In directory sc8-pr-cvs1:/tmp/cvs-serv15895/DotNetMock.Examples
Modified Files:
DotNetMock.Examples.csproj
Log Message:
Added Custom Expectation example
Index: DotNetMock.Examples.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/DotNetMock.Examples.csproj,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DotNetMock.Examples.csproj 11 Mar 2003 20:30:45 -0000 1.2
--- DotNetMock.Examples.csproj 31 Dec 2003 19:28:57 -0000 1.3
***************
*** 98,101 ****
--- 98,116 ----
/>
<File
+ RelPath = "CustomExpectation\ExpectationPerson.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "CustomExpectation\ExpectationPersonTests.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "CustomExpectation\Person.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Dynamic\DefaultWeatherRandom.cs"
SubType = "Code"
|
|
From: <gc...@us...> - 2003-12-31 19:27:51
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/CustomExpectation In directory sc8-pr-cvs1:/tmp/cvs-serv15692/CustomExpectation Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/CustomExpectation added to the repository |
|
From: <gc...@us...> - 2003-12-16 05:49:15
|
Update of /cvsroot/dotnetmock/dotnetmock
In directory sc8-pr-cvs1:/tmp/cvs-serv19456
Modified Files:
DotNetMock.sln
Log Message:
removed testing project from solution
Index: DotNetMock.sln
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.sln,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DotNetMock.sln 26 May 2003 00:44:30 -0000 1.8
--- DotNetMock.sln 16 Dec 2003 05:49:12 -0000 1.9
***************
*** 10,15 ****
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetMock.Examples", "DotNetMock.Examples\DotNetMock.Examples.csproj", "{80B98B32-57CB-4989-B506-0F2B0AD94DBA}"
EndProject
- Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testing", "testing\testing.csproj", "{0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}"
- EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
--- 10,13 ----
***************
*** 40,47 ****
{80B98B32-57CB-4989-B506-0F2B0AD94DBA}.Release.ActiveCfg = Release|.NET
{80B98B32-57CB-4989-B506-0F2B0AD94DBA}.Release.Build.0 = Release|.NET
- {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Debug.ActiveCfg = Debug|.NET
- {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Debug.Build.0 = Debug|.NET
- {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Release.ActiveCfg = Release|.NET
- {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
--- 38,41 ----
|
|
From: <gc...@us...> - 2003-11-07 04:31:28
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock
In directory sc8-pr-cvs1:/tmp/cvs-serv15800/DotNetMock
Modified Files:
Verifier.cs
Log Message:
Index: Verifier.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Verifier.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Verifier.cs 1 Apr 2003 01:43:56 -0000 1.7
--- Verifier.cs 7 Nov 2003 04:31:24 -0000 1.8
***************
*** 57,61 ****
/// </summary>
/// <remarks/>
! public class Verifier
{
/// <summary>
--- 57,61 ----
/// </summary>
/// <remarks/>
! public sealed class Verifier
{
/// <summary>
|
|
From: Griffin C. <gri...@ya...> - 2003-06-09 14:46:53
|
I just wanted to drop a line to let everyone know of the new DotNetMock site. It's been in construction over the past couple of weeks, and the construction is ongoing. http://dotnetmock.sourceforge.net/tiki Check out the wiki for some new information about MO's and their use. This list will include: - MO Design Patterns & AntiPatterns - Creating MO's for 3rd Party components - Introducing MO's to a new systems & existing systems - Effective UI testing using MO's - Utilization of MO's throughout a team/company Since my project is .NET, in the beginning most of the code will be .NET based. But I am expecting to branch out into other languages, Java & Ruby especially. Drop me a line if anyone has any comments. As always, the wiki is open, so if you have something to add, go for it. Thanks, Griffin ===== Griffin Caprio "Your child against mine. The winner will be hailed, the loser will be booed until my throat hurts!" - Homer Simpson to Marge __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com |
|
From: <gc...@us...> - 2003-05-31 22:49:54
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/Data
In directory sc8-pr-cvs1:/tmp/cvs-serv7299/DotNetMock.Framework.Tests/Data
Modified Files:
MockDbDataAdapterTests.cs
Log Message:
Index: MockDbDataAdapterTests.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/Data/MockDbDataAdapterTests.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MockDbDataAdapterTests.cs 30 May 2003 14:58:03 -0000 1.1
--- MockDbDataAdapterTests.cs 31 May 2003 22:49:51 -0000 1.2
***************
*** 37,55 ****
_mockAdapter.Verify();
}
- [Test]
- public void FillExpectedDataSet()
- {
- MockDataSet expectedDataSet = new MockDataSet();
- object[,] rows = new object[1,1];
- rows[1,1] = "testing";
- expectedDataSet.SetRows( rows );
- _mockAdapter.SetExpectedDataSet( expectedDataSet );
-
- MockDataSet dataSet = new MockDataSet();
- _mockAdapter.Fill( dataSet );
-
- Assertion.AssertEquals( "DataSet doesn't equal.", expectedDataSet, dataSet );
- Assertion.AssertEquals( "Data doesn't equal.", "testing", dataSet.Tables[0].Rows[0][1] );
- }
}
}
--- 37,40 ----
|
|
From: <gc...@us...> - 2003-05-31 22:49:54
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/Data
In directory sc8-pr-cvs1:/tmp/cvs-serv7299/DotNetMock.Framework/Data
Modified Files:
MockDbDataAdapter.cs
Log Message:
Index: MockDbDataAdapter.cs
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/Data/MockDbDataAdapter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MockDbDataAdapter.cs 30 May 2003 14:58:04 -0000 1.1
--- MockDbDataAdapter.cs 31 May 2003 22:49:51 -0000 1.2
***************
*** 43,46 ****
--- 43,47 ----
}
#endregion
+
#region Implementation of IMockObject
public void NotImplemented(string methodName)
***************
*** 70,73 ****
--- 71,75 ----
#region Implementation of DbDataAdapter
+ public new event System.Data.FillErrorEventHandler FillError;
protected override System.Data.Common.RowUpdatedEventArgs CreateRowUpdatedEvent(System.Data.DataRow dataRow, System.Data.IDbCommand command, System.Data.StatementType statementType, System.Data.Common.DataTableMapping tableMapping)
***************
*** 134,143 ****
return 0;
}
! #endregion
private void innerExecute()
{
_expectedFillCalls.Inc();
}
}
}
--- 136,201 ----
return 0;
}
!
! protected override void Dispose(bool disposing)
! {
!
! }
! protected override System.Data.DataTable FillSchema(System.Data.DataTable dataTable, System.Data.SchemaType schemaType, System.Data.IDbCommand command, System.Data.CommandBehavior behavior)
! {
! return null;
! }
+ protected override System.Data.DataTable[] FillSchema(System.Data.DataSet dataSet, System.Data.SchemaType schemaType, System.Data.IDbCommand command, string srcTable, System.Data.CommandBehavior behavior)
+ {
+ return null;
+ }
+ protected new System.Data.DataTable[] FillSchema(System.Data.DataSet dataSet, System.Data.SchemaType schemaType, string srcTable )
+ {
+ return null;
+ }
+ public override System.Data.DataTable[] FillSchema(System.Data.DataSet dataSet, System.Data.SchemaType schemaType)
+ {
+ return null;
+ }
+ public new System.Data.DataTable FillSchema(System.Data.DataTable dataTable, System.Data.SchemaType schemaType)
+ {
+ return null;
+ }
+
private void innerExecute()
{
_expectedFillCalls.Inc();
}
+
+ public override System.Data.IDataParameter[] GetFillParameters()
+ {
+ return null;
+ }
+
+ protected override void OnFillError(System.Data.FillErrorEventArgs value)
+ {
+
+ }
+ protected override int Update(System.Data.DataRow[] dataRows, System.Data.Common.DataTableMapping tableMapping)
+ {
+ return 0;
+ }
+ public new int Update(System.Data.DataSet dataSet, string srcTable)
+ {
+ return 0;
+ }
+ public new int Update(System.Data.DataTable dataTable)
+ {
+ return 0;
+ }
+ public new int Update(System.Data.DataRow[] dataRows)
+ {
+ return 0;
+ }
+ public override int Update(System.Data.DataSet dataSet)
+ {
+ return 0;
+ }
+ #endregion
}
}
|
|
From: <gc...@us...> - 2003-05-30 15:16:50
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework
In directory sc8-pr-cvs1:/tmp/cvs-serv14423/DotNetMock.Framework
Modified Files:
DotNetMock.Framework.csproj
Log Message:
Index: DotNetMock.Framework.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/DotNetMock.Framework.csproj,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DotNetMock.Framework.csproj 26 May 2003 00:44:30 -0000 1.9
--- DotNetMock.Framework.csproj 30 May 2003 14:58:03 -0000 1.10
***************
*** 133,136 ****
--- 133,141 ----
/>
<File
+ RelPath = "Data\MockDbDataAdapter.cs"
+ SubType = "Component"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Data\MockTransaction.cs"
SubType = "Code"
|
|
From: <gc...@us...> - 2003-05-30 15:16:49
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/Data
In directory sc8-pr-cvs1:/tmp/cvs-serv14423/DotNetMock.Framework.Tests/Data
Added Files:
MockDbDataAdapterTests.cs
Log Message:
--- NEW FILE: MockDbDataAdapterTests.cs ---
using System;
using NUnit.Framework;
using DotNetMock.Framework.Data;
namespace DotNetMock.Framework.Tests.Data
{
[TestFixture]
public class MockDbDataAdapterTests
{
private MockDbDataAdapter _mockAdapter = null;
[SetUp]
public void Init()
{
_mockAdapter = new MockDbDataAdapter();
}
[TearDown]
public void Destroy()
{
_mockAdapter = null;
}
[Test]
public void FillCountValid()
{
_mockAdapter.SetExpectedFillCalls( 2 );
_mockAdapter.Fill(new MockDataSet());
_mockAdapter.Fill(new MockDataSet());
_mockAdapter.Verify();
}
[Test]
[ExpectedException(typeof(AssertionException))]
public void FillCountInValid()
{
_mockAdapter.SetExpectedFillCalls( 2 );
_mockAdapter.Fill(new MockDataSet());
_mockAdapter.Verify();
}
[Test]
public void FillExpectedDataSet()
{
MockDataSet expectedDataSet = new MockDataSet();
object[,] rows = new object[1,1];
rows[1,1] = "testing";
expectedDataSet.SetRows( rows );
_mockAdapter.SetExpectedDataSet( expectedDataSet );
MockDataSet dataSet = new MockDataSet();
_mockAdapter.Fill( dataSet );
Assertion.AssertEquals( "DataSet doesn't equal.", expectedDataSet, dataSet );
Assertion.AssertEquals( "Data doesn't equal.", "testing", dataSet.Tables[0].Rows[0][1] );
}
}
}
|
|
From: <gc...@us...> - 2003-05-30 15:16:48
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/Data
In directory sc8-pr-cvs1:/tmp/cvs-serv14423/DotNetMock.Framework/Data
Added Files:
MockDbDataAdapter.cs
Log Message:
--- NEW FILE: MockDbDataAdapter.cs ---
using System;
using System.Data;
using System.Data.Common;
using DotNetMock;
namespace DotNetMock.Framework.Data
{
public class MockDbDataAdapter : DbDataAdapter, IMockObject
{
private ExpectationCounter _expectedFillCalls = new ExpectationCounter("MockDbDataAdapter.ExpectedFillCalls");
private DataSet _expectedDataSet = null;
private string _name = "";
#region Public Constructors
public MockDbDataAdapter()
{
this._name = "MockDbDataAdapter";
}
public MockDbDataAdapter( IDbCommand selectCommand )
{
}
public MockDbDataAdapter( IDbCommand selectCommand, string selectConnectionString )
{
}
public MockDbDataAdapter( string selectCommandText, IDbConnection selectConnection )
{
}
#endregion
#region Mock Methods
public void SetExpectedFillCalls( int calls )
{
_expectedFillCalls.Expected = calls;
}
public void SetExpectedDataSet( DataSet dataSet )
{
_expectedDataSet = dataSet;
}
#endregion
#region Implementation of IMockObject
public void NotImplemented(string methodName)
{
throw new NotImplementedException( methodName + " is currently not implemented." );
}
public string MockName
{
get
{
return _name;
}
set
{
_name = value;
}
}
#endregion
#region Implementation of IVerifiable
public void Verify()
{
Verifier.Verify( this );
}
#endregion
#region Implementation of DbDataAdapter
protected override System.Data.Common.RowUpdatedEventArgs CreateRowUpdatedEvent(System.Data.DataRow dataRow, System.Data.IDbCommand command, System.Data.StatementType statementType, System.Data.Common.DataTableMapping tableMapping)
{
return null;
}
protected override System.Data.Common.RowUpdatingEventArgs CreateRowUpdatingEvent(System.Data.DataRow dataRow, System.Data.IDbCommand command, System.Data.StatementType statementType, System.Data.Common.DataTableMapping tableMapping)
{
return null;
}
protected override void OnRowUpdated(System.Data.Common.RowUpdatedEventArgs value)
{
}
protected override void OnRowUpdating(System.Data.Common.RowUpdatingEventArgs value)
{
}
protected override int Fill(System.Data.DataTable dataTable, System.Data.IDataReader dataReader)
{
innerExecute();
return 0;
}
protected override int Fill(System.Data.DataSet dataSet, string srcTable, System.Data.IDataReader dataReader, int startRecord, int maxRecords)
{
innerExecute();
return 0;
}
protected override int Fill(System.Data.DataTable dataTable, System.Data.IDbCommand command, System.Data.CommandBehavior behavior)
{
innerExecute();
return 0;
}
protected override int Fill(System.Data.DataSet dataSet, int startRecord, int maxRecords, string srcTable, System.Data.IDbCommand command, System.Data.CommandBehavior behavior)
{
innerExecute();
return 0;
}
public override int Fill(System.Data.DataSet dataSet)
{
innerExecute();
return 0;
}
public new int Fill( System.Data.DataSet dataSet, string srcTable )
{
innerExecute();
return 0;
}
public new int Fill( System.Data.DataSet dataSet, int startRecord, int maxRecords, string srcTable )
{
innerExecute();
return 0;
}
public new int Fill( DataTable dataTable )
{
innerExecute();
return 0;
}
#endregion
private void innerExecute()
{
_expectedFillCalls.Inc();
}
}
}
|
|
From: <gc...@us...> - 2003-05-30 15:16:45
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests
In directory sc8-pr-cvs1:/tmp/cvs-serv14423/DotNetMock.Framework.Tests
Modified Files:
DotNetMock.Framework.Tests.csproj
Log Message:
Index: DotNetMock.Framework.Tests.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/DotNetMock.Framework.Tests.csproj,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DotNetMock.Framework.Tests.csproj 26 May 2003 00:44:30 -0000 1.4
--- DotNetMock.Framework.Tests.csproj 30 May 2003 14:58:01 -0000 1.5
***************
*** 128,131 ****
--- 128,136 ----
/>
<File
+ RelPath = "Data\MockDbDataAdapterTests.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Security\Principal\MockIIdentityTests.cs"
SubType = "Code"
|
|
From: <gc...@us...> - 2003-05-26 00:44:34
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/Data
In directory sc8-pr-cvs1:/tmp/cvs-serv21205/DotNetMock.Framework/Data
Added Files:
MockDataSet.cs MockDataSet.resx
Log Message:
1) Added MockDataSet
--- NEW FILE: MockDataSet.cs ---
using System;
using System.Data;
using DotNetMock;
namespace DotNetMock.Framework.Data
{
/// <summary>
/// Mock Object representing a System.Data.DataSet.
/// </summary>
public class MockDataSet : DataSet, IMockObject
{
protected string name = "";
public MockDataSet()
{
this.name = "MockDataSet";
}
public void SetRows( object[,] data )
{
DataTable dataTable = new DataTable();
DataColumn column = null;
for(int i=0; i<data.GetLength( 1 ); i++)
{
column = new DataColumn();
column.DataType = typeof(object);
dataTable.Columns.Add( column );
}
for(int i=0; i<data.GetLength( 0 ); i++)
{
dataTable.Rows.Add( getRow( data, i ) );
}
this.Tables.Clear();
this.Tables.Add( dataTable );
}
private object[] getRow( object[,] data, int rowIndex )
{
int columnCount = data.GetLength( 1 );
object[] newRow = new object[columnCount];
for(int i=0; i<columnCount; i++)
{
newRow[i] = data[rowIndex, i];
}
return newRow;
}
#region Implementation of IMockObject
public void NotImplemented(string methodName)
{
throw new NotImplementedException( methodName + " is currently not implemented." );
}
public string MockName
{
get
{
return name;
}
set
{
name = value;
}
}
#endregion
#region Implementation of IVerifiable
public void Verify()
{
}
#endregion
}
}
--- NEW FILE: MockDataSet.resx ---
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="ResMimeType">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="Version">
<value>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
|
|
From: <gc...@us...> - 2003-05-26 00:44:33
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/Data
In directory sc8-pr-cvs1:/tmp/cvs-serv21205/DotNetMock.Framework.Tests/Data
Added Files:
MockDataSetTests.cs
Log Message:
1) Added MockDataSet
--- NEW FILE: MockDataSetTests.cs ---
using System;
using DotNetMock.Framework.Data;
using NUnit.Framework;
namespace DotNetMock.Framework.Tests.Data
{
[TestFixture]
public class MockDataSetTests
{
private MockDataSet _mockDS = null;
[SetUp]
public void Init()
{
_mockDS = new MockDataSet();
}
[TearDown]
public void Destroy()
{
_mockDS = null;
}
[Test]
public void SetRowsValid()
{
object[,] rows = new object[2,5];
rows[0,0] = "temp";
rows[0,1] = "temp";
rows[0,2] = "temp";
rows[0,3] = "temp";
rows[0,4] = "temp";
rows[1,0] = "temp";
rows[1,1] = "temp";
rows[1,2] = "temp";
rows[1,3] = "temp";
rows[1,4] = "temp";
_mockDS.SetRows( rows );
Assertion.AssertEquals( "TableCount does not equal.", 1, _mockDS.Tables.Count );
Assertion.AssertEquals( "RowCount does not equal.", 2, _mockDS.Tables[0].Rows.Count );
Assertion.AssertEquals( "ColumnCount does not equal.", 5, _mockDS.Tables[0].Columns.Count );
}
}
}
|
|
From: <gc...@us...> - 2003-05-26 00:44:33
|
Update of /cvsroot/dotnetmock/dotnetmock
In directory sc8-pr-cvs1:/tmp/cvs-serv21205
Modified Files:
DotNetMock.sln
Log Message:
1) Added MockDataSet
Index: DotNetMock.sln
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.sln,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DotNetMock.sln 8 Apr 2003 04:27:10 -0000 1.7
--- DotNetMock.sln 26 May 2003 00:44:30 -0000 1.8
***************
*** 10,13 ****
--- 10,15 ----
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetMock.Examples", "DotNetMock.Examples\DotNetMock.Examples.csproj", "{80B98B32-57CB-4989-B506-0F2B0AD94DBA}"
EndProject
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testing", "testing\testing.csproj", "{0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}"
+ EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
***************
*** 38,41 ****
--- 40,47 ----
{80B98B32-57CB-4989-B506-0F2B0AD94DBA}.Release.ActiveCfg = Release|.NET
{80B98B32-57CB-4989-B506-0F2B0AD94DBA}.Release.Build.0 = Release|.NET
+ {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Debug.ActiveCfg = Debug|.NET
+ {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Debug.Build.0 = Debug|.NET
+ {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Release.ActiveCfg = Release|.NET
+ {0BC3BC02-EC9D-4940-B8ED-2AAA97C785B9}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
From: <gc...@us...> - 2003-05-26 00:44:33
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests
In directory sc8-pr-cvs1:/tmp/cvs-serv21205/DotNetMock.Framework.Tests
Modified Files:
DotNetMock.Framework.Tests.csproj
Log Message:
1) Added MockDataSet
Index: DotNetMock.Framework.Tests.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/DotNetMock.Framework.Tests.csproj,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DotNetMock.Framework.Tests.csproj 22 May 2003 02:29:18 -0000 1.3
--- DotNetMock.Framework.Tests.csproj 26 May 2003 00:44:30 -0000 1.4
***************
*** 118,121 ****
--- 118,126 ----
/>
<File
+ RelPath = "Data\MockDataSetTests.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Data\MockDbConnectionTests.cs"
SubType = "Code"
|
|
From: <gc...@us...> - 2003-05-26 00:44:33
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework
In directory sc8-pr-cvs1:/tmp/cvs-serv21205/DotNetMock.Framework
Modified Files:
DotNetMock.Framework.csproj
Log Message:
1) Added MockDataSet
Index: DotNetMock.Framework.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/DotNetMock.Framework.csproj,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DotNetMock.Framework.csproj 22 May 2003 02:29:18 -0000 1.8
--- DotNetMock.Framework.csproj 26 May 2003 00:44:30 -0000 1.9
***************
*** 118,121 ****
--- 118,131 ----
/>
<File
+ RelPath = "Data\MockDataSet.cs"
+ SubType = "Component"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Data\MockDataSet.resx"
+ DependentUpon = "MockDataSet.cs"
+ BuildAction = "EmbeddedResource"
+ />
+ <File
RelPath = "Data\MockDbConnection.cs"
SubType = "Code"
|
|
From: <gc...@us...> - 2003-05-22 02:29:21
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/ComponentModel
In directory sc8-pr-cvs1:/tmp/cvs-serv1590/DotNetMock.Framework.Tests/ComponentModel
Added Files:
MockMarshalByValueComponentTests.cs
Log Message:
1) Added MockMarshalByValueComponent class
--- NEW FILE: MockMarshalByValueComponentTests.cs ---
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using DotNetMock.Framework.ComponentModel;
using NUnit.Framework;
namespace DotNetMock.Framework.Tests.ComponentModel
{
[TestFixture]
public class MockMarshalByValueComponentTests
{
private MockMarshalByValueComponent _mockComponent = null;
private class DummySite : ISite
{
#region Implementation of ISite
public System.ComponentModel.IComponent Component
{
get
{
return null;
}
}
public System.ComponentModel.IContainer Container
{
get
{
return null;
}
}
public bool DesignMode
{
get
{
return true;
}
}
public string Name
{
get
{
return null;
}
set
{
}
}
#endregion
#region Implementation of IServiceProvider
public object GetService(System.Type serviceType)
{
return null;
}
#endregion
}
[SetUp]
public void Init()
{
_mockComponent = new MockMarshalByValueComponent();
}
[TearDown]
public void Destroy()
{
_mockComponent = null;
}
[Test]
public void ExpectedContainer()
{
Container contain = new Container();
_mockComponent.SetExpectedContainer( contain );
Assertion.AssertEquals( "Containers do not equal.", contain, _mockComponent.Container );
}
[Test]
public void ExpectedSite()
{
ISite dummySite = new DummySite();
_mockComponent.SetExpectedSite( dummySite );
Assertion.AssertEquals( "Sites do not equal.", dummySite, _mockComponent.Site );
}
[Test]
public void ExpectedDesignMode()
{
Assertion.Assert( "In design mode", !_mockComponent.DesignMode );
_mockComponent.SetExpectedSite( new DummySite() );
_mockComponent.SetExpectedDesignMode( true );
Assertion.Assert( "Not in design mode", _mockComponent.DesignMode );
_mockComponent.SetExpectedDesignMode( false );
Assertion.Assert( "Not in design mode", !_mockComponent.DesignMode );
}
[Test]
public void ExpectedGetServiceCount()
{
_mockComponent.SetExpectedGetServiceCalls( 2 );
_mockComponent.GetService( null );
_mockComponent.GetService( null );
_mockComponent.Verify();
}
[Test]
[ExpectedException(typeof(AssertionException))]
public void ExpectedGetServiceCountFails()
{
_mockComponent.SetExpectedGetServiceCalls( 3 );
_mockComponent.GetService( null );
_mockComponent.GetService( null );
_mockComponent.Verify();
}
[Test]
public void GetServiceValid()
{
IServiceProvider container1 = new ServiceContainer();
IServiceProvider container2 = new ServiceContainer();
_mockComponent.SetExpectedServiceProvider( container1, typeof(string) );
_mockComponent.SetExpectedServiceProvider( container2, typeof(int) );
Assertion.AssertEquals( "Services do not equal.", container1, _mockComponent.GetService( typeof(string) ) );
Assertion.AssertEquals( "Services do not equal.", container2, _mockComponent.GetService( typeof(int) ) );
}
}
}
|
|
From: <gc...@us...> - 2003-05-22 02:29:21
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework
In directory sc8-pr-cvs1:/tmp/cvs-serv1590/DotNetMock.Framework
Modified Files:
DotNetMock.Framework.csproj
Log Message:
1) Added MockMarshalByValueComponent class
Index: DotNetMock.Framework.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/DotNetMock.Framework.csproj,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DotNetMock.Framework.csproj 5 May 2003 01:42:04 -0000 1.7
--- DotNetMock.Framework.csproj 22 May 2003 02:29:18 -0000 1.8
***************
*** 93,102 ****
/>
<File
! RelPath = "Data\MockCommand.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "Data\MockDataAdapter.cs"
SubType = "Code"
BuildAction = "Compile"
--- 93,102 ----
/>
<File
! RelPath = "ComponentModel\MockMarshalByValueComponent.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
! RelPath = "Data\MockCommand.cs"
SubType = "Code"
BuildAction = "Compile"
|
|
From: <gc...@us...> - 2003-05-22 02:29:21
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework/ComponentModel
In directory sc8-pr-cvs1:/tmp/cvs-serv1590/DotNetMock.Framework/ComponentModel
Added Files:
MockMarshalByValueComponent.cs
Log Message:
1) Added MockMarshalByValueComponent class
--- NEW FILE: MockMarshalByValueComponent.cs ---
using System;
using System.Collections;
using System.ComponentModel;
using DotNetMock;
namespace DotNetMock.Framework.ComponentModel
{
/// <summary>
/// Base MockObject for remotable components that are marshaled by value.
/// </summary>
public class MockMarshalByValueComponent : MockObject, IComponent, IDisposable, IServiceProvider
{
private IContainer _expectedContainer = null;
private bool _expectedDesignMode = false;
private ISite _expectedSite = null;
private Hashtable _serviceProviders = null;
private ExpectationCounter _getServiceCalls = new ExpectationCounter( "MockMarshalByValueComponent.GetServiceCalls" );
public MockMarshalByValueComponent()
{
this.name = "MockMarshalByValueComponent";
_serviceProviders = new Hashtable();
}
#region Mock Methods
public void SetExpectedContainer( IContainer container )
{
_expectedContainer = container;
}
public void SetExpectedDesignMode( bool designMode )
{
_expectedDesignMode = designMode;
}
public void SetExpectedSite( ISite site )
{
_expectedSite = site;
}
public void SetExpectedGetServiceCalls( int count )
{
_getServiceCalls.Expected = count;
}
public void SetExpectedServiceProvider( IServiceProvider serviceProvider , Type serviceType )
{
_serviceProviders.Add( serviceType, serviceProvider );
}
#endregion
#region Public Properties
public IContainer Container
{
get { return _expectedContainer; }
}
public bool DesignMode
{
get
{
if ( _expectedSite == null )
{
return false;
}
return _expectedDesignMode;
}
}
#endregion
#region Implementation of IComponent
public event System.EventHandler Disposed;
public System.ComponentModel.ISite Site
{
get
{
return _expectedSite;
}
set
{
_expectedSite = value;
}
}
#endregion
#region Implementation of IDisposable
public void Dispose()
{
Dispose( false );
}
public void Dispose( bool dispose )
{
Disposed( this, null );
}
#endregion
#region Implementation of IServiceProvider
public object GetService(Type serviceType)
{
_getServiceCalls.Inc();
foreach ( Type expectedType in _serviceProviders.Keys )
{
if ( expectedType.Equals( serviceType ) )
{
return _serviceProviders[ expectedType ];
}
}
return null;
}
#endregion
}
}
|
|
From: <gc...@us...> - 2003-05-22 02:29:21
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests
In directory sc8-pr-cvs1:/tmp/cvs-serv1590/DotNetMock.Framework.Tests
Modified Files:
DotNetMock.Framework.Tests.csproj
Log Message:
1) Added MockMarshalByValueComponent class
Index: DotNetMock.Framework.Tests.csproj
===================================================================
RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Framework.Tests/DotNetMock.Framework.Tests.csproj,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DotNetMock.Framework.Tests.csproj 7 Apr 2003 00:43:57 -0000 1.2
--- DotNetMock.Framework.Tests.csproj 22 May 2003 02:29:18 -0000 1.3
***************
*** 93,96 ****
--- 93,101 ----
<Include>
<File
+ RelPath = "ComponentModel\MockMarshalByValueComponentTests.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Data\MockCommandTests.cs"
SubType = "Code"
|