This list is closed, nobody may subscribe to it.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(99) |
Feb
(163) |
Mar
(3) |
Apr
(33) |
May
(8) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
|
Jun
(16) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Choy R. <ch...@us...> - 2005-02-09 06:35:06
|
Update of /cvsroot/dotnetmock/dotnetmock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119 Modified Files: DotNetMock.sln Log Message: Pulled out example NUnit tests to separate assembly. Index: DotNetMock.sln =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.sln,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DotNetMock.sln 5 Feb 2005 21:46:26 -0000 1.17 --- DotNetMock.sln 9 Feb 2005 06:34:27 -0000 1.18 *************** *** 24,27 **** --- 24,31 ---- EndProjectSection EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetMock.Examples.NUnitTests", "DotNetMock.Examples.NUnitTests\DotNetMock.Examples.NUnitTests.csproj", "{760B53F4-0E0F-41A0-94ED-9B8691833A70}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject Global GlobalSection(SolutionConfiguration) = preSolution *************** *** 54,57 **** --- 58,65 ---- {6C2904D4-ADCC-4980-AED0-64A8C6F3AF69}.Release.ActiveCfg = Release|.NET {6C2904D4-ADCC-4980-AED0-64A8C6F3AF69}.Release.Build.0 = Release|.NET + {760B53F4-0E0F-41A0-94ED-9B8691833A70}.Debug.ActiveCfg = Debug|.NET + {760B53F4-0E0F-41A0-94ED-9B8691833A70}.Debug.Build.0 = Debug|.NET + {760B53F4-0E0F-41A0-94ED-9B8691833A70}.Release.ActiveCfg = Release|.NET + {760B53F4-0E0F-41A0-94ED-9B8691833A70}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution |
From: Choy R. <ch...@us...> - 2005-02-09 06:35:06
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples Modified Files: DotNetMock.Examples.csproj Log Message: Pulled out example NUnit tests to separate assembly. Index: DotNetMock.Examples.csproj =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/DotNetMock.Examples.csproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DotNetMock.Examples.csproj 5 Feb 2005 21:12:49 -0000 1.8 --- DotNetMock.Examples.csproj 9 Feb 2005 06:34:27 -0000 1.9 *************** *** 85,98 **** Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> - <Reference - Name = "DotNetMock.Framework" - Project = "{514DAB7F-4A05-4343-9BF5-2C3DC60A431D}" - Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" - /> - <Reference - Name = "nunit.framework" - AssemblyName = "nunit.framework" - HintPath = "..\lib\nunit.framework.dll" - /> </References> </Build> --- 85,88 ---- *************** *** 105,113 **** /> <File - RelPath = "CustomExpectation\ExpectationPersonTests.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "CustomExpectation\Person.cs" SubType = "Code" --- 95,98 ---- *************** *** 130,138 **** /> <File - RelPath = "Dynamic\WeatherTest.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "MailingList\DatabaseConstants.cs" SubType = "Code" --- 115,118 ---- *************** *** 155,163 **** /> <File - RelPath = "MailingList\MailingListTests.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "MailingList\MockListAction.cs" SubType = "Code" --- 135,138 ---- *************** *** 170,178 **** /> <File - RelPath = "Mainframe\CustomerNumberCollectorTests.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Mainframe\IMainframeConnection.cs" SubType = "Code" --- 145,148 ---- *************** *** 194,202 **** BuildAction = "Compile" /> - <File - RelPath = "Security\SensitiveClassTests.cs" - SubType = "Code" - BuildAction = "Compile" - /> </Include> </Files> --- 164,167 ---- |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:39
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples/Security Removed Files: SensitiveClassTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- SensitiveClassTests.cs DELETED --- |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:38
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/Mainframe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples/Mainframe Removed Files: CustomerNumberCollectorTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- CustomerNumberCollectorTests.cs DELETED --- |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:38
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/MailingList In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples/MailingList Removed Files: MailingListTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- MailingListTests.cs DELETED --- |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:38
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples/Dynamic Removed Files: WeatherTest.cs Log Message: Pulled out example NUnit tests to separate assembly. --- WeatherTest.cs DELETED --- |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:38
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples.NUnitTests/Security Added Files: SensitiveClassTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- NEW FILE: SensitiveClassTests.cs --- using System; using System.Security; using System.Threading; using NUnit.Framework; using DotNetMock.Framework.Security.Principal; namespace DotNetMock.Examples.Security { [TestFixture] public class SensitiveClassTests { private SensitiveClass sensitiveClass = null; private MockIIdentity mockIdentity = null; private MockIPrincipal mockPrincipal = null; [SetUp] public void Init() { sensitiveClass = new SensitiveClass(); mockIdentity = new MockIIdentity(); mockPrincipal = new MockIPrincipal(); mockPrincipal.SetExpectedIdentity( mockIdentity ); Thread.CurrentPrincipal = mockPrincipal; } [TearDown] public void Destroy() { sensitiveClass = null; mockIdentity = null; mockPrincipal = null; } [Test] public void ManualCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( true ); mockIdentity.SetExpectedName( "Mr. CEO" ); mockPrincipal.SetExpectedIsInRoleCount(1); mockPrincipal.AddExpectedRole( "CEO" ); Assertion.Assert( "Cannot run Manual CEO Check!", sensitiveClass.CanRunManualCEOCheck() ); verifyMocks(); } [Test] public void CannotRunManualCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( true ); mockIdentity.SetExpectedName( "Mr. Employee" ); mockPrincipal.SetExpectedIsInRoleCount(1); mockPrincipal.AddExpectedRole( "Employee" ); Assertion.Assert( "Can run Manual CEO Check!", !sensitiveClass.CanRunManualCEOCheck() ); verifyMocks(); } [Test] public void NotAuthenticatedForCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( false ); mockIdentity.SetExpectedName( "Mr. Employee" ); mockPrincipal.SetExpectedIsInRoleCount(0); Assertion.Assert( "Authenticated!", !sensitiveClass.CanRunManualCEOCheck() ); verifyMocks(); } [Test] public void ImperativeCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( true ); mockIdentity.SetExpectedName( "Mr. CEO" ); mockPrincipal.SetExpectedIsInRoleCount(1); mockPrincipal.AddExpectedRole( "CEO" ); Assertion.Assert( "Cannot run Imperative CEO Check!", sensitiveClass.CanRunImperativeCEOCheck() ); verifyMocks(); } [Test] public void CannotRunImperativeCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( true ); mockIdentity.SetExpectedName( "Mr. Employee" ); mockPrincipal.SetExpectedIsInRoleCount(1); mockPrincipal.AddExpectedRole( "Employee" ); Assertion.Assert( "Can run Imperative CEO Check!", !sensitiveClass.CanRunImperativeCEOCheck() ); verifyMocks(); } [Test] public void NotAuthenticatedForImperativeCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( false ); mockIdentity.SetExpectedName( "Mr. Employee" ); mockPrincipal.SetExpectedIsInRoleCount(0); Assertion.Assert( "Authenticated!", !sensitiveClass.CanRunImperativeCEOCheck() ); verifyMocks(); } [Test] public void DeclarativeCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( true ); mockIdentity.SetExpectedName( "Mr. CEO" ); mockPrincipal.SetExpectedIsInRoleCount(1); mockPrincipal.AddExpectedRole( "CEO" ); Assertion.Assert( "Cannot run Declarative CEO Check!", sensitiveClass.CanRunDeclarativeCEOCheck() ); verifyMocks(); } [Test] [ExpectedException(typeof(SecurityException))] public void CannotRunDeclarativeCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( true ); mockIdentity.SetExpectedName( "Mr. Employee" ); mockPrincipal.SetExpectedIsInRoleCount(1); mockPrincipal.AddExpectedRole( "Employee" ); try { sensitiveClass.CanRunDeclarativeCEOCheck(); } finally { verifyMocks(); } } [Test] [ExpectedException(typeof(SecurityException))] public void NotAuthenticatedForDeclarativeCEOCheck() { mockIdentity.SetExpectedAuthenticationType( "NTLM" ); mockIdentity.SetExpectedIsAuthenticated( false ); mockIdentity.SetExpectedName( "Mr. Employee" ); mockPrincipal.SetExpectedIsInRoleCount(0); try { sensitiveClass.CanRunDeclarativeCEOCheck(); } finally { verifyMocks(); } } private void verifyMocks() { mockIdentity.Verify(); mockPrincipal.Verify(); } } } |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:38
|
Update of /cvsroot/dotnetmock/dotnetmock/lib-ext/NUnit-2.2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/lib-ext/NUnit-2.2 Added Files: nunit.framework.dll Log Message: Pulled out example NUnit tests to separate assembly. --- NEW FILE: nunit.framework.dll --- (This appears to be a binary file; contents omitted.) |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:38
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples/CustomExpectation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples/CustomExpectation Removed Files: ExpectationPersonTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- ExpectationPersonTests.cs DELETED --- |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:37
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/CustomExpectation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples.NUnitTests/CustomExpectation Added Files: ExpectationPersonTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- NEW FILE: ExpectationPersonTests.cs --- using System; using NUnit.Framework; namespace DotNetMock.Examples.CustomExpectation { [TestFixture] public class ExpectationPersonTests { private ExpectationPerson _expectationPerson = null; private Person _actualPerson = null; private Person _expectedPerson = null; [SetUp] public void Init() { _expectationPerson = new ExpectationPerson( "ExpectationPersonTests.ExpectationPerson" ); _actualPerson = new Person( "Bobby Fake", 35 ); _expectedPerson = new Person( "Bobby Fake", 35 ); } [TearDown] public void Destroy() { _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: Choy R. <ch...@us...> - 2005-02-09 06:34:37
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples.NUnitTests/Dynamic Added Files: WeatherTest.cs Log Message: Pulled out example NUnit tests to separate assembly. --- NEW FILE: WeatherTest.cs --- using DotNetMock.Dynamic; using NUnit.Framework; namespace DotNetMock.Examples.Dynamic { [TestFixture] public class WeatherTest { private IDynamicMock random; private Weather weather; [SetUp] public void SetUp() { random = new DynamicMock(typeof(IWeatherRandom)); weather = new Weather((IWeatherRandom)random.Object); } [Test] public void RandomRaining() { random.SetValue("NextTemperature", 1.0); random.SetValue("NextIsRaining", true); weather.Randomize(); Assertion.Assert("is raining", weather.IsRaining); } [Test] public void RandomNotRaining() { random.SetValue("NextTemperature", 1.0); random.SetValue("NextIsRaining", false); weather.Randomize(); Assertion.Assert("is not raining", !weather.IsRaining); } [Test] public void RandomTemperatureSunny() { double TEMPERATURE = 20.0; random.SetValue("NextTemperature", TEMPERATURE); random.SetValue("NextIsRaining", false); weather.Randomize(); Assertion.AssertEquals("temperature", TEMPERATURE, weather.Temperature); } [Test] public void RandomTemperatureRaining() { double TEMPERATURE = 20.0; random.SetValue("NextTemperature", TEMPERATURE); random.SetValue("NextIsRaining", true); weather.Randomize(); Assertion.AssertEquals("temperature", TEMPERATURE / 2.0, weather.Temperature); } } [TestFixture] public class DefaultWeatherRandomTest { [Test] public void NextIsRaining() { IDynamicMock random = new DynamicMock(typeof(System.Random)); IWeatherRandom weather = new DefaultWeatherRandom((System.Random)random.Object); random.SetValue("NextDouble", 0.0); Assertion.Assert("is raining", weather.NextIsRaining()); random.SetValue("NextDouble", DefaultWeatherRandom.CHANCE_OF_RAIN); Assertion.Assert("is not raining", !weather.NextIsRaining()); random.SetValue("NextDouble", 1.0); Assertion.Assert("is not raining", !weather.NextIsRaining()); } [Test] public void NextTemperature() { IDynamicMock random = new DynamicMock(typeof(System.Random)); IWeatherRandom weather = new DefaultWeatherRandom((System.Random)random.Object); random.SetValue("NextDouble", 0.0); Assertion.AssertEquals("should be min temperature", DefaultWeatherRandom.MIN_TEMPERATURE, weather.NextTemperature() ); random.SetValue("NextDouble", 0.5); Assertion.AssertEquals("should be average temperature", 0.5 * (DefaultWeatherRandom.MIN_TEMPERATURE + DefaultWeatherRandom.MAX_TEMPERATURE), weather.NextTemperature() ); random.SetValue("NextDouble", 1.0); Assertion.AssertEquals("should be max temperature", DefaultWeatherRandom.MAX_TEMPERATURE, weather.NextTemperature() ); } } } |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:37
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/MailingList In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples.NUnitTests/MailingList Added Files: MailingListTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- NEW FILE: MailingListTests.cs --- using System; using System.Data; using System.Data.SqlClient; using DotNetMock.Framework.Data; using NUnit.Framework; namespace DotNetMock.Examples.MailingList { [TestFixture] public class MailingListTests { private string _email = "fre...@an...dress"; private string _name = "Fred Bloggs"; private MailingList _list = null; private MockListAction _mockListAction = null; private MockDbConnection _mockConnection = null; private MockCommand _mockCommand = null; private MockDataReader _mockReader = null; [SetUp] public void Init() { _list = new MailingList(); _mockListAction = new MockListAction(); _mockConnection = new MockDbConnection(); _mockCommand = new MockCommand(); _mockReader = new MockDataReader(); _mockConnection.SetExpectedCommand(_mockCommand); } private void setGeneralExpectations() { _mockConnection.SetExpectedCreateCalls(1); _mockCommand.SetExpectedExecuteCalls(1); _mockConnection.SetExpectedCloseCalls(1); } private void setExpectationsForAddMember() { setGeneralExpectations(); _mockCommand.SetExpectedCommandText(MailingList.INSERT_SQL); _mockCommand.SetExpectedParameter(new MockDataParameter("@email", _email)); _mockCommand.SetExpectedParameter(new MockDataParameter("@name", _name)); } private void setExpectationsForRemoveMember() { setGeneralExpectations(); _mockCommand.SetExpectedCommandText(MailingList.DELETE_SQL); _mockCommand.SetExpectedParameter(new MockDataParameter("@email", _email)); } private void setExpectationsForListMember() { setGeneralExpectations(); _mockCommand.SetExpectedReader(_mockReader); _mockCommand.SetExpectedCommandText(MailingList.SELECT_SQL); } private void verifyADO() { _mockCommand.Verify(); _mockConnection.Verify(); } [Test] public void AddNewMember() { setExpectationsForAddMember(); _list.AddMember(_mockConnection, _email, _name); verifyADO(); } [Test] [ExpectedException(typeof(MailingListException))] public void AddExistingMember() { setExpectationsForAddMember(); _mockCommand.SetExecuteException(new ConstraintException("Duplicate User")); _list.AddMember(_mockConnection, _email, _name); } [Test] public void CreateCommandFailsForAdd() { _mockConnection.SetCreateCommandException(new SystemException()); _mockConnection.SetExpectedCreateCalls(1); try { _list.AddMember(_mockConnection, _email, _name); Assertion.Fail("Should have thrown an exception."); } catch (SystemException) { } verifyADO(); } [Test] public void RemoveMember() { setExpectationsForRemoveMember(); _mockCommand.SetUpdateCount(1); _list.RemoveMember(_mockConnection, _email); verifyADO(); } [Test] public void RemoveMissingMember() { _mockCommand.SetUpdateCount(0); setExpectationsForRemoveMember(); try { _list.RemoveMember(_mockConnection, _email); } catch (MailingListException) { } verifyADO(); } [Test] public void ListOneMember() { setExpectationsForListMember(); object[,] values = new object[1,2]; values[0,0] = _email; values[0,1] = _name; _mockReader.SetRows(values); _mockReader.SetExpectedReadCalls(2); _mockListAction.AddExpectedMember(_email, _name); _mockListAction.SetExpectedMemberCount(1); _list.ApplyToAllMembers(_mockConnection, _mockListAction); verifyADO(); _mockReader.Verify(); _mockListAction.Verify(); } [Test] public void ListTwoMembers() { setExpectationsForListMember(); object[,] values = new object[2,2]; values[0,0] = _email; values[0,1] = _name; values[1,0] = _email; values[1,1] = _name; _mockReader.SetRows(values); _mockReader.SetExpectedReadCalls(3); _mockListAction.SetExpectedMemberCount(2); _mockListAction.AddExpectedMember(_email, _name); _mockListAction.AddExpectedMember(_email, _name); _list.ApplyToAllMembers(_mockConnection, _mockListAction); verifyADO(); _mockReader.Verify(); _mockListAction.Verify(); } [Test] public void ListNoMembers() { setExpectationsForListMember(); _mockReader.SetExpectedReadCalls(1); _mockListAction.SetExpectNoMembers(); _list.ApplyToAllMembers(_mockConnection, _mockListAction); verifyADO(); _mockReader.Verify(); _mockListAction.Verify(); } [Test] public void ListMemberFails() { setExpectationsForListMember(); object[,] values = new object[2,2]; values[0,0] = _email; values[0,1] = _name; values[1,0] = _email; values[1,1] = _name; _mockReader.SetRows(values); _mockReader.SetGetException(new ApplicationException("Mock Exception")); _mockReader.SetExpectedReadCalls(1); _mockListAction.SetExpectNoMembers(); try { _list.ApplyToAllMembers(_mockConnection, _mockListAction); Assertion.Fail("Should have thrown an exception."); } catch (ApplicationException) { } verifyADO(); _mockReader.Verify(); _mockListAction.Verify(); } } } |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:37
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples.NUnitTests Added Files: .cvsignore AssemblyInfo.cs DotNetMock.Examples.NUnitTests.csproj Log Message: Pulled out example NUnit tests to separate assembly. --- NEW FILE: DotNetMock.Examples.NUnitTests.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{760B53F4-0E0F-41A0-94ED-9B8691833A70}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "DotNetMock.Examples.NUnitTests" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "DotNetMock.Examples.NUnitTests" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" 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" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> <Reference Name = "DotNetMock.Examples" Project = "{80B98B32-57CB-4989-B506-0F2B0AD94DBA}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "nunit.framework" AssemblyName = "nunit.framework" HintPath = "..\lib-ext\NUnit-2.2\nunit.framework.dll" /> <Reference Name = "DotNetMock" Project = "{1AD0CD00-16FA-4456-B2ED-A47406957228}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "DotNetMock.Framework" Project = "{514DAB7F-4A05-4343-9BF5-2C3DC60A431D}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CustomExpectation\ExpectationPersonTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Dynamic\WeatherTest.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "MailingList\MailingListTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Mainframe\CustomerNumberCollectorTests.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Security\SensitiveClassTests.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: .cvsignore --- *.csproj.user *.suo bin obj --- 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("")] |
From: Choy R. <ch...@us...> - 2005-02-09 06:34:37
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Mainframe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/DotNetMock.Examples.NUnitTests/Mainframe Added Files: CustomerNumberCollectorTests.cs Log Message: Pulled out example NUnit tests to separate assembly. --- NEW FILE: CustomerNumberCollectorTests.cs --- using System; using NUnit.Framework; namespace DotNetMock.Examples.Mainframe { [TestFixture] public class SerialNumberCollectorTests { private MockMainframeConnection mockConnection = null; string[,] customerNumberScreen = null; string[,] mainMenu = null; CustomerNumberCollector customer = null; [SetUp] public void Init() { mockConnection = new MockMainframeConnection(); customerNumberScreen = new string[25,80]; mainMenu = new string[25,80]; customer = new CustomerNumberCollector(mockConnection); mockConnection.CreateScreen("MainMenu", mainMenu); mockConnection.CreateScreen("CustomerInformation", customerNumberScreen); } [TearDown] public void Destroy() { mockConnection = null; customerNumberScreen = null; } [Test] [ExpectedException(typeof(ApplicationException))] public void InValidCustomerNumber() { setGeneralExpectations(); mockConnection.SetExpectedKeyPress(MainframeConnection.Keys.Enter); mockConnection.SetField("CustomerInformation", 23, 2, "CUSTOMER NUMBER NOT FOUND"); customer.CollectCustomerInformation("9999999"); } [Test] public void ValidCustomerNumber() { setGeneralExpectations(); mockConnection.SetField("CustomerInformation", 20, 4, "Pete Rose"); mockConnection.SetField("CustomerInformation", 21, 4, "pete1234"); mockConnection.SetField("CustomerInformation", 22, 4, "password"); mockConnection.SetExpectedKeyPress(MainframeConnection.Keys.Enter); customer.CollectCustomerInformation("1234567"); Assertion.AssertEquals("Pete Rose", customer.Name); Assertion.AssertEquals("pete1234", customer.UserName); Assertion.AssertEquals("password", customer.Password); } [Test] public void ValidCustomerNumberUpdate() { setGeneralExpectations(); mockConnection.SetField("CustomerInformation", 23, 3, "TRANSACTION ACCEPTED"); mockConnection.SetField("CustomerInformation", 20, 4, "Pete Rose"); mockConnection.SetField("CustomerInformation", 21, 4, "pete1234"); mockConnection.SetField("CustomerInformation", 22, 4, "password"); mockConnection.SetExpectedKeyPress(MainframeConnection.Keys.Enter); customer.UpdateInformation("1234567", "Babe Ruth", "baberuth", "babepass"); Assertion.AssertEquals("Babe Ruth", customer.Name); Assertion.AssertEquals("baberuth", customer.UserName); Assertion.AssertEquals("babepass", customer.Password); } [Test] [ExpectedException(typeof(ApplicationException))] public void InvalidCustomerUpdate() { setGeneralExpectations(); mockConnection.SetExpectedKeyPress(MainframeConnection.Keys.Enter); mockConnection.SetField("CustomerInformation", 23, 2, "TRANSACTION FAILED"); customer.UpdateInformation("1234567", "Babe Ruth", "baberuth", "babepass"); } [Test] [ExpectedException(typeof(ApplicationException))] public void InValidCustomerNumberUpdateInformation() { setGeneralExpectations(); mockConnection.SetExpectedKeyPress(MainframeConnection.Keys.Enter); mockConnection.SetField("CustomerInformation", 23, 2, "CUSTOMER NUMBER NOT FOUND"); customer.UpdateInformation("9999999", "", "", ""); } private void setGeneralExpectations() { mockConnection.SetExpectedConnectCalls(1); mockConnection.SetExpectedDisconnectCalls(1); mockConnection.SetExpectedSendKeyCalls(1); } } } |
From: Choy R. <ch...@us...> - 2005-02-09 05:20:57
|
Update of /cvsroot/dotnetmock/dotnetmock/lib-ext/NUnit-2.2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5588/NUnit-2.2 Log Message: Directory /cvsroot/dotnetmock/dotnetmock/lib-ext/NUnit-2.2 added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:20:40
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj/Debug/temp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5468/temp Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj/Debug/temp added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:20:39
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj/Debug/TempPE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5468/TempPE Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj/Debug/TempPE added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:20:23
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj/Debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5424/Debug Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj/Debug added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:19:39
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5069/obj Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/obj added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:19:35
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5069/Security Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Security added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:19:34
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/MailingList In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5069/MailingList Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/MailingList added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:19:34
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Mainframe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5069/Mainframe Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Mainframe added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:19:33
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5069/Dynamic Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/Dynamic added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:19:33
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/CustomExpectation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5069/CustomExpectation Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests/CustomExpectation added to the repository |
From: Choy R. <ch...@us...> - 2005-02-09 05:19:24
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5008/DotNetMock.Examples.NUnitTests Log Message: Directory /cvsroot/dotnetmock/dotnetmock/DotNetMock.Examples.NUnitTests added to the repository |