diff --git a/.gitignore b/.gitignore
index 172a8d447..ec741a5f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,8 @@ _ReSharper*/
*.resharper
*.sln.DotSettings
[Tt]est[Rr]esult*
+.idea
+.vs
#Project files
[Bb]uild/
@@ -75,3 +77,4 @@ PrecompiledWeb
/.project
/examples/Spring/Spring.Mvc3QuickStart/packages
/examples/Spring/Spring.Mvc4QuickStart/packages
+/src/Spring/Spring.Testing.NUnit3/Spring.Testing.NUnit3.xml
diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/.nuget/NuGet.exe and /dev/null differ
diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets
deleted file mode 100644
index 83fe90601..000000000
--- a/.nuget/NuGet.targets
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
- $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
-
-
-
-
- $(SolutionDir).nuget
- packages.config
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.nuget/packages.config b/.nuget/packages.config
index 248ad4a16..a461d9a9c 100644
--- a/.nuget/packages.config
+++ b/.nuget/packages.config
@@ -1,4 +1,5 @@
-
+
+
\ No newline at end of file
diff --git a/Spring.Net.2010.sln b/Spring.Net.2010.sln
index 42b41f3f7..903634e7e 100644
--- a/Spring.Net.2010.sln
+++ b/Spring.Net.2010.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
+# Visual Studio 15
+VisualStudioVersion = 15.0.25807.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F04753EF-7A1B-4837-AB63-8C0821E8155D}"
ProjectSection(SolutionItems) = preProject
@@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
readme.txt = readme.txt
Spring.build = Spring.build
Spring.include = Spring.include
- TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Core.2010", "src\Spring\Spring.Core\Spring.Core.2010.csproj", "{710961A3-0DF4-49E4-A26E-F5B9C044AC84}"
@@ -90,9 +89,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Conversation.NHi
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{79F495DF-83D6-435E-A20E-47800F6F8FE7}"
ProjectSection(SolutionItems) = preProject
- .nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
+ .nuget\packages.config = .nuget\packages.config
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Web.Mvc5.2010", "src\Spring\Spring.Web.Mvc5\Spring.Web.Mvc5.2010.csproj", "{39AAD7EA-2ED0-4E50-8D4D-C666EA9CBFE4}"
@@ -108,6 +105,7 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Template.Velocity.Castle.2010", "src\Spring\Spring.Template.Velocity.Castle\Spring.Template.Velocity.Castle.2010.csproj", "{250601C0-A4AC-41FE-B484-51A9B0D5473D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Template.Velocity.Castle.Tests.2010", "test\Spring\Spring.Template.Velocity.Castle.Tests\Spring.Template.Velocity.Castle.Tests.2010.csproj", "{8D6ED392-8A1F-41C0-A765-22CF384EDEA1}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests", "test\Spring\Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests\Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.csproj", "{DE276F7C-4564-49EC-AABC-B964EC3D1626}"
EndProject
Global
@@ -579,7 +577,7 @@ Global
{8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Any CPU.Build.0 = Release|Any CPU
{8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {8D6ED392-8A1F-41C0-A765-22CF384EDEA1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DE276F7C-4564-49EC-AABC-B964EC3D1626}.Debug|.NET.ActiveCfg = Debug|Any CPU
{DE276F7C-4564-49EC-AABC-B964EC3D1626}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE276F7C-4564-49EC-AABC-B964EC3D1626}.Debug|Any CPU.Build.0 = Debug|Any CPU
diff --git a/Spring.build b/Spring.build
index 0431f8efe..478f6b68b 100644
--- a/Spring.build
+++ b/Spring.build
@@ -111,6 +111,7 @@ Commandline Examples:
+
@@ -319,77 +320,77 @@ Commandline Examples:
@@ -494,24 +495,21 @@ Commandline Examples:
-
-
+
+
-
-
-
-
+
-
+
@@ -548,12 +546,13 @@ Commandline Examples:
-
+
-
-
+
+
+
diff --git a/.nuget/NuGet.Config b/build-support/tools/NuGet/NuGet.Config
similarity index 100%
rename from .nuget/NuGet.Config
rename to build-support/tools/NuGet/NuGet.Config
diff --git a/build-support/tools/NuGet/NuGet.exe b/build-support/tools/NuGet/NuGet.exe
index 2c9369842..305300ad4 100644
Binary files a/build-support/tools/NuGet/NuGet.exe and b/build-support/tools/NuGet/NuGet.exe differ
diff --git a/common-project.include b/common-project.include
index 248d6ed95..0e14b1f78 100644
--- a/common-project.include
+++ b/common-project.include
@@ -217,7 +217,6 @@ ${tool.dir} : dir for tools
-
@@ -245,10 +244,8 @@ ${tool.dir} : dir for tools
-
-
-
-
+
+
@@ -289,10 +286,8 @@ ${tool.dir} : dir for tools
-
-
-
-
+
+
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.CodeConfig.Migration/Spring.CodeConfig.Migration.2010.sln b/examples/Spring/Spring.CodeConfig.Migration/Spring.CodeConfig.Migration.2010.sln
index 33aaf03ba..5ed83fcd4 100644
--- a/examples/Spring/Spring.CodeConfig.Migration/Spring.CodeConfig.Migration.2010.sln
+++ b/examples/Spring/Spring.CodeConfig.Migration/Spring.CodeConfig.Migration.2010.sln
@@ -12,8 +12,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F23A9A50-A91F-42B2-9390-C8DF48A4CC0B}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -39,3 +37,4 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/Primes.Tests.2010.csproj b/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/Primes.Tests.2010.csproj
index 15fd42e02..b5a5e2e9f 100644
--- a/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/Primes.Tests.2010.csproj
+++ b/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/Primes.Tests.2010.csproj
@@ -33,7 +33,6 @@
true
..\..\
- true
true
@@ -53,8 +52,9 @@
4
-
- ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
@@ -100,7 +100,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/packages.config b/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/packages.config
index 967502dc8..afecfdbd5 100644
--- a/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/packages.config
+++ b/examples/Spring/Spring.CodeConfig.Migration/test/Primes.Tests/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.Config b/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.exe b/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.targets b/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/Spring.Northwind.2010.sln b/examples/Spring/Spring.Data.NHibernate.Northwind/Spring.Northwind.2010.sln
index 0b837e33e..0c71dd5c7 100644
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/Spring.Northwind.2010.sln
+++ b/examples/Spring/Spring.Data.NHibernate.Northwind/Spring.Northwind.2010.sln
@@ -18,8 +18,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{9856AC2A-F30F-45D5-B411-A048030AED00}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -100,3 +98,4 @@ Global
NAntAddinLastFileName =
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Dao.NHibernate/Spring.Northwind.Dao.NHibernate.2010.csproj b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Dao.NHibernate/Spring.Northwind.Dao.NHibernate.2010.csproj
index 3c7c3a3e5..0ef9d1f7a 100644
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Dao.NHibernate/Spring.Northwind.Dao.NHibernate.2010.csproj
+++ b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Dao.NHibernate/Spring.Northwind.Dao.NHibernate.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\
- true
true
@@ -139,7 +138,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Service/Spring.Northwind.Service.2010.csproj b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Service/Spring.Northwind.Service.2010.csproj
index 12052fe97..aa2e403c5 100644
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Service/Spring.Northwind.Service.2010.csproj
+++ b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Service/Spring.Northwind.Service.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\
- true
true
@@ -109,13 +108,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web.Conversation/Spring.Northwind.Web.Conversation.2010.csproj b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web.Conversation/Spring.Northwind.Web.Conversation.2010.csproj
index 7de457561..502948f90 100644
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web.Conversation/Spring.Northwind.Web.Conversation.2010.csproj
+++ b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web.Conversation/Spring.Northwind.Web.Conversation.2010.csproj
@@ -25,7 +25,6 @@
..\..\
- true
true
@@ -250,5 +249,5 @@
copy "$(ProjectDir)Web.net40.config" "$(ProjectDir)Web.config" /Y
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/Spring.Northwind.Web.2010.csproj b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/Spring.Northwind.Web.2010.csproj
index 55aa3039b..87efb31a6 100644
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/Spring.Northwind.Web.2010.csproj
+++ b/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/Spring.Northwind.Web.2010.csproj
@@ -25,7 +25,6 @@
..\..\
- true
true
@@ -48,7 +47,7 @@
..\..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll
-
+
False
..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
@@ -58,11 +57,11 @@
..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll
-
+
False
..\..\packages\log4net.2.0.0\lib\net40-full\log4net.dll
-
+
False
..\..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll
@@ -237,5 +236,5 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/Spring.Northwind.IntegrationTests.2010.csproj b/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/Spring.Northwind.IntegrationTests.2010.csproj
index 5f8ca6a9a..a7b517625 100644
--- a/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/Spring.Northwind.IntegrationTests.2010.csproj
+++ b/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/Spring.Northwind.IntegrationTests.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\
- true
true
@@ -147,5 +146,5 @@
rem echo "Copying .xml files for tests"
rem xcopy "$(ProjectDir)Data" ..\..\..\..\build\VS.Net.2005\Spring.Northwind.IntegrationTests\$(ConfigurationName)\ /y /s /q
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.Config b/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.exe b/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.targets b/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.DataQuickStart/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.DataQuickStart/Spring.DataQuickStart.2010.sln b/examples/Spring/Spring.DataQuickStart/Spring.DataQuickStart.2010.sln
index 335ec4492..364a0fa66 100644
--- a/examples/Spring/Spring.DataQuickStart/Spring.DataQuickStart.2010.sln
+++ b/examples/Spring/Spring.DataQuickStart/Spring.DataQuickStart.2010.sln
@@ -10,8 +10,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E5FB613E-87C5-47F4-A4BA-80430707D922}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -33,3 +31,4 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/Spring.DataQuickStart.Tests.2010.csproj b/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/Spring.DataQuickStart.Tests.2010.csproj
index 5e163056e..ace2be0da 100644
--- a/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/Spring.DataQuickStart.Tests.2010.csproj
+++ b/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/Spring.DataQuickStart.Tests.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -58,8 +57,9 @@
False
..\..\..\..\..\..\lib\Net\2.0\Common.Logging.dll
-
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
False
@@ -123,7 +123,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/packages.config b/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/packages.config
index 967502dc8..afecfdbd5 100644
--- a/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/packages.config
+++ b/examples/Spring/Spring.DataQuickStart/test/Spring/Spring.DataQuickStart.Tests/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.Config b/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.exe b/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.exe
deleted file mode 100644
index 8dd7e45ae..000000000
Binary files a/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.targets b/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.targets
deleted file mode 100644
index 3f8c37b22..000000000
--- a/examples/Spring/Spring.EmsQuickStart/.nuget/NuGet.targets
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config
- $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config
-
-
-
- $(MSBuildProjectDirectory)\packages.config
- $(PackagesProjectConfig)
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 "$(NuGetExePath)"
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.EmsQuickStart/Spring.EmsQuickStart.2010.sln b/examples/Spring/Spring.EmsQuickStart/Spring.EmsQuickStart.2010.sln
index b89a3ff64..737ee0a4e 100644
--- a/examples/Spring/Spring.EmsQuickStart/Spring.EmsQuickStart.2010.sln
+++ b/examples/Spring/Spring.EmsQuickStart/Spring.EmsQuickStart.2010.sln
@@ -12,8 +12,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{65E8C5AC-1A63-401B-8D46-C86B53AD0FCA}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -39,3 +37,4 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Client/Spring.EmsQuickStart.Client.2010.csproj b/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Client/Spring.EmsQuickStart.Client.2010.csproj
index 45c3e93f7..377457543 100644
--- a/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Client/Spring.EmsQuickStart.Client.2010.csproj
+++ b/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Client/Spring.EmsQuickStart.Client.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -168,13 +167,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Server/Spring.EmsQuickStart.Server.2010.csproj b/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Server/Spring.EmsQuickStart.Server.2010.csproj
index 4e0133694..2ca86b720 100644
--- a/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Server/Spring.EmsQuickStart.Server.2010.csproj
+++ b/examples/Spring/Spring.EmsQuickStart/src/Spring/Spring.EmsQuickStart.Server/Spring.EmsQuickStart.Server.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -140,13 +139,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.Config b/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.exe b/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.targets b/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.Mvc3QuickStart/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.sln b/examples/Spring/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.sln
index 19c78f5db..63105f2bf 100644
--- a/examples/Spring/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.sln
+++ b/examples/Spring/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.sln
@@ -8,8 +8,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{35FE31BB-390E-4A9B-B18D-EF56149887DC}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -27,3 +25,4 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.Mvc3QuickStart/src/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.csproj b/examples/Spring/Spring.Mvc3QuickStart/src/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.csproj
index b94212966..83e897cb7 100644
--- a/examples/Spring/Spring.Mvc3QuickStart/src/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.csproj
+++ b/examples/Spring/Spring.Mvc3QuickStart/src/Spring.Mvc3QuickStart/Spring.Mvc3QuickStart.csproj
@@ -27,7 +27,6 @@
..\..\
- true
true
@@ -272,5 +271,5 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.Config b/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.exe b/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.targets b/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.Mvc4QuickStart/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.sln b/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.sln
index e9e05c165..bf89b58ba 100644
--- a/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.sln
+++ b/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.sln
@@ -8,8 +8,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{B8B219A2-F211-4C40-A8A8-B02EC45392DD}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -30,3 +28,4 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.csproj b/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.csproj
index c5fd27161..deba2b59c 100644
--- a/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.csproj
+++ b/examples/Spring/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart/Spring.Mvc4QuickStart.csproj
@@ -22,7 +22,6 @@
..\
- true
true
@@ -344,11 +343,11 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.Config b/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.exe b/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.targets b/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.Mvc5QuickStart/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.sln b/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.sln
index 18b591995..f6c206583 100644
--- a/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.sln
+++ b/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.sln
@@ -8,8 +8,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{4A2796E5-17F2-40EA-8B5A-10653BEDE033}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -30,3 +28,4 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.csproj b/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.csproj
index 3bc668ffa..2c2f983f9 100644
--- a/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.csproj
+++ b/examples/Spring/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart/Spring.Mvc5QuickStart.csproj
@@ -23,7 +23,6 @@
..\packages\WebGrease.1.5.2\lib
..\
- true
true
@@ -336,11 +335,11 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.Config b/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.exe b/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.targets b/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.Scheduling.Quartz.Example/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2010.sln b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2010.sln
index 31bf3f2b1..65fe098d2 100644
--- a/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2010.sln
+++ b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2010.sln
@@ -8,8 +8,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{35E88E1E-32F0-4986-83A5-A479A9E20D72}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
@@ -27,3 +25,4 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+
diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2010.csproj b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2010.csproj
index a59ba5780..e5b181b98 100644
--- a/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2010.csproj
+++ b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2010.csproj
@@ -45,7 +45,6 @@
false
true
..\
- true
..\..\..\..\build\VS.NET.2010\Spring.Scheduling.Quartz.Example\Debug\
@@ -160,5 +159,5 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.Config b/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.exe b/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.targets b/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.TxQuickStart/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.sln b/examples/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.sln
index 44f22b059..910087e1b 100644
--- a/examples/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.sln
+++ b/examples/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.sln
@@ -1,19 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
+# Visual Studio 15
+VisualStudioVersion = 15.0.25807.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.TxQuickStart.2010", "src\Spring\Spring.TxQuickStart\Spring.TxQuickStart.2010.csproj", "{EDDC48D5-4F25-4476-9BA3-12F2E8BB5A8C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.TxQuickStart.Tests.2010", "test\Spring\Spring.TxQuickStart.Tests\Spring.TxQuickStart.Tests.2010.csproj", "{94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{8030060A-35D1-4B8B-8737-93A535073CFE}"
- ProjectSection(SolutionItems) = preProject
- .nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
- EndProjectSection
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/examples/Spring/Spring.TxQuickStart/src/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.csproj b/examples/Spring/Spring.TxQuickStart/src/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.csproj
index 704769e3e..3df93ea5f 100644
--- a/examples/Spring/Spring.TxQuickStart/src/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.csproj
+++ b/examples/Spring/Spring.TxQuickStart/src/Spring/Spring.TxQuickStart/Spring.TxQuickStart.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -111,13 +110,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/Spring.TxQuickStart.Tests.2010.csproj b/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/Spring.TxQuickStart.Tests.2010.csproj
index 0abe3320a..3ff551f71 100644
--- a/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/Spring.TxQuickStart.Tests.2010.csproj
+++ b/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/Spring.TxQuickStart.Tests.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -66,8 +65,9 @@
..\..\..\packages\log4net.2.0.0\lib\net40-full\log4net.dll
-
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
False
@@ -131,7 +131,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/TxQuickStart/Services/AccountManagerUnitTests.cs b/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/TxQuickStart/Services/AccountManagerUnitTests.cs
index 8b5c5f467..da146523a 100644
--- a/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/TxQuickStart/Services/AccountManagerUnitTests.cs
+++ b/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/TxQuickStart/Services/AccountManagerUnitTests.cs
@@ -53,10 +53,9 @@ public void TransferBelowMaxAmount()
}
[Test]
- [ExpectedException(typeof(ArithmeticException))]
public void TransferAboveMaxAmount()
{
- accountManager.DoTransfer(2000000, 200000);
+ Assert.Throws(() => accountManager.DoTransfer(2000000, 200000));
}
}
}
\ No newline at end of file
diff --git a/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/packages.config b/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/packages.config
index 5efdf6efe..ea758916a 100644
--- a/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/packages.config
+++ b/examples/Spring/Spring.TxQuickStart/test/Spring/Spring.TxQuickStart.Tests/packages.config
@@ -4,5 +4,5 @@
-
+
\ No newline at end of file
diff --git a/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.Config b/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.exe b/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.targets b/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/Spring.WebQuickStart/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/Spring.WebQuickStart/.nuget/packages.config b/examples/Spring/Spring.WebQuickStart/.nuget/packages.config
deleted file mode 100644
index 0599d7b8c..000000000
--- a/examples/Spring/Spring.WebQuickStart/.nuget/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/SpringAir/.nuget/NuGet.Config b/examples/Spring/SpringAir/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/examples/Spring/SpringAir/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/Spring/SpringAir/.nuget/NuGet.exe b/examples/Spring/SpringAir/.nuget/NuGet.exe
deleted file mode 100644
index 8f6134029..000000000
Binary files a/examples/Spring/SpringAir/.nuget/NuGet.exe and /dev/null differ
diff --git a/examples/Spring/SpringAir/.nuget/NuGet.targets b/examples/Spring/SpringAir/.nuget/NuGet.targets
deleted file mode 100644
index 2c3545bc7..000000000
--- a/examples/Spring/SpringAir/.nuget/NuGet.targets
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
-
-
-
-
- $(SolutionDir).nuget
-
-
-
- packages.$(MSBuildProjectName.Replace(' ', '_')).config
-
-
-
-
-
- $(PackagesProjectConfig)
-
-
-
-
- packages.config
-
-
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
- "$(SolutionDir) "
- "$(SolutionDir)"
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
- $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/Spring/SpringAir/SpringAir.2010.sln b/examples/Spring/SpringAir/SpringAir.2010.sln
index 92ee6ba58..3c0b6665f 100644
--- a/examples/Spring/SpringAir/SpringAir.2010.sln
+++ b/examples/Spring/SpringAir/SpringAir.2010.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
+# Visual Studio 15
+VisualStudioVersion = 15.0.25807.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "SpringAir.Web.2010", "src\SpringAir.Web.2010\", "{839602F5-8077-497D-9CCB-C9F02741CA55}"
ProjectSection(WebsiteProperties) = preProject
@@ -36,13 +36,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpringAir.Data.Ado.Tests.20
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpringAir.Web.2010.References", "src\SpringAir.Web.2005.References\SpringAir.Web.2010.References.csproj", "{0925F8C7-B2AB-4DD7-AF6D-10DD028C5910}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CBB230BE-316F-4ABE-921B-1B8C13EAA8A1}"
- ProjectSection(SolutionItems) = preProject
- .nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
- EndProjectSection
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
diff --git a/examples/Spring/SpringAir/src/SpringAir.Web.2005.References/SpringAir.Web.2010.References.csproj b/examples/Spring/SpringAir/src/SpringAir.Web.2005.References/SpringAir.Web.2010.References.csproj
index abe265675..04cb961ed 100644
--- a/examples/Spring/SpringAir/src/SpringAir.Web.2005.References/SpringAir.Web.2010.References.csproj
+++ b/examples/Spring/SpringAir/src/SpringAir.Web.2005.References/SpringAir.Web.2010.References.csproj
@@ -32,7 +32,6 @@
false
true
..\..\
- true
true
@@ -114,13 +113,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/SpringAir/test/SpringAir.Core.Tests/Domain/TimeRangeTests.cs b/examples/Spring/SpringAir/test/SpringAir.Core.Tests/Domain/TimeRangeTests.cs
index e83a2424b..6f71c3612 100644
--- a/examples/Spring/SpringAir/test/SpringAir.Core.Tests/Domain/TimeRangeTests.cs
+++ b/examples/Spring/SpringAir/test/SpringAir.Core.Tests/Domain/TimeRangeTests.cs
@@ -71,11 +71,10 @@ public void ConvertFromSunnyDayWithLotsOfExtraneousWhitespace()
}
[Test]
- [ExpectedException(typeof(FormatException))]
public void ConvertFromWithOutOfShortRangeException()
{
TimeRange.TimeRangeTypeConverter vrtr = new TimeRange.TimeRangeTypeConverter();
- vrtr.ConvertFrom("[ 1287876 - 9 ]");
+ Assert.Throws(() => vrtr.ConvertFrom("[ 1287876 - 9 ]"));
}
[Test]
diff --git a/examples/Spring/SpringAir/test/SpringAir.Core.Tests/SpringAir.Core.Tests.2010.csproj b/examples/Spring/SpringAir/test/SpringAir.Core.Tests/SpringAir.Core.Tests.2010.csproj
index 41d63f9d9..9cf06e752 100644
--- a/examples/Spring/SpringAir/test/SpringAir.Core.Tests/SpringAir.Core.Tests.2010.csproj
+++ b/examples/Spring/SpringAir/test/SpringAir.Core.Tests/SpringAir.Core.Tests.2010.csproj
@@ -46,7 +46,6 @@
false
true
..\..\
- true
bin\Debug\
@@ -95,8 +94,9 @@
prompt
-
- ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
System
@@ -161,5 +161,5 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/SpringAir/test/SpringAir.Core.Tests/packages.config b/examples/Spring/SpringAir/test/SpringAir.Core.Tests/packages.config
index 967502dc8..afecfdbd5 100644
--- a/examples/Spring/SpringAir/test/SpringAir.Core.Tests/packages.config
+++ b/examples/Spring/SpringAir/test/SpringAir.Core.Tests/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/AirportDaoTests.cs b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/AirportDaoTests.cs
index 18530137f..6da7f6f0c 100644
--- a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/AirportDaoTests.cs
+++ b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/AirportDaoTests.cs
@@ -22,6 +22,7 @@
using System.Collections;
using NUnit.Framework;
+using Spring.Dao;
using Spring.Data.Common;
using SpringAir.Domain;
@@ -84,10 +85,9 @@ public void GetAirportByCode()
}
[Test]
- [ExpectedException(typeof(Spring.Dao.EmptyResultDataAccessException))]
public void GetAirportByCodeNonExistent()
{
- Airport airport = dao.GetAirport("FOO");
+ Assert.Throws(() => dao.GetAirport("FOO"));
}
}
}
\ No newline at end of file
diff --git a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/FlightDaoTests.cs b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/FlightDaoTests.cs
index d4bf0c7da..340836aa3 100644
--- a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/FlightDaoTests.cs
+++ b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/Data/Ado/FlightDaoTests.cs
@@ -36,10 +36,9 @@ namespace SpringAir.Data.Ado
public sealed class FlightDaoTests
{
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void CtorWithNullAircraftDao()
{
- new FlightDao(null);
+ Assert.Throws(() => new FlightDao(null));
}
}
}
\ No newline at end of file
diff --git a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/SpringAir.Data.Ado.Tests.2010.csproj b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/SpringAir.Data.Ado.Tests.2010.csproj
index 59604a236..64faacaef 100644
--- a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/SpringAir.Data.Ado.Tests.2010.csproj
+++ b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/SpringAir.Data.Ado.Tests.2010.csproj
@@ -46,7 +46,6 @@
false
true
..\..\
- true
bin\Debug\
@@ -95,8 +94,9 @@
prompt
-
- ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
False
@@ -166,5 +166,5 @@
-
-
\ No newline at end of file
+
+
diff --git a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/packages.config b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/packages.config
index 967502dc8..afecfdbd5 100644
--- a/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/packages.config
+++ b/examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/packages.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/src/Spring/CommonAssemblyInfo.cs b/src/Spring/CommonAssemblyInfo.cs
index bab00fed8..aad86872b 100644
--- a/src/Spring/CommonAssemblyInfo.cs
+++ b/src/Spring/CommonAssemblyInfo.cs
@@ -1,8 +1,7 @@
-using System;
using System.Reflection;
#if !TIBCO_EMS
-[assembly: CLSCompliant(true)]
+[assembly: System.CLSCompliant(true)]
#endif
//
diff --git a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreator.cs b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreator.cs
index 6144760e4..c670707af 100644
--- a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreator.cs
+++ b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreator.cs
@@ -28,7 +28,7 @@
using Spring.Core;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
-using Spring.Util;
+
using System.Linq;
#endregion
diff --git a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/DefaultAdvisorAutoProxyCreator.cs b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/DefaultAdvisorAutoProxyCreator.cs
index 5217ef442..ef8d20e80 100644
--- a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/DefaultAdvisorAutoProxyCreator.cs
+++ b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/DefaultAdvisorAutoProxyCreator.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using Spring.Objects.Factory;
diff --git a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/IAdvisorRetrievalHelper.cs b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/IAdvisorRetrievalHelper.cs
index bcaa84513..627229764 100644
--- a/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/IAdvisorRetrievalHelper.cs
+++ b/src/Spring/Spring.Aop/Aop/Framework/AutoProxy/IAdvisorRetrievalHelper.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections;
using System.Collections.Generic;
namespace Spring.Aop.Framework.AutoProxy
diff --git a/src/Spring/Spring.Aop/Spring.Aop.2010.csproj b/src/Spring/Spring.Aop/Spring.Aop.2010.csproj
index b79918c7e..23e8c9189 100644
--- a/src/Spring/Spring.Aop/Spring.Aop.2010.csproj
+++ b/src/Spring/Spring.Aop/Spring.Aop.2010.csproj
@@ -45,7 +45,6 @@
3.5
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Aop\Debug\
@@ -479,11 +478,5 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Core/AssemblyInfo.cs b/src/Spring/Spring.Core/AssemblyInfo.cs
index 59d4af1ce..ef2c59579 100644
--- a/src/Spring/Spring.Core/AssemblyInfo.cs
+++ b/src/Spring/Spring.Core/AssemblyInfo.cs
@@ -20,23 +20,12 @@
using System.Reflection;
using System.Runtime.InteropServices;
-using System.Security;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle("Spring.Core")]
[assembly: AssemblyDescription("Core functionality for Spring.Net IoC container")]
-//
-// Security Permissions
-//
-// we need full, unrestricted access to reflection metadata...
-//[assembly: ReflectionPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
-//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")]
-//[assembly: AssemblyKeyFile(@"C:\projects\Spring.Net\Spring.Net.snk")]
-
#if !NET_4_0
-[assembly: AllowPartiallyTrustedCallers]
-
-[assembly: SecurityCritical]
-
+[assembly: System.Security.AllowPartiallyTrustedCallers]
+[assembly: System.Security.SecurityCritical]
#endif
diff --git a/src/Spring/Spring.Core/Collections/Generic/AbstractDictionary.cs b/src/Spring/Spring.Core/Collections/Generic/AbstractDictionary.cs
index d59470d94..1475b8821 100644
--- a/src/Spring/Spring.Core/Collections/Generic/AbstractDictionary.cs
+++ b/src/Spring/Spring.Core/Collections/Generic/AbstractDictionary.cs
@@ -18,11 +18,8 @@
#endregion
-using System;
-using System.Collections;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
namespace Spring.Collections.Generic
{
diff --git a/src/Spring/Spring.Core/Collections/Generic/LinkedHashDictionary.cs b/src/Spring/Spring.Core/Collections/Generic/LinkedHashDictionary.cs
index c68d15f44..db0f17d14 100644
--- a/src/Spring/Spring.Core/Collections/Generic/LinkedHashDictionary.cs
+++ b/src/Spring/Spring.Core/Collections/Generic/LinkedHashDictionary.cs
@@ -18,10 +18,7 @@
#endregion
-using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace Spring.Collections.Generic
{
diff --git a/src/Spring/Spring.Core/Context/Config/AttributeConfigObjectDefinitionParser.cs b/src/Spring/Spring.Core/Context/Config/AttributeConfigObjectDefinitionParser.cs
index b39b6a2e6..d9e4714b6 100644
--- a/src/Spring/Spring.Core/Context/Config/AttributeConfigObjectDefinitionParser.cs
+++ b/src/Spring/Spring.Core/Context/Config/AttributeConfigObjectDefinitionParser.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using System.Xml;
using Spring.Context.Attributes;
using Spring.Objects.Factory.Config;
diff --git a/src/Spring/Spring.Core/Context/IApplicationContext.cs b/src/Spring/Spring.Core/Context/IApplicationContext.cs
index cb0c819d8..3d181ec6c 100644
--- a/src/Spring/Spring.Core/Context/IApplicationContext.cs
+++ b/src/Spring/Spring.Core/Context/IApplicationContext.cs
@@ -25,7 +25,6 @@
using Spring.Core.IO;
using Spring.Objects.Events;
using Spring.Objects.Factory;
-using Spring.Objects.Factory.Config;
#endregion
diff --git a/src/Spring/Spring.Core/Context/IMessageSourceResolvable.cs b/src/Spring/Spring.Core/Context/IMessageSourceResolvable.cs
index d871adb6e..745707652 100644
--- a/src/Spring/Spring.Core/Context/IMessageSourceResolvable.cs
+++ b/src/Spring/Spring.Core/Context/IMessageSourceResolvable.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections.Generic;
using System.Globalization;
diff --git a/src/Spring/Spring.Core/Context/Support/MessageSourceResolvableVisitor.cs b/src/Spring/Spring.Core/Context/Support/MessageSourceResolvableVisitor.cs
index b697c13be..d079d8190 100644
--- a/src/Spring/Spring.Core/Context/Support/MessageSourceResolvableVisitor.cs
+++ b/src/Spring/Spring.Core/Context/Support/MessageSourceResolvableVisitor.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Text;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Context/Support/NamespaceParsersSectionHandler.cs b/src/Spring/Spring.Core/Context/Support/NamespaceParsersSectionHandler.cs
index 642b7610e..a51ba2c2c 100644
--- a/src/Spring/Spring.Core/Context/Support/NamespaceParsersSectionHandler.cs
+++ b/src/Spring/Spring.Core/Context/Support/NamespaceParsersSectionHandler.cs
@@ -25,9 +25,7 @@
using System.Globalization;
using System.Xml;
-using Spring.Core;
using Spring.Core.TypeResolution;
-using Spring.Objects;
using Spring.Objects.Factory.Xml;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Context/Support/XmlApplicationContext.cs b/src/Spring/Spring.Core/Context/Support/XmlApplicationContext.cs
index 1b966475a..d2bdd26d3 100644
--- a/src/Spring/Spring.Core/Context/Support/XmlApplicationContext.cs
+++ b/src/Spring/Spring.Core/Context/Support/XmlApplicationContext.cs
@@ -18,7 +18,6 @@
#endregion
-using Spring.Util;
using Spring.Core.IO;
using System;
diff --git a/src/Spring/Spring.Core/Core/ComposedCriteria.cs b/src/Spring/Spring.Core/Core/ComposedCriteria.cs
index 0086fd690..1a63d0510 100644
--- a/src/Spring/Spring.Core/Core/ComposedCriteria.cs
+++ b/src/Spring/Spring.Core/Core/ComposedCriteria.cs
@@ -20,9 +20,7 @@
#region Imports
-using System.Collections;
using System.Collections.Generic;
-using Spring.Core;
#endregion
diff --git a/src/Spring/Spring.Core/Core/IAttributeAccessor.cs b/src/Spring/Spring.Core/Core/IAttributeAccessor.cs
index 5d7a85932..76f1d2d2c 100644
--- a/src/Spring/Spring.Core/Core/IAttributeAccessor.cs
+++ b/src/Spring/Spring.Core/Core/IAttributeAccessor.cs
@@ -19,9 +19,6 @@
#endregion
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace Spring.Core
{
diff --git a/src/Spring/Spring.Core/Core/IO/IInputStreamSource.cs b/src/Spring/Spring.Core/Core/IO/IInputStreamSource.cs
index d8b3f8c5c..28307e519 100644
--- a/src/Spring/Spring.Core/Core/IO/IInputStreamSource.cs
+++ b/src/Spring/Spring.Core/Core/IO/IInputStreamSource.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.IO;
#endregion
diff --git a/src/Spring/Spring.Core/Core/IO/StringResource.cs b/src/Spring/Spring.Core/Core/IO/StringResource.cs
index 3966a1b37..631be25ee 100644
--- a/src/Spring/Spring.Core/Core/IO/StringResource.cs
+++ b/src/Spring/Spring.Core/Core/IO/StringResource.cs
@@ -20,10 +20,9 @@
#region Imports
-using System;
using System.IO;
using System.Text;
-using Spring.Core.IO;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/MethodArgumentsCriteria.cs b/src/Spring/Spring.Core/Core/MethodArgumentsCriteria.cs
index ef8be559c..91f4ebd98 100644
--- a/src/Spring/Spring.Core/Core/MethodArgumentsCriteria.cs
+++ b/src/Spring/Spring.Core/Core/MethodArgumentsCriteria.cs
@@ -22,7 +22,7 @@
using System;
using System.Reflection;
-using Spring.Core;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/MethodInvocationException.cs b/src/Spring/Spring.Core/Core/MethodInvocationException.cs
index 4e865c489..c6a8a94a6 100644
--- a/src/Spring/Spring.Core/Core/MethodInvocationException.cs
+++ b/src/Spring/Spring.Core/Core/MethodInvocationException.cs
@@ -22,7 +22,6 @@
using System;
using System.Runtime.Serialization;
-using Spring.Core;
#endregion
diff --git a/src/Spring/Spring.Core/Core/MethodNameMatchCriteria.cs b/src/Spring/Spring.Core/Core/MethodNameMatchCriteria.cs
index fcc927791..730b51a6f 100644
--- a/src/Spring/Spring.Core/Core/MethodNameMatchCriteria.cs
+++ b/src/Spring/Spring.Core/Core/MethodNameMatchCriteria.cs
@@ -20,10 +20,8 @@
#region Imports
-using System;
using System.Reflection;
-using Spring.Core;
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/MethodParametersCountCriteria.cs b/src/Spring/Spring.Core/Core/MethodParametersCountCriteria.cs
index 0afb865d8..204caa9a1 100644
--- a/src/Spring/Spring.Core/Core/MethodParametersCountCriteria.cs
+++ b/src/Spring/Spring.Core/Core/MethodParametersCountCriteria.cs
@@ -22,7 +22,6 @@
using System;
using System.Reflection;
-using Spring.Core;
#endregion
diff --git a/src/Spring/Spring.Core/Core/MethodParametersCriteria.cs b/src/Spring/Spring.Core/Core/MethodParametersCriteria.cs
index 5937133aa..eeffbd5da 100644
--- a/src/Spring/Spring.Core/Core/MethodParametersCriteria.cs
+++ b/src/Spring/Spring.Core/Core/MethodParametersCriteria.cs
@@ -22,8 +22,6 @@
using System;
using System.Reflection;
-using Spring.Core;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/MethodReturnTypeCriteria.cs b/src/Spring/Spring.Core/Core/MethodReturnTypeCriteria.cs
index a3d905744..158da7652 100644
--- a/src/Spring/Spring.Core/Core/MethodReturnTypeCriteria.cs
+++ b/src/Spring/Spring.Core/Core/MethodReturnTypeCriteria.cs
@@ -22,7 +22,6 @@
using System;
using System.Reflection;
-using Spring.Core;
#endregion
diff --git a/src/Spring/Spring.Core/Core/PropertyAccessException.cs b/src/Spring/Spring.Core/Core/PropertyAccessException.cs
index 90e888f46..61d8c8414 100644
--- a/src/Spring/Spring.Core/Core/PropertyAccessException.cs
+++ b/src/Spring/Spring.Core/Core/PropertyAccessException.cs
@@ -23,7 +23,7 @@
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
-using Spring.Core;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/RegularExpressionCriteria.cs b/src/Spring/Spring.Core/Core/RegularExpressionCriteria.cs
index 795bbac02..5fe44f4bf 100644
--- a/src/Spring/Spring.Core/Core/RegularExpressionCriteria.cs
+++ b/src/Spring/Spring.Core/Core/RegularExpressionCriteria.cs
@@ -21,7 +21,7 @@
#region Imports
using System.Text.RegularExpressions;
-using Spring.Core;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/RegularExpressionEventNameCriteria.cs b/src/Spring/Spring.Core/Core/RegularExpressionEventNameCriteria.cs
index 4a92f7daf..191269b49 100644
--- a/src/Spring/Spring.Core/Core/RegularExpressionEventNameCriteria.cs
+++ b/src/Spring/Spring.Core/Core/RegularExpressionEventNameCriteria.cs
@@ -22,7 +22,7 @@
using System.Reflection;
using System.Text.RegularExpressions;
-using Spring.Core;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/RegularExpressionMethodNameCriteria.cs b/src/Spring/Spring.Core/Core/RegularExpressionMethodNameCriteria.cs
index 3e576fd7d..a72a5a8d0 100644
--- a/src/Spring/Spring.Core/Core/RegularExpressionMethodNameCriteria.cs
+++ b/src/Spring/Spring.Core/Core/RegularExpressionMethodNameCriteria.cs
@@ -22,7 +22,7 @@
using System.Reflection;
using System.Text.RegularExpressions;
-using Spring.Objects.Support;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/TypeConversion/RuntimeTypeConverter.cs b/src/Spring/Spring.Core/Core/TypeConversion/RuntimeTypeConverter.cs
index f1250f8e7..b37af2cdd 100644
--- a/src/Spring/Spring.Core/Core/TypeConversion/RuntimeTypeConverter.cs
+++ b/src/Spring/Spring.Core/Core/TypeConversion/RuntimeTypeConverter.cs
@@ -25,7 +25,6 @@
using System.Globalization;
using Spring.Core.TypeResolution;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Core/TypeMismatchException.cs b/src/Spring/Spring.Core/Core/TypeMismatchException.cs
index 7447d0499..8e2fbea61 100644
--- a/src/Spring/Spring.Core/Core/TypeMismatchException.cs
+++ b/src/Spring/Spring.Core/Core/TypeMismatchException.cs
@@ -23,7 +23,6 @@
using System;
using System.Runtime.Serialization;
using System.Text;
-using Spring.Core;
#endregion
diff --git a/src/Spring/Spring.Core/Core/TypeResolution/TypeResolver.cs b/src/Spring/Spring.Core/Core/TypeResolution/TypeResolver.cs
index 4e95b8feb..4581b94a6 100644
--- a/src/Spring/Spring.Core/Core/TypeResolution/TypeResolver.cs
+++ b/src/Spring/Spring.Core/Core/TypeResolution/TypeResolver.cs
@@ -21,10 +21,8 @@
#region Imports
using System;
-using System.Collections;
using System.Reflection;
-using Spring.Core;
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/DataBinding/AbstractBinding.cs b/src/Spring/Spring.Core/DataBinding/AbstractBinding.cs
index 896b81a93..64fbbceca 100644
--- a/src/Spring/Spring.Core/DataBinding/AbstractBinding.cs
+++ b/src/Spring/Spring.Core/DataBinding/AbstractBinding.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using Spring.Collections;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/DataBinding/AbstractSimpleBinding.cs b/src/Spring/Spring.Core/DataBinding/AbstractSimpleBinding.cs
index a45dd4eb4..887dd3941 100644
--- a/src/Spring/Spring.Core/DataBinding/AbstractSimpleBinding.cs
+++ b/src/Spring/Spring.Core/DataBinding/AbstractSimpleBinding.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using Common.Logging;
diff --git a/src/Spring/Spring.Core/DataBinding/BaseBindingContainer.cs b/src/Spring/Spring.Core/DataBinding/BaseBindingContainer.cs
index 7ee1b14b1..1f118b58b 100644
--- a/src/Spring/Spring.Core/DataBinding/BaseBindingContainer.cs
+++ b/src/Spring/Spring.Core/DataBinding/BaseBindingContainer.cs
@@ -1,4 +1,3 @@
-using System.Collections;
using System.Collections.Generic;
using Spring.Globalization;
using Spring.Validation;
diff --git a/src/Spring/Spring.Core/DataBinding/BaseBindingManager.cs b/src/Spring/Spring.Core/DataBinding/BaseBindingManager.cs
index bceff2871..146f54b1e 100644
--- a/src/Spring/Spring.Core/DataBinding/BaseBindingManager.cs
+++ b/src/Spring/Spring.Core/DataBinding/BaseBindingManager.cs
@@ -18,11 +18,6 @@
#endregion
-using System.Collections;
-
-using Spring.Globalization;
-using Spring.Validation;
-
namespace Spring.DataBinding
{
///
diff --git a/src/Spring/Spring.Core/DataBinding/IBinding.cs b/src/Spring/Spring.Core/DataBinding/IBinding.cs
index 2e310fb30..964445aa0 100644
--- a/src/Spring/Spring.Core/DataBinding/IBinding.cs
+++ b/src/Spring/Spring.Core/DataBinding/IBinding.cs
@@ -1,4 +1,3 @@
-using System.Collections;
using System.Collections.Generic;
using Spring.Validation;
diff --git a/src/Spring/Spring.Core/DataBinding/SimpleExpressionBinding.cs b/src/Spring/Spring.Core/DataBinding/SimpleExpressionBinding.cs
index af507f861..d2bc8fd48 100644
--- a/src/Spring/Spring.Core/DataBinding/SimpleExpressionBinding.cs
+++ b/src/Spring/Spring.Core/DataBinding/SimpleExpressionBinding.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
using Spring.Globalization;
diff --git a/src/Spring/Spring.Core/Expressions/AttributeNode.cs b/src/Spring/Spring.Core/Expressions/AttributeNode.cs
index 194b0ae45..639b6f4c2 100644
--- a/src/Spring/Spring.Core/Expressions/AttributeNode.cs
+++ b/src/Spring/Spring.Core/Expressions/AttributeNode.cs
@@ -22,7 +22,6 @@
using System.Runtime.Serialization;
using Spring.Core.TypeResolution;
-using Spring.Util;
namespace Spring.Expressions
{
diff --git a/src/Spring/Spring.Core/Expressions/ExpressionConverter.cs b/src/Spring/Spring.Core/Expressions/ExpressionConverter.cs
index e5a83ef9b..310ab78c1 100644
--- a/src/Spring/Spring.Core/Expressions/ExpressionConverter.cs
+++ b/src/Spring/Spring.Core/Expressions/ExpressionConverter.cs
@@ -24,8 +24,6 @@
using System.ComponentModel;
using System.Globalization;
-using Spring.Expressions;
-
#endregion
namespace Spring.Expressions
diff --git a/src/Spring/Spring.Core/Expressions/FunctionNode.cs b/src/Spring/Spring.Core/Expressions/FunctionNode.cs
index b3fe8c194..2dbc48fdc 100644
--- a/src/Spring/Spring.Core/Expressions/FunctionNode.cs
+++ b/src/Spring/Spring.Core/Expressions/FunctionNode.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Runtime.Serialization;
using Spring.Reflection.Dynamic;
diff --git a/src/Spring/Spring.Core/Expressions/IExpression.cs b/src/Spring/Spring.Core/Expressions/IExpression.cs
index 346baadae..3444048c6 100644
--- a/src/Spring/Spring.Core/Expressions/IExpression.cs
+++ b/src/Spring/Spring.Core/Expressions/IExpression.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
diff --git a/src/Spring/Spring.Core/Expressions/OpDIVIDE.cs b/src/Spring/Spring.Core/Expressions/OpDIVIDE.cs
index 24b8c148d..5cd6a32e2 100644
--- a/src/Spring/Spring.Core/Expressions/OpDIVIDE.cs
+++ b/src/Spring/Spring.Core/Expressions/OpDIVIDE.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Runtime.Serialization;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Expressions/OpLessOrEqual.cs b/src/Spring/Spring.Core/Expressions/OpLessOrEqual.cs
index 3b6f25c48..f922cf668 100644
--- a/src/Spring/Spring.Core/Expressions/OpLessOrEqual.cs
+++ b/src/Spring/Spring.Core/Expressions/OpLessOrEqual.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Runtime.Serialization;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTFactory.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTFactory.cs
index 6769bdba6..0e966372b 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTFactory.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTFactory.cs
@@ -1,13 +1,10 @@
using System;
using System.Collections;
-using Spring.Expressions.Parser.antlr.collections;
-using Spring.Expressions.Parser.antlr.collections.impl;
+
using Assembly = System.Reflection.Assembly;
-using ArrayList = System.Collections.ArrayList;
using Debug = System.Diagnostics.Debug;
using AST = Spring.Expressions.Parser.antlr.collections.AST;
using ASTArray = Spring.Expressions.Parser.antlr.collections.impl.ASTArray;
-using ANTLRException = Spring.Expressions.Parser.antlr.ANTLRException;
namespace Spring.Expressions.Parser.antlr
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNULLType.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNULLType.cs
index 69d459e67..0dd800ca6 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNULLType.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNULLType.cs
@@ -1,9 +1,6 @@
-using System;
-using Spring.Expressions.Parser.antlr.collections;
using IEnumerator = System.Collections.IEnumerator;
using AST = Spring.Expressions.Parser.antlr.collections.AST;
-using Token = Spring.Expressions.Parser.antlr.Token;
namespace Spring.Expressions.Parser.antlr
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNodeCreator.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNodeCreator.cs
index ba5b9913c..56d1a3f80 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNodeCreator.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTNodeCreator.cs
@@ -1,7 +1,6 @@
namespace Spring.Expressions.Parser.antlr
{
- using System;
- using AST = antlr.collections.AST;
+ using AST = antlr.collections.AST;
/*ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTPair.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTPair.cs
index 6387509c0..850fd5086 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTPair.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTPair.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr
{
- using System;
- using Queue = System.Collections.Queue;
- using AST = antlr.collections.AST;
+ using AST = antlr.collections.AST;
/*ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTVisitor.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTVisitor.cs
index 3f9b7f52f..a9fb32e24 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTVisitor.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ASTVisitor.cs
@@ -1,5 +1,3 @@
-using System;
-using Spring.Expressions.Parser.antlr.collections;
using AST = Spring.Expressions.Parser.antlr.collections.AST;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/BaseAST.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/BaseAST.cs
index 34cf55ab4..c74eaca20 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/BaseAST.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/BaseAST.cs
@@ -1,7 +1,6 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
+
using StringBuilder = System.Text.StringBuilder;
-using ISerializable = System.Runtime.Serialization.ISerializable;
using TextWriter = System.IO.TextWriter;
using ArrayList = System.Collections.ArrayList;
using IEnumerator = System.Collections.IEnumerator;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ByteBuffer.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ByteBuffer.cs
index 8292de122..3ce752ccb 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ByteBuffer.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ByteBuffer.cs
@@ -1,8 +1,6 @@
using System;
-using System.Runtime.InteropServices;
+
using Stream = System.IO.Stream;
-using BinaryReader = System.IO.BinaryReader;
-using IOException = System.IO.IOException;
namespace Spring.Expressions.Parser.antlr
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/CharBuffer.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/CharBuffer.cs
index 8466da188..29ecfda18 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/CharBuffer.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/CharBuffer.cs
@@ -1,5 +1,5 @@
using System;
-using System.Runtime.InteropServices;
+
using TextReader = System.IO.TextReader;
using IOException = System.IO.IOException;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/CharScanner.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/CharScanner.cs
index 7e0147079..90d5d3d77 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/CharScanner.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/CharScanner.cs
@@ -1,5 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections.impl;
+
using Spring.Expressions.Parser.antlr.debug;
using Stream = System.IO.Stream;
using TextReader = System.IO.TextReader;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonAST.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonAST.cs
index aa2b5fbb2..a50f00578 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonAST.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonAST.cs
@@ -1,5 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
+
using AST = Spring.Expressions.Parser.antlr.collections.AST;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonASTWithHiddenTokens.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonASTWithHiddenTokens.cs
index 27233bc90..c1b05148d 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonASTWithHiddenTokens.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonASTWithHiddenTokens.cs
@@ -1,5 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
+
using AST = Spring.Expressions.Parser.antlr.collections.AST;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonHiddenStreamToken.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonHiddenStreamToken.cs
index a84ed65ee..ba4760be1 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonHiddenStreamToken.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonHiddenStreamToken.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonToken.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonToken.cs
index 0e93d205c..c39492df5 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonToken.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/CommonToken.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/DefaultFileLineFormatter.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/DefaultFileLineFormatter.cs
index 88bc3e0d3..f4756ba31 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/DefaultFileLineFormatter.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/DefaultFileLineFormatter.cs
@@ -1,4 +1,3 @@
-using System;
using StringBuilder = System.Text.StringBuilder;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/DumpASTVisitor.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/DumpASTVisitor.cs
index 64c71b846..48cc0bdd4 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/DumpASTVisitor.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/DumpASTVisitor.cs
@@ -1,5 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
+
using AST = Spring.Expressions.Parser.antlr.collections.AST;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/FileLineFormatter.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/FileLineFormatter.cs
index e3441055b..194e75cbf 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/FileLineFormatter.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/FileLineFormatter.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/IHiddenStreamToken.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/IHiddenStreamToken.cs
index 8a3407602..8fa435d44 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/IHiddenStreamToken.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/IHiddenStreamToken.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/IToken.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/IToken.cs
index a11ce895a..06455610c 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/IToken.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/IToken.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/InputBuffer.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/InputBuffer.cs
index 16c8e32a5..b575cfb9c 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/InputBuffer.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/InputBuffer.cs
@@ -1,7 +1,6 @@
namespace Spring.Expressions.Parser.antlr
{
- using System;
- using ArrayList = System.Collections.ArrayList;
+ using ArrayList = System.Collections.ArrayList;
using StringBuilder = System.Text.StringBuilder;
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/LexerSharedInputState.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/LexerSharedInputState.cs
index 9ce05ed9c..c09dc3a94 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/LexerSharedInputState.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/LexerSharedInputState.cs
@@ -1,4 +1,3 @@
-using System;
using Stream = System.IO.Stream;
using TextReader = System.IO.TextReader;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedCharException.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedCharException.cs
index 705992d83..4ff189e60 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedCharException.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedCharException.cs
@@ -1,5 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections.impl;
+
using StringBuilder = System.Text.StringBuilder;
using BitSet = Spring.Expressions.Parser.antlr.collections.impl.BitSet;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedTokenException.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedTokenException.cs
index edec90474..5a94313cc 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedTokenException.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/MismatchedTokenException.cs
@@ -1,6 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
-using Spring.Expressions.Parser.antlr.collections.impl;
+
using StringBuilder = System.Text.StringBuilder;
using BitSet = Spring.Expressions.Parser.antlr.collections.impl.BitSet;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/NoViableAltException.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/NoViableAltException.cs
index 5e5e32fc9..483dc27a4 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/NoViableAltException.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/NoViableAltException.cs
@@ -1,5 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
+
using AST = Spring.Expressions.Parser.antlr.collections.AST;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTree.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTree.cs
index 0cf0fbcf0..c39f80c6b 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTree.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTree.cs
@@ -11,8 +11,7 @@ namespace Spring.Expressions.Parser.antlr
// Anthony Oguntimehin
//
- using System;
- using StringBuilder = System.Text.StringBuilder;
+ using StringBuilder = System.Text.StringBuilder;
using AST = antlr.collections.AST;
public abstract class ParseTree : BaseAST
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeRule.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeRule.cs
index 22ef96c2b..19d891923 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeRule.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeRule.cs
@@ -12,8 +12,7 @@ namespace Spring.Expressions.Parser.antlr
// Anthony Oguntimehin
//
- using System;
- using StringBuilder = System.Text.StringBuilder;
+ using StringBuilder = System.Text.StringBuilder;
using AST = antlr.collections.AST;
public class ParseTreeRule : ParseTree
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeToken.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeToken.cs
index 8a0a5ce4c..53d4e85b2 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeToken.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParseTreeToken.cs
@@ -12,11 +12,9 @@ namespace Spring.Expressions.Parser.antlr
// Anthony Oguntimehin
//
- using System;
- using StringBuilder = System.Text.StringBuilder;
- using AST = antlr.collections.AST;
+ using StringBuilder = System.Text.StringBuilder;
- public class ParseTreeToken : ParseTree
+ public class ParseTreeToken : ParseTree
{
protected IToken token;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/Parser.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/Parser.cs
index 32df75f65..2c600e59a 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/Parser.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/Parser.cs
@@ -1,12 +1,10 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
-using Spring.Expressions.Parser.antlr.collections.impl;
-using Spring.Expressions.Parser.antlr.debug;
+
+using Spring.Expressions.Parser.antlr.debug;
using EventHandlerList = System.ComponentModel.EventHandlerList;
using BitSet = Spring.Expressions.Parser.antlr.collections.impl.BitSet;
using AST = Spring.Expressions.Parser.antlr.collections.AST;
-using ASTArray = Spring.Expressions.Parser.antlr.collections.impl.ASTArray;
using MessageListener = Spring.Expressions.Parser.antlr.debug.MessageListener;
using ParserListener = Spring.Expressions.Parser.antlr.debug.ParserListener;
using ParserMatchListener = Spring.Expressions.Parser.antlr.debug.ParserMatchListener;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParserSharedInputState.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParserSharedInputState.cs
index 0072889bd..0ee542ed7 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/ParserSharedInputState.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/ParserSharedInputState.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/StringUtils.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/StringUtils.cs
index 4474214d3..788393ccd 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/StringUtils.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/StringUtils.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/* ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/SupportClass.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/SupportClass.cs
index 615dfb153..0a82a4da9 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/SupportClass.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/SupportClass.cs
@@ -1,4 +1,3 @@
-using System;
namespace Spring.Expressions.Parser.antlr
{
internal class SupportClass
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/Token.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/Token.cs
index a5ede79b7..75b1bd956 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/Token.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/Token.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenBuffer.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenBuffer.cs
index eb6130d24..d40d56f60 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenBuffer.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenBuffer.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenCreator.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenCreator.cs
index 005b5d1ef..22059a641 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenCreator.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenCreator.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr
{
- using System;
-
- /*ANTLR Translator Generator
+ /*ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
* Software rights: http://www.antlr.org/license.html
*
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenQueue.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenQueue.cs
index 442fb828d..181548966 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenQueue.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenQueue.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStream.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStream.cs
index bd164fd37..748ea326a 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStream.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStream.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamBasicFilter.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamBasicFilter.cs
index 10ecfb1b7..664463aef 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamBasicFilter.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamBasicFilter.cs
@@ -1,5 +1,3 @@
-using System;
-using Spring.Expressions.Parser.antlr.collections.impl;
using BitSet = Spring.Expressions.Parser.antlr.collections.impl.BitSet;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamHiddenTokenFilter.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamHiddenTokenFilter.cs
index 8e6403c6e..03f7f0cf5 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamHiddenTokenFilter.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamHiddenTokenFilter.cs
@@ -1,5 +1,3 @@
-using System;
-using Spring.Expressions.Parser.antlr.collections.impl;
using BitSet = Spring.Expressions.Parser.antlr.collections.impl.BitSet;
namespace Spring.Expressions.Parser.antlr
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamRewriteEngine.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamRewriteEngine.cs
index e460ef853..2518cc281 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamRewriteEngine.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamRewriteEngine.cs
@@ -11,8 +11,7 @@ namespace Spring.Expressions.Parser.antlr
// Anthony Oguntimehin
//
- using System;
- using IList = System.Collections.IList;
+ using IList = System.Collections.IList;
using IDictionary = System.Collections.IDictionary;
using ArrayList = System.Collections.ArrayList;
using Hashtable = System.Collections.Hashtable;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamSelector.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamSelector.cs
index 89f757002..c09e9bf84 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamSelector.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenStreamSelector.cs
@@ -1,4 +1,3 @@
-using System;
using Hashtable = System.Collections.Hashtable;
using Stack = System.Collections.Stack;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenWithIndex.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenWithIndex.cs
index c93808a5b..4989dcc26 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenWithIndex.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TokenWithIndex.cs
@@ -11,9 +11,7 @@ namespace Spring.Expressions.Parser.antlr
// Anthony Oguntimehin
//
- using System;
-
- ///
+ ///
/// This token tracks it's own index 0..n-1 relative to the beginning
/// of the stream. It is designed to work with
/// in TokenStreamRewriteEngine.cs
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParser.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParser.cs
index 45b1a39ed..0a4f30cdf 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParser.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParser.cs
@@ -1,6 +1,5 @@
using System;
-using Spring.Expressions.Parser.antlr.collections;
-using Spring.Expressions.Parser.antlr.collections.impl;
+
using AST = Spring.Expressions.Parser.antlr.collections.AST;
using BitSet = Spring.Expressions.Parser.antlr.collections.impl.BitSet;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParserSharedInputState.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParserSharedInputState.cs
index cc77798c5..13e935097 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParserSharedInputState.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/TreeParserSharedInputState.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Expressions.Parser.antlr
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/AST.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/AST.cs
index 7ceae5ac4..fd3593923 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/AST.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/AST.cs
@@ -1,8 +1,6 @@
using System;
using IEnumerator = System.Collections.IEnumerator;
-using IToken = Spring.Expressions.Parser.antlr.IToken;
-
namespace Spring.Expressions.Parser.antlr.collections
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/impl/ASTArray.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/impl/ASTArray.cs
index 0d501bc08..675ce60af 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/impl/ASTArray.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/collections/impl/ASTArray.cs
@@ -1,6 +1,3 @@
-using System;
-using AST = Spring.Expressions.Parser.antlr.collections.AST;
-
namespace Spring.Expressions.Parser.antlr.collections.impl
{
/*ANTLR Translator Generator
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingInputBuffer.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingInputBuffer.cs
index 800f1c8d7..39b1babc6 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingInputBuffer.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingInputBuffer.cs
@@ -1,7 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
- using ArrayList = System.Collections.ArrayList;
+ using ArrayList = System.Collections.ArrayList;
public class DebuggingInputBuffer : InputBuffer
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingParser.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingParser.cs
index 1147b6bb5..f14ee0d2b 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingParser.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/DebuggingParser.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- /// This type was created in VisualAge.
+ /// This type was created in VisualAge.
///
public interface DebuggingParser
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/GuessingEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/GuessingEventArgs.cs
index b1df09bd6..90b331133 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/GuessingEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/GuessingEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public abstract class GuessingEventArgs : ANTLREventArgs
+ public abstract class GuessingEventArgs : ANTLREventArgs
{
public GuessingEventArgs()
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ICharScannerDebugSubject.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ICharScannerDebugSubject.cs
index 3a711cd34..c57887fd1 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ICharScannerDebugSubject.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ICharScannerDebugSubject.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface ICharScannerDebugSubject : IDebugSubject
+ public interface ICharScannerDebugSubject : IDebugSubject
{
event NewLineEventHandler HitNewLine;
event MatchEventHandler MatchedChar;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IDebugSubject.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IDebugSubject.cs
index fc9d93b9d..5435314c6 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IDebugSubject.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IDebugSubject.cs
@@ -1,7 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
- //using EventHandlerList = System.ComponentModel.EventHandlerList;
+ //using EventHandlerList = System.ComponentModel.EventHandlerList;
public interface IDebugSubject
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IParserDebugSubject.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IParserDebugSubject.cs
index 2fa4555b6..e8b35ba06 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IParserDebugSubject.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/IParserDebugSubject.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface IParserDebugSubject : IDebugSubject
+ public interface IParserDebugSubject : IDebugSubject
{
event MatchEventHandler MatchedToken;
event MatchEventHandler MatchedNotToken;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventArgs.cs
index c6aef6f95..98a8c3b67 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class InputBufferEventArgs : ANTLREventArgs
+ public class InputBufferEventArgs : ANTLREventArgs
{
public InputBufferEventArgs()
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventSupport.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventSupport.cs
index 6d33c685e..d09913893 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventSupport.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferEventSupport.cs
@@ -1,7 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
- using ArrayList = System.Collections.ArrayList;
+ using ArrayList = System.Collections.ArrayList;
public class InputBufferEventSupport
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListener.cs
index baa7b2c9a..a08d1791b 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface InputBufferListener : Listener
+ public interface InputBufferListener : Listener
{
void inputBufferConsume (object source, InputBufferEventArgs e);
void inputBufferLA (object source, InputBufferEventArgs e);
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListenerBase.cs
index fcaa02b67..e63dc2f3a 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferReporter.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferReporter.cs
index 7a7094a48..f2dc6d335 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferReporter.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/InputBufferReporter.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class InputBufferReporter : InputBufferListenerBase, InputBufferListener
+ public class InputBufferReporter : InputBufferListenerBase, InputBufferListener
{
public virtual void inputBufferChanged(object source, InputBufferEventArgs e)
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/LLkDebuggingParser.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/LLkDebuggingParser.cs
index 0789e111c..04a59dfe7 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/LLkDebuggingParser.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/LLkDebuggingParser.cs
@@ -1,7 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
- using System.Threading;
+ using System.Threading;
using antlr.collections.impl;
public class LLkDebuggingParser : LLkParser, DebuggingParser
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Listener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Listener.cs
index 9b283af25..77dfb8fe9 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Listener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Listener.cs
@@ -1,9 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
-
- public interface Listener
+ public interface Listener
{
void doneParsing (object source, TraceEventArgs e);
void refresh ();
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageEventArgs.cs
index 1ca1603f9..114141e68 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class MessageEventArgs : ANTLREventArgs
+ public class MessageEventArgs : ANTLREventArgs
{
public MessageEventArgs()
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListener.cs
index f53c82275..59d86d687 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface MessageListener : Listener
+ public interface MessageListener : Listener
{
void reportError (object source, MessageEventArgs e);
void reportWarning (object source, MessageEventArgs e);
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListenerBase.cs
index c8d5c7e8a..84136adfa 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/MessageListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineEventArgs.cs
index 953ea5d7c..e9776f6b9 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class NewLineEventArgs : ANTLREventArgs
+ public class NewLineEventArgs : ANTLREventArgs
{
public NewLineEventArgs()
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineListener.cs
index 7b38b37bb..87a2612ea 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/NewLineListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface NewLineListener : Listener
+ public interface NewLineListener : Listener
{
void hitNewLine(object source, NewLineEventArgs e);
}
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParseTreeDebugParser.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParseTreeDebugParser.cs
index 5a6d27b8a..412c8ff44 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParseTreeDebugParser.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParseTreeDebugParser.cs
@@ -12,8 +12,7 @@ namespace Spring.Expressions.Parser.antlr.debug
// Anthony Oguntimehin
//
- using System;
- using Stack = System.Collections.Stack;
+ using Stack = System.Collections.Stack;
using antlr;
using BitSet = antlr.collections.impl.BitSet;
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserController.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserController.cs
index 8519b8dcf..77808fd5c 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserController.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserController.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface ParserController : ParserListener
+ public interface ParserController : ParserListener
{
ParserEventSupport ParserEventSupport
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserEventSupport.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserEventSupport.cs
index ab136bd74..d5baf1c2a 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserEventSupport.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserEventSupport.cs
@@ -1,12 +1,9 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
- using System.Reflection;
- using Hashtable = System.Collections.Hashtable;
+ using Hashtable = System.Collections.Hashtable;
using DictionaryEntry = System.Collections.DictionaryEntry;
- using ArrayList = System.Collections.ArrayList;
- using antlr.collections.impl;
+ using antlr.collections.impl;
public delegate void MessageEventHandler(object sender, MessageEventArgs e);
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListener.cs
index 395cf345d..b383cba35 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface ParserListener : SemanticPredicateListener, ParserMatchListener, MessageListener, ParserTokenListener, TraceListener, SyntacticPredicateListener
+ public interface ParserListener : SemanticPredicateListener, ParserMatchListener, MessageListener, ParserTokenListener, TraceListener, SyntacticPredicateListener
{
}
}
\ No newline at end of file
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListenerBase.cs
index da934915b..4d7f13945 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchEventArgs.cs
index f86fccccb..98be76930 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class MatchEventArgs : GuessingEventArgs
+ public class MatchEventArgs : GuessingEventArgs
{
public MatchEventArgs()
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListener.cs
index 830f29a46..b2eb584d0 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface ParserMatchListener : Listener
+ public interface ParserMatchListener : Listener
{
void parserMatch (object source, MatchEventArgs e);
void parserMatchNot (object source, MatchEventArgs e);
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListenerBase.cs
index 48e7ccc66..4fe44f7ef 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserMatchListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserReporter.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserReporter.cs
index 9b2be158d..3ded8d03e 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserReporter.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserReporter.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class ParserReporter : Tracer, ParserListener
+ public class ParserReporter : Tracer, ParserListener
{
public virtual void parserConsume(object source, TokenEventArgs e)
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenEventArgs.cs
index 09c7d0dc5..178ddedab 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class TokenEventArgs : ANTLREventArgs
+ public class TokenEventArgs : ANTLREventArgs
{
public TokenEventArgs()
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListener.cs
index fe28f7149..9c0bcd18b 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface ParserTokenListener : Listener
+ public interface ParserTokenListener : Listener
{
void parserConsume (object source, TokenEventArgs e);
void parserLA (object source, TokenEventArgs e);
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListenerBase.cs
index e7abe48c0..bedc4e58e 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ParserTokenListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ScannerEventSupport.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ScannerEventSupport.cs
index c8e3b60de..da8cc0a28 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ScannerEventSupport.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/ScannerEventSupport.cs
@@ -1,11 +1,8 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
- using System.Reflection;
- using Hashtable = System.Collections.Hashtable;
- using ArrayList = System.Collections.ArrayList;
+ using Hashtable = System.Collections.Hashtable;
- using antlr.collections.impl;
+ using antlr.collections.impl;
/// A class to assist in firing parser events
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateEventArgs.cs
index 8b835f557..bdc838e14 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class SemanticPredicateEventArgs : GuessingEventArgs
+ public class SemanticPredicateEventArgs : GuessingEventArgs
{
public SemanticPredicateEventArgs()
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListener.cs
index dacbdf04b..2d399ed32 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface SemanticPredicateListener : Listener
+ public interface SemanticPredicateListener : Listener
{
void semanticPredicateEvaluated(object source, SemanticPredicateEventArgs e);
}
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListenerBase.cs
index dd13a0ad2..573cd07ad 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SemanticPredicateListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateEventArgs.cs
index cae3e0afd..979b1b525 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateEventArgs.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class SyntacticPredicateEventArgs : GuessingEventArgs
+ public class SyntacticPredicateEventArgs : GuessingEventArgs
{
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListener.cs
index 8db60bac0..60865b87c 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface SyntacticPredicateListener : Listener
+ public interface SyntacticPredicateListener : Listener
{
void syntacticPredicateFailed (object source, SyntacticPredicateEventArgs e);
void syntacticPredicateStarted (object source, SyntacticPredicateEventArgs e);
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListenerBase.cs
index ae5659df4..b93f17f4d 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/SyntacticPredicateListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceEventArgs.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceEventArgs.cs
index 10aaa0988..11a30dda2 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceEventArgs.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceEventArgs.cs
@@ -1,7 +1,5 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
public class TraceEventArgs : GuessingEventArgs
{
public TraceEventArgs()
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListener.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListener.cs
index 48237ca30..ec22023b5 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListener.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListener.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public interface TraceListener : Listener
+ public interface TraceListener : Listener
{
void enterRule (object source, TraceEventArgs e);
void exitRule (object source, TraceEventArgs e);
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListenerBase.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListenerBase.cs
index 8a658db94..81ac7edfd 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListenerBase.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/TraceListenerBase.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- ///
+ ///
/// Provides an abstract base for implementing subclasses.
///
///
diff --git a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Tracer.cs b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Tracer.cs
index 3f4edd5e2..c889512d6 100644
--- a/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Tracer.cs
+++ b/src/Spring/Spring.Core/Expressions/Parser/antlr/debug/Tracer.cs
@@ -1,8 +1,6 @@
namespace Spring.Expressions.Parser.antlr.debug
{
- using System;
-
- public class Tracer : TraceListenerBase, TraceListener
+ public class Tracer : TraceListenerBase, TraceListener
{
protected string indentString = "";
// TBD: should be StringBuffer
diff --git a/src/Spring/Spring.Core/Expressions/Processors/IMethodCallProcessor.cs b/src/Spring/Spring.Core/Expressions/Processors/IMethodCallProcessor.cs
index a7dbdbe25..f615921af 100644
--- a/src/Spring/Spring.Core/Expressions/Processors/IMethodCallProcessor.cs
+++ b/src/Spring/Spring.Core/Expressions/Processors/IMethodCallProcessor.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Expressions.Processors
{
///
diff --git a/src/Spring/Spring.Core/Expressions/Processors/ReverseProcessor.cs b/src/Spring/Spring.Core/Expressions/Processors/ReverseProcessor.cs
index 6cd5113ab..95a7f9e5a 100644
--- a/src/Spring/Spring.Core/Expressions/Processors/ReverseProcessor.cs
+++ b/src/Spring/Spring.Core/Expressions/Processors/ReverseProcessor.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
#endregion
diff --git a/src/Spring/Spring.Core/Globalization/AbstractLocalizer.cs b/src/Spring/Spring.Core/Globalization/AbstractLocalizer.cs
index 68e83dff0..75b27c9b7 100644
--- a/src/Spring/Spring.Core/Globalization/AbstractLocalizer.cs
+++ b/src/Spring/Spring.Core/Globalization/AbstractLocalizer.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
diff --git a/src/Spring/Spring.Core/Globalization/AbstractResourceCache.cs b/src/Spring/Spring.Core/Globalization/AbstractResourceCache.cs
index d448ee4c2..7ed111ef9 100644
--- a/src/Spring/Spring.Core/Globalization/AbstractResourceCache.cs
+++ b/src/Spring/Spring.Core/Globalization/AbstractResourceCache.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Globalization;
diff --git a/src/Spring/Spring.Core/Globalization/Formatters/BooleanFormatter.cs b/src/Spring/Spring.Core/Globalization/Formatters/BooleanFormatter.cs
index 6639239db..dc629d435 100644
--- a/src/Spring/Spring.Core/Globalization/Formatters/BooleanFormatter.cs
+++ b/src/Spring/Spring.Core/Globalization/Formatters/BooleanFormatter.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Globalization;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Globalization/Formatters/FilteringFormatter.cs b/src/Spring/Spring.Core/Globalization/Formatters/FilteringFormatter.cs
index 436531aac..d42a6a581 100644
--- a/src/Spring/Spring.Core/Globalization/Formatters/FilteringFormatter.cs
+++ b/src/Spring/Spring.Core/Globalization/Formatters/FilteringFormatter.cs
@@ -20,7 +20,7 @@
#region Imports
-using Spring.Util;
+
#endregion
diff --git a/src/Spring/Spring.Core/Globalization/IResourceCache.cs b/src/Spring/Spring.Core/Globalization/IResourceCache.cs
index 07bbe70a8..25ae867f2 100644
--- a/src/Spring/Spring.Core/Globalization/IResourceCache.cs
+++ b/src/Spring/Spring.Core/Globalization/IResourceCache.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Globalization;
diff --git a/src/Spring/Spring.Core/Globalization/NullResourceCache.cs b/src/Spring/Spring.Core/Globalization/NullResourceCache.cs
index 505646c8a..e2daeff44 100644
--- a/src/Spring/Spring.Core/Globalization/NullResourceCache.cs
+++ b/src/Spring/Spring.Core/Globalization/NullResourceCache.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
namespace Spring.Globalization
diff --git a/src/Spring/Spring.Core/Objects/Events/IEventRegistryAware.cs b/src/Spring/Spring.Core/Objects/Events/IEventRegistryAware.cs
index 04377df8f..827509a15 100644
--- a/src/Spring/Spring.Core/Objects/Events/IEventRegistryAware.cs
+++ b/src/Spring/Spring.Core/Objects/Events/IEventRegistryAware.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Events/Support/EventManipulationUtils.cs b/src/Spring/Spring.Core/Objects/Events/Support/EventManipulationUtils.cs
index fb4a096e4..81347972b 100644
--- a/src/Spring/Spring.Core/Objects/Events/Support/EventManipulationUtils.cs
+++ b/src/Spring/Spring.Core/Objects/Events/Support/EventManipulationUtils.cs
@@ -23,7 +23,6 @@
using System;
using System.Reflection;
using Spring.Core;
-using Spring.Objects.Support;
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Events/Support/EventRegistry.cs b/src/Spring/Spring.Core/Objects/Events/Support/EventRegistry.cs
index ff410cc1e..02720f235 100644
--- a/src/Spring/Spring.Core/Objects/Events/Support/EventRegistry.cs
+++ b/src/Spring/Spring.Core/Objects/Events/Support/EventRegistry.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Reflection;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Attributes/InjectionMetadata.cs b/src/Spring/Spring.Core/Objects/Factory/Attributes/InjectionMetadata.cs
index b0f94b7e9..92157881f 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Attributes/InjectionMetadata.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Attributes/InjectionMetadata.cs
@@ -22,7 +22,7 @@
using System.Collections.Generic;
using System.Reflection;
using Common.Logging;
-using Spring.Objects;
+
using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Attributes
diff --git a/src/Spring/Spring.Core/Objects/Factory/Attributes/QualifierAttribute.cs b/src/Spring/Spring.Core/Objects/Factory/Attributes/QualifierAttribute.cs
index 3fdb1ffbc..4b8453de0 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Attributes/QualifierAttribute.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Attributes/QualifierAttribute.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace Spring.Objects.Factory.Attributes
{
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurableVariableSource.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurableVariableSource.cs
index ef6e34e8d..67cf129dd 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurableVariableSource.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurableVariableSource.cs
@@ -19,12 +19,8 @@
#endregion
using System;
-using System.Globalization;
-using System.Collections;
using System.Collections.Specialized;
-using Spring.Util;
-
namespace Spring.Objects.Factory.Config
{
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurationReader.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurationReader.cs
index f7756199f..1dadff8f7 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurationReader.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ConfigurationReader.cs
@@ -29,7 +29,7 @@
using System.Xml;
using Common.Logging;
-using Spring.Core;
+
using Spring.Core.IO;
using Spring.Core.TypeResolution;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/CustomConverterConfigurer.cs b/src/Spring/Spring.Core/Objects/Factory/Config/CustomConverterConfigurer.cs
index 355d60753..81b31dce5 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/CustomConverterConfigurer.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/CustomConverterConfigurer.cs
@@ -23,8 +23,6 @@
using System;
using System.Collections;
using System.ComponentModel;
-using System.Globalization;
-using Spring.Core;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/DependencyDescriptor.cs b/src/Spring/Spring.Core/Objects/Factory/Config/DependencyDescriptor.cs
index f891798ab..305432eac 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/DependencyDescriptor.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/DependencyDescriptor.cs
@@ -21,7 +21,6 @@
using System;
using Spring.Core;
using System.Reflection;
-using Spring.Objects.Factory.Attributes;
namespace Spring.Objects.Factory.Config
{
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/DictionaryFactoryObject.cs b/src/Spring/Spring.Core/Objects/Factory/Config/DictionaryFactoryObject.cs
index 432c0892d..94bbe6953 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/DictionaryFactoryObject.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/DictionaryFactoryObject.cs
@@ -21,7 +21,7 @@
using System;
using System.Collections;
using System.Globalization;
-using Spring.Core;
+
using Spring.Util;
namespace Spring.Objects.Factory.Config
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/FieldRetrievingFactoryObject.cs b/src/Spring/Spring.Core/Objects/Factory/Config/FieldRetrievingFactoryObject.cs
index 282484e1e..9e40f554e 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/FieldRetrievingFactoryObject.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/FieldRetrievingFactoryObject.cs
@@ -25,7 +25,6 @@
using System.Reflection;
using System.Text;
-using Spring.Core;
using Spring.Core.TypeResolution;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/IConfigurableFactoryObject.cs b/src/Spring/Spring.Core/Objects/Factory/Config/IConfigurableFactoryObject.cs
index 464fa43da..e5e35f821 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/IConfigurableFactoryObject.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/IConfigurableFactoryObject.cs
@@ -20,7 +20,7 @@
#region Imports
-using Spring.Objects.Factory;
+
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ICustomValueReferenceHolder.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ICustomValueReferenceHolder.cs
index 6492e1428..f113e444e 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ICustomValueReferenceHolder.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ICustomValueReferenceHolder.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Objects.Factory.Config
{
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/IManagedCollection.cs b/src/Spring/Spring.Core/Objects/Factory/Config/IManagedCollection.cs
index c9f39fbf8..1dfc60df0 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/IManagedCollection.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/IManagedCollection.cs
@@ -20,9 +20,7 @@
#region Imports
-using System;
using System.Collections;
-using Spring.Objects.Factory.Config;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/IObjectPostProcessor.cs b/src/Spring/Spring.Core/Objects/Factory/Config/IObjectPostProcessor.cs
index 2893a61a1..c0a651d70 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/IObjectPostProcessor.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/IObjectPostProcessor.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Objects.Factory.Config
{
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ListFactoryObject.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ListFactoryObject.cs
index db56a9d4e..2aa2a0a26 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ListFactoryObject.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ListFactoryObject.cs
@@ -23,7 +23,7 @@
using System;
using System.Collections;
using System.Globalization;
-using Spring.Core;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ObjectRole.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ObjectRole.cs
index b8657932f..e86f7bf45 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ObjectRole.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ObjectRole.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Objects.Factory.Config
{
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/SetFactoryObject.cs b/src/Spring/Spring.Core/Objects/Factory/Config/SetFactoryObject.cs
index 4fdf9e744..a3480203a 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/SetFactoryObject.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/SetFactoryObject.cs
@@ -23,7 +23,6 @@
using System;
using System.Globalization;
using Spring.Collections;
-using Spring.Core;
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/SharedStateAwareProcessor.cs b/src/Spring/Spring.Core/Objects/Factory/Config/SharedStateAwareProcessor.cs
index 446828d79..94f4971d4 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/SharedStateAwareProcessor.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/SharedStateAwareProcessor.cs
@@ -22,9 +22,7 @@
using System;
using System.Collections;
-using System.Configuration;
-using System.Text;
-using System.Threading;
+
using Common.Logging;
using Spring.Core;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/VariableAccessor.cs b/src/Spring/Spring.Core/Objects/Factory/Config/VariableAccessor.cs
index 24425756e..93cdbbd8f 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/VariableAccessor.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/VariableAccessor.cs
@@ -22,7 +22,7 @@
using System;
using System.Globalization;
-using Spring.Objects.Factory.Config;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/IHierarchicalObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/IHierarchicalObjectFactory.cs
index 6c928d016..409c82b0b 100644
--- a/src/Spring/Spring.Core/Objects/Factory/IHierarchicalObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/IHierarchicalObjectFactory.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs
index 986500960..67c5fbedd 100644
--- a/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/IObjectFactoryAware.cs b/src/Spring/Spring.Core/Objects/Factory/IObjectFactoryAware.cs
index 398b7df77..80f7c1309 100644
--- a/src/Spring/Spring.Core/Objects/Factory/IObjectFactoryAware.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/IObjectFactoryAware.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/ObjectDefinitionException.cs b/src/Spring/Spring.Core/Objects/Factory/ObjectDefinitionException.cs
index 3da58c2bf..78de64e24 100644
--- a/src/Spring/Spring.Core/Objects/Factory/ObjectDefinitionException.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/ObjectDefinitionException.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Globalization;
using System.Runtime.Serialization;
using System.Security.Permissions;
using Spring.Objects.Factory.Xml;
diff --git a/src/Spring/Spring.Core/Objects/Factory/ObjectNotOfRequiredTypeException.cs b/src/Spring/Spring.Core/Objects/Factory/ObjectNotOfRequiredTypeException.cs
index 342f07da6..b56c32b80 100644
--- a/src/Spring/Spring.Core/Objects/Factory/ObjectNotOfRequiredTypeException.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/ObjectNotOfRequiredTypeException.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Globalization;
using System.Runtime.Serialization;
using System.Security.Permissions;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractMethodReplacer.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractMethodReplacer.cs
index eb11e18e0..a71c6fe9c 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractMethodReplacer.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractMethodReplacer.cs
@@ -22,7 +22,7 @@
using System;
using System.Reflection;
-using Spring.Objects.Factory.Config;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs
index 2ce78874c..1644714e5 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs
@@ -24,7 +24,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
-using System.Linq;
using System.Reflection;
using System.Text;
using Spring.Core.TypeResolution;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AutowireCandidateQualifier.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AutowireCandidateQualifier.cs
index 790c9151c..842cec220 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/AutowireCandidateQualifier.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/AutowireCandidateQualifier.cs
@@ -19,10 +19,7 @@
#endregion
using System;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.Linq;
-using System.Text;
namespace Spring.Objects.Factory.Support
{
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs
index 27ee30073..84f1d9d5d 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs
@@ -25,7 +25,6 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
-using System.Linq;
using Common.Logging;
@@ -34,7 +33,6 @@
using Spring.Objects.Factory.Config;
using Spring.Util;
using Spring.Expressions;
-using Spring.Context.Support;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/DefaultObjectDefinitionFactory.cs b/src/Spring/Spring.Core/Objects/Factory/Support/DefaultObjectDefinitionFactory.cs
index c4512ce36..738896426 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/DefaultObjectDefinitionFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/DefaultObjectDefinitionFactory.cs
@@ -22,7 +22,6 @@
using System;
-using Spring.Core;
using Spring.Core.TypeResolution;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/DelegatingMethodReplacer.cs b/src/Spring/Spring.Core/Objects/Factory/Support/DelegatingMethodReplacer.cs
index cd1d7a08e..02eabf9c5 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/DelegatingMethodReplacer.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/DelegatingMethodReplacer.cs
@@ -22,7 +22,6 @@
using System;
using System.Reflection;
-using Spring.Objects.Factory.Config;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/IMethodReplacer.cs b/src/Spring/Spring.Core/Objects/Factory/Support/IMethodReplacer.cs
index 9f2c4eeb4..d43eb627d 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/IMethodReplacer.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/IMethodReplacer.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Reflection;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs b/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs
index e2eebc12b..cf36a6df3 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs
@@ -22,7 +22,6 @@
using System.Collections.Generic;
-using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistryPostProcessor.cs b/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistryPostProcessor.cs
index 60d5da782..42d3506c0 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistryPostProcessor.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistryPostProcessor.cs
@@ -18,8 +18,6 @@
#endregion
-
-using System;
using Spring.Objects.Factory.Config;
namespace Spring.Objects.Factory.Support
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/LookupMethodReplacer.cs b/src/Spring/Spring.Core/Objects/Factory/Support/LookupMethodReplacer.cs
index 48d8b75b6..be8f4d721 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/LookupMethodReplacer.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/LookupMethodReplacer.cs
@@ -20,9 +20,7 @@
#region Imports
-using System;
using System.Reflection;
-using Spring.Objects.Factory.Config;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/MethodInjectingInstantiationStrategy.cs b/src/Spring/Spring.Core/Objects/Factory/Support/MethodInjectingInstantiationStrategy.cs
index 3e19c2fa1..4cbd630d8 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/MethodInjectingInstantiationStrategy.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/MethodInjectingInstantiationStrategy.cs
@@ -25,11 +25,8 @@
using System.Globalization;
using System.Reflection;
using System.Reflection.Emit;
-using System.Text;
-using Spring.Collections;
-using Spring.Core;
+
using Spring.Util;
-using Spring.Reflection.Dynamic;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs
index 96b59a9f0..bbfa599a3 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs
@@ -20,7 +20,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using Spring.Objects.Factory.Config;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionValueResolver.cs b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionValueResolver.cs
index 114dc6d32..b8b517ef3 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionValueResolver.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionValueResolver.cs
@@ -21,7 +21,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Collections.Specialized;
using System.Globalization;
using System.Runtime.Remoting;
using Common.Logging;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/SimpleInstantiationStrategy.cs b/src/Spring/Spring.Core/Objects/Factory/Support/SimpleInstantiationStrategy.cs
index ad9bcddb2..2e5e87e9f 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/SimpleInstantiationStrategy.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/SimpleInstantiationStrategy.cs
@@ -25,7 +25,7 @@
using System.Reflection;
using Common.Logging;
-using Spring.Core;
+
using Spring.Core.TypeResolution;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Objects/Factory/UnsatisfiedDependencyException.cs b/src/Spring/Spring.Core/Objects/Factory/UnsatisfiedDependencyException.cs
index 246982de0..32ca5c615 100644
--- a/src/Spring/Spring.Core/Objects/Factory/UnsatisfiedDependencyException.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/UnsatisfiedDependencyException.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Globalization;
using System.Runtime.Serialization;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/AbstractObjectDefinitionParser.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/AbstractObjectDefinitionParser.cs
index a73fb8585..440ec8b61 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/AbstractObjectDefinitionParser.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/AbstractObjectDefinitionParser.cs
@@ -18,9 +18,8 @@
#endregion
-#region Imports
-
-using System;
+#region Imports
+
using System.Xml;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParser.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParser.cs
index 296e049ec..e0b6ef7b5 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParser.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParser.cs
@@ -22,7 +22,6 @@
using System.Xml;
using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParserResolver.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParserResolver.cs
index c743ae1d1..35c97f497 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParserResolver.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/INamespaceParserResolver.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Objects.Factory.Xml
{
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserAttribute.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserAttribute.cs
index 2345ad5e2..c041e9dda 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserAttribute.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserAttribute.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Reflection;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs
index bc1995761..b0e497a49 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserRegistry.cs
@@ -23,17 +23,12 @@
using System;
using System.Collections;
using System.Collections.Specialized;
-using System.Diagnostics;
-using System.Reflection;
using System.Xml;
using System.Xml.Schema;
using Spring.Collections;
-using Spring.Core;
using Spring.Core.IO;
-using Spring.Core.TypeResolution;
using Spring.Objects.Factory.Config;
using Spring.Util;
-using Spring.Validation;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/ParserContext.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/ParserContext.cs
index 338985ea9..900be5456 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/ParserContext.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/ParserContext.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-using System.Collections;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
diff --git a/src/Spring/Spring.Core/Objects/ISharedStateAware.cs b/src/Spring/Spring.Core/Objects/ISharedStateAware.cs
index 7a981f2b7..8759d5275 100644
--- a/src/Spring/Spring.Core/Objects/ISharedStateAware.cs
+++ b/src/Spring/Spring.Core/Objects/ISharedStateAware.cs
@@ -21,7 +21,6 @@
#region Imports
using System.Collections;
-using System.Web;
#endregion
diff --git a/src/Spring/Spring.Core/Objects/ObjectWrapper.cs b/src/Spring/Spring.Core/Objects/ObjectWrapper.cs
index 215488220..eae759b67 100644
--- a/src/Spring/Spring.Core/Objects/ObjectWrapper.cs
+++ b/src/Spring/Spring.Core/Objects/ObjectWrapper.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
diff --git a/src/Spring/Spring.Core/Objects/Support/ArgumentConvertingMethodInvoker.cs b/src/Spring/Spring.Core/Objects/Support/ArgumentConvertingMethodInvoker.cs
index c46a61eb5..d8e19a6b3 100644
--- a/src/Spring/Spring.Core/Objects/Support/ArgumentConvertingMethodInvoker.cs
+++ b/src/Spring/Spring.Core/Objects/Support/ArgumentConvertingMethodInvoker.cs
@@ -23,7 +23,6 @@
using System;
using System.ComponentModel;
-using Spring.Core;
using Spring.Core.TypeConversion;
using Spring.Util;
diff --git a/src/Spring/Spring.Core/Proxy/BaseProxyMethodBuilder.cs b/src/Spring/Spring.Core/Proxy/BaseProxyMethodBuilder.cs
index 7dac8f634..778624737 100644
--- a/src/Spring/Spring.Core/Proxy/BaseProxyMethodBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/BaseProxyMethodBuilder.cs
@@ -20,12 +20,9 @@
#region Imports
-using System;
using System.Reflection;
using System.Reflection.Emit;
-using Spring.Util;
-
#endregion
namespace Spring.Proxy
diff --git a/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs b/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs
index 26717afd5..095377897 100644
--- a/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs
@@ -24,8 +24,6 @@
using System.Reflection;
using System.Reflection.Emit;
-using Spring.Util;
-
#endregion
namespace Spring.Proxy
diff --git a/src/Spring/Spring.Core/Proxy/IProxyMethodBuilder.cs b/src/Spring/Spring.Core/Proxy/IProxyMethodBuilder.cs
index e38c5b344..26b1112d9 100644
--- a/src/Spring/Spring.Core/Proxy/IProxyMethodBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/IProxyMethodBuilder.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Reflection;
using System.Reflection.Emit;
diff --git a/src/Spring/Spring.Core/Proxy/IProxyTypeGenerator.cs b/src/Spring/Spring.Core/Proxy/IProxyTypeGenerator.cs
index a58155862..7e36b6cc7 100644
--- a/src/Spring/Spring.Core/Proxy/IProxyTypeGenerator.cs
+++ b/src/Spring/Spring.Core/Proxy/IProxyTypeGenerator.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Reflection.Emit;
#endregion
diff --git a/src/Spring/Spring.Core/Proxy/InheritanceProxyTypeBuilder.cs b/src/Spring/Spring.Core/Proxy/InheritanceProxyTypeBuilder.cs
index 486b6b4ef..fb6c28394 100644
--- a/src/Spring/Spring.Core/Proxy/InheritanceProxyTypeBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/InheritanceProxyTypeBuilder.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Reflection;
using System.Reflection.Emit;
diff --git a/src/Spring/Spring.Core/Proxy/TargetProxyMethodBuilder.cs b/src/Spring/Spring.Core/Proxy/TargetProxyMethodBuilder.cs
index 67a90ab00..caec9016d 100644
--- a/src/Spring/Spring.Core/Proxy/TargetProxyMethodBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/TargetProxyMethodBuilder.cs
@@ -20,12 +20,9 @@
#region Imports
-using System;
using System.Reflection;
using System.Reflection.Emit;
-using Spring.Util;
-
#endregion
namespace Spring.Proxy
diff --git a/src/Spring/Spring.Core/Spring.Core.2010.csproj b/src/Spring/Spring.Core/Spring.Core.2010.csproj
index e144f750b..672b9c8c2 100644
--- a/src/Spring/Spring.Core/Spring.Core.2010.csproj
+++ b/src/Spring/Spring.Core/Spring.Core.2010.csproj
@@ -44,7 +44,6 @@
3.5
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Core\Debug\
@@ -1341,11 +1340,5 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Core/Stereotype/RepositoryAttribute.cs b/src/Spring/Spring.Core/Stereotype/RepositoryAttribute.cs
index 84d365682..fd18dc51f 100644
--- a/src/Spring/Spring.Core/Stereotype/RepositoryAttribute.cs
+++ b/src/Spring/Spring.Core/Stereotype/RepositoryAttribute.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Stereotype
{
///
diff --git a/src/Spring/Spring.Core/Util/AssertUtils.cs b/src/Spring/Spring.Core/Util/AssertUtils.cs
index bee76fc62..243b55a59 100644
--- a/src/Spring/Spring.Core/Util/AssertUtils.cs
+++ b/src/Spring/Spring.Core/Util/AssertUtils.cs
@@ -26,7 +26,6 @@
using System.Reflection;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Proxies;
-using System.Runtime.Serialization;
#endregion
diff --git a/src/Spring/Spring.Core/Util/ConfigXmlDocument.cs b/src/Spring/Spring.Core/Util/ConfigXmlDocument.cs
index 044bce00f..5b213f974 100644
--- a/src/Spring/Spring.Core/Util/ConfigXmlDocument.cs
+++ b/src/Spring/Spring.Core/Util/ConfigXmlDocument.cs
@@ -22,7 +22,6 @@
using System;
using System.IO;
-using System.Net;
using System.Xml;
#endregion
diff --git a/src/Spring/Spring.Core/Util/DynamicCodeManager.cs b/src/Spring/Spring.Core/Util/DynamicCodeManager.cs
index 58beb81f1..129a8da60 100644
--- a/src/Spring/Spring.Core/Util/DynamicCodeManager.cs
+++ b/src/Spring/Spring.Core/Util/DynamicCodeManager.cs
@@ -22,7 +22,6 @@
using System;
using System.Collections;
-using System.Collections.Specialized;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
diff --git a/src/Spring/Spring.Core/Util/FatalReflectionException.cs b/src/Spring/Spring.Core/Util/FatalReflectionException.cs
index b24c9c34d..f618449eb 100644
--- a/src/Spring/Spring.Core/Util/FatalReflectionException.cs
+++ b/src/Spring/Spring.Core/Util/FatalReflectionException.cs
@@ -22,7 +22,6 @@
using System;
using System.Runtime.Serialization;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Core/Util/IStringValueResolver.cs b/src/Spring/Spring.Core/Util/IStringValueResolver.cs
index 62e198e6a..1d492bec7 100644
--- a/src/Spring/Spring.Core/Util/IStringValueResolver.cs
+++ b/src/Spring/Spring.Core/Util/IStringValueResolver.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Spring.Util
+namespace Spring.Util
{
///
/// Simple strategy interface for resolving a String value.
diff --git a/src/Spring/Spring.Core/Util/NumberUtils.cs b/src/Spring/Spring.Core/Util/NumberUtils.cs
index f4338b8a1..1e92570a5 100644
--- a/src/Spring/Spring.Core/Util/NumberUtils.cs
+++ b/src/Spring/Spring.Core/Util/NumberUtils.cs
@@ -22,7 +22,6 @@
using System;
using System.ComponentModel;
-using Spring.Core.TypeConversion;
#endregion
diff --git a/src/Spring/Spring.Core/Util/ObjectUtils.cs b/src/Spring/Spring.Core/Util/ObjectUtils.cs
index c2310083d..f75117e39 100644
--- a/src/Spring/Spring.Core/Util/ObjectUtils.cs
+++ b/src/Spring/Spring.Core/Util/ObjectUtils.cs
@@ -27,7 +27,7 @@
using System.Runtime.Remoting;
using System.Runtime.Remoting.Proxies;
using Common.Logging;
-using Spring.Objects;
+
using Spring.Reflection.Dynamic;
#endregion
diff --git a/src/Spring/Spring.Core/Util/PatternMatchUtils.cs b/src/Spring/Spring.Core/Util/PatternMatchUtils.cs
index 758d64bff..fb5050cf7 100644
--- a/src/Spring/Spring.Core/Util/PatternMatchUtils.cs
+++ b/src/Spring/Spring.Core/Util/PatternMatchUtils.cs
@@ -20,9 +20,7 @@
#region Imports
-using System;
-using System.Collections;
-using Spring.Objects.Factory;
+
#endregion
diff --git a/src/Spring/Spring.Core/Util/StringUtils.cs b/src/Spring/Spring.Core/Util/StringUtils.cs
index a37c72a9d..645d84070 100644
--- a/src/Spring/Spring.Core/Util/StringUtils.cs
+++ b/src/Spring/Spring.Core/Util/StringUtils.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
diff --git a/src/Spring/Spring.Core/Validation/Actions/ExceptionAction.cs b/src/Spring/Spring.Core/Validation/Actions/ExceptionAction.cs
index 255976756..5e7413641 100644
--- a/src/Spring/Spring.Core/Validation/Actions/ExceptionAction.cs
+++ b/src/Spring/Spring.Core/Validation/Actions/ExceptionAction.cs
@@ -19,11 +19,9 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using Common.Logging;
using Spring.Expressions;
-using Spring.Util;
namespace Spring.Validation.Actions
{
diff --git a/src/Spring/Spring.Core/Validation/Actions/ExpressionAction.cs b/src/Spring/Spring.Core/Validation/Actions/ExpressionAction.cs
index 9b2eb392d..20a7223f5 100644
--- a/src/Spring/Spring.Core/Validation/Actions/ExpressionAction.cs
+++ b/src/Spring/Spring.Core/Validation/Actions/ExpressionAction.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
diff --git a/src/Spring/Spring.Core/Validation/AnyValidatorGroup.cs b/src/Spring/Spring.Core/Validation/AnyValidatorGroup.cs
index ce8f8c87c..597453921 100644
--- a/src/Spring/Spring.Core/Validation/AnyValidatorGroup.cs
+++ b/src/Spring/Spring.Core/Validation/AnyValidatorGroup.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
diff --git a/src/Spring/Spring.Core/Validation/BaseSimpleValidator.cs b/src/Spring/Spring.Core/Validation/BaseSimpleValidator.cs
index 719f5e01e..bf12b1b78 100644
--- a/src/Spring/Spring.Core/Validation/BaseSimpleValidator.cs
+++ b/src/Spring/Spring.Core/Validation/BaseSimpleValidator.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
diff --git a/src/Spring/Spring.Core/Validation/BaseValidationAction.cs b/src/Spring/Spring.Core/Validation/BaseValidationAction.cs
index 1dca21645..7d724dbca 100644
--- a/src/Spring/Spring.Core/Validation/BaseValidationAction.cs
+++ b/src/Spring/Spring.Core/Validation/BaseValidationAction.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
diff --git a/src/Spring/Spring.Core/Validation/ExclusiveValidatorGroup.cs b/src/Spring/Spring.Core/Validation/ExclusiveValidatorGroup.cs
index 4b1d80c0c..51c53e3d3 100644
--- a/src/Spring/Spring.Core/Validation/ExclusiveValidatorGroup.cs
+++ b/src/Spring/Spring.Core/Validation/ExclusiveValidatorGroup.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
diff --git a/src/Spring/Spring.Core/Validation/IValidationAction.cs b/src/Spring/Spring.Core/Validation/IValidationAction.cs
index 26895cc7b..7fdf55878 100644
--- a/src/Spring/Spring.Core/Validation/IValidationAction.cs
+++ b/src/Spring/Spring.Core/Validation/IValidationAction.cs
@@ -20,7 +20,6 @@
#region Imports
-using System.Collections;
using System.Collections.Generic;
using Spring.Validation.Actions;
diff --git a/src/Spring/Spring.Core/Validation/IValidationErrors.cs b/src/Spring/Spring.Core/Validation/IValidationErrors.cs
index 010b4b0a4..e98e4c673 100644
--- a/src/Spring/Spring.Core/Validation/IValidationErrors.cs
+++ b/src/Spring/Spring.Core/Validation/IValidationErrors.cs
@@ -1,4 +1,3 @@
-using System.Collections;
using System.Collections.Generic;
using Spring.Context;
diff --git a/src/Spring/Spring.Core/Validation/IValidator.cs b/src/Spring/Spring.Core/Validation/IValidator.cs
index 538ffeba7..22e9e9f22 100644
--- a/src/Spring/Spring.Core/Validation/IValidator.cs
+++ b/src/Spring/Spring.Core/Validation/IValidator.cs
@@ -20,7 +20,6 @@
#region Imports
-using System.Collections;
using System.Collections.Generic;
#endregion
diff --git a/src/Spring/Spring.Core/Validation/ValidatorGroup.cs b/src/Spring/Spring.Core/Validation/ValidatorGroup.cs
index d2b076604..d91e1808a 100644
--- a/src/Spring/Spring.Core/Validation/ValidatorGroup.cs
+++ b/src/Spring/Spring.Core/Validation/ValidatorGroup.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
diff --git a/src/Spring/Spring.Core/Validation/ValidatorReference.cs b/src/Spring/Spring.Core/Validation/ValidatorReference.cs
index 41f182b17..8c07aef24 100644
--- a/src/Spring/Spring.Core/Validation/ValidatorReference.cs
+++ b/src/Spring/Spring.Core/Validation/ValidatorReference.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using Spring.Expressions;
using Spring.Objects.Factory;
diff --git a/src/Spring/Spring.Core/Validation/Validators/EmailValidator.cs b/src/Spring/Spring.Core/Validation/Validators/EmailValidator.cs
index 166ea8443..442d110e6 100644
--- a/src/Spring/Spring.Core/Validation/Validators/EmailValidator.cs
+++ b/src/Spring/Spring.Core/Validation/Validators/EmailValidator.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Text.RegularExpressions;
using Spring.Expressions;
using Spring.Util;
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/DelegatingLocalSessionFactoryObject.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/DelegatingLocalSessionFactoryObject.cs
index 00c8772f8..50790d5c8 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/DelegatingLocalSessionFactoryObject.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/DelegatingLocalSessionFactoryObject.cs
@@ -37,7 +37,9 @@ protected override ISessionFactory NewSessionFactory(Configuration config)
protected override void PostProcessConfiguration(Configuration config)
{
// called before NewSessionFactory
- var settings = ConfigurationManager.ConnectionStrings[config.Properties[global::NHibernate.Cfg.Environment.ConnectionStringName]];
+ string connectionStringName;
+ config.Properties.TryGetValue(global::NHibernate.Cfg.Environment.ConnectionStringName, out connectionStringName);
+ var settings = ConfigurationManager.ConnectionStrings[connectionStringName ?? string.Empty];
if (settings != null)
{
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateDelegate.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateDelegate.cs
index db597a257..777e264f4 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateDelegate.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateDelegate.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NHibernate;
#endregion
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateTransactionManager.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateTransactionManager.cs
index 3a81a32cb..59afd2166 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateTransactionManager.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateTransactionManager.cs
@@ -34,7 +34,7 @@
using Spring.Objects.Factory;
using Spring.Transaction;
using Spring.Transaction.Support;
-using Spring.Util;
+
using HibernateTransactionException = NHibernate.TransactionException;
#endregion
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateCallback.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateCallback.cs
index 7fb2c8994..09b3f5982 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateCallback.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateCallback.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NHibernate;
#endregion
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateOperations.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateOperations.cs
index 00f9e36a9..a813ca614 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateOperations.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateOperations.cs
@@ -25,7 +25,6 @@
using NHibernate;
using NHibernate.Type;
using Spring.Dao;
-using Spring.Data.NHibernate;
#endregion
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs
index 0b8b1dcd9..200ff37be 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs
@@ -679,12 +679,12 @@ public static IDbProvider GetDbProvider(ISessionFactory sessionFactory)
ISessionFactoryImplementor sfi = sessionFactory as ISessionFactoryImplementor;
if (sfi != null)
{
-
- ConnectionProvider cp = sfi.ConnectionProvider as ConnectionProvider;
+
+ IConnectionProvider cp = sfi.ConnectionProvider;
if (cp != null)
{
IConfigurableApplicationContext ctx =
- Spring.Data.Common.DbProviderFactory.ApplicationContext as IConfigurableApplicationContext;
+ DbProviderFactory.ApplicationContext as IConfigurableApplicationContext;
if (ctx == null)
{
throw new InvalidOperationException(
@@ -710,7 +710,7 @@ public static IDbProvider GetDbProvider(ISessionFactory sessionFactory)
if (hibCommandAQN.Equals(commandType))
{
- IDbProvider prov = Spring.Data.Common.DbProviderFactory.GetDbProvider(providerName);
+ IDbProvider prov = DbProviderFactory.GetDbProvider(providerName);
return prov;
}
}
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support/SessionScope.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support/SessionScope.cs
index c6d35f4bb..efcef9ff1 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support/SessionScope.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support/SessionScope.cs
@@ -21,9 +21,8 @@
#region Imports
using System;
-using System.Diagnostics;
using System.Reflection;
-using System.Text;
+
using Common.Logging;
using NHibernate;
using Spring.Threading;
diff --git a/src/Spring/Spring.Data.NHibernate3/AssemblyInfo.cs b/src/Spring/Spring.Data.NHibernate3/AssemblyInfo.cs
index 4a4c8ccf0..1ec3c0c5d 100644
--- a/src/Spring/Spring.Data.NHibernate3/AssemblyInfo.cs
+++ b/src/Spring/Spring.Data.NHibernate3/AssemblyInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring.Net NHibernate 3.3 support")]
diff --git a/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.2010.csproj b/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.2010.csproj
index 6cd6fcf68..2f8bd4944 100644
--- a/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.2010.csproj
+++ b/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -64,11 +63,11 @@
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
-
+
False
..\..\..\packages\Iesi.Collections.3.3.3.4001\lib\Net35\Iesi.Collections.dll
-
+
False
..\..\..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll
@@ -248,7 +247,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.build b/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.build
index 8ce5ae4a8..fd92d87f0 100644
--- a/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.build
+++ b/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.build
@@ -7,14 +7,13 @@
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
-
+
-
-
-
+
+
diff --git a/src/Spring/Spring.Data.NHibernate4/AssemblyInfo.cs b/src/Spring/Spring.Data.NHibernate4/AssemblyInfo.cs
index 4a4c8ccf0..1ec3c0c5d 100644
--- a/src/Spring/Spring.Data.NHibernate4/AssemblyInfo.cs
+++ b/src/Spring/Spring.Data.NHibernate4/AssemblyInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring.Net NHibernate 3.3 support")]
diff --git a/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.2010.csproj b/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.2010.csproj
index c862e835b..39505abe2 100644
--- a/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.2010.csproj
+++ b/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -247,7 +246,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.build b/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.build
index b5ecc5103..bed557181 100644
--- a/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.build
+++ b/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.build
@@ -11,8 +11,6 @@
-
-
@@ -51,10 +49,8 @@
-
-
-
-
+
+
diff --git a/src/Spring/Spring.Data/AssemblyInfo.cs b/src/Spring/Spring.Data/AssemblyInfo.cs
index 2e6f1ca1f..e252c721f 100644
--- a/src/Spring/Spring.Data/AssemblyInfo.cs
+++ b/src/Spring/Spring.Data/AssemblyInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring.Data")]
diff --git a/src/Spring/Spring.Data/Dao/Attributes/PersistenceExceptionTranslationPostProcessor.cs b/src/Spring/Spring.Data/Dao/Attributes/PersistenceExceptionTranslationPostProcessor.cs
index c514e848e..6ea82b064 100644
--- a/src/Spring/Spring.Data/Dao/Attributes/PersistenceExceptionTranslationPostProcessor.cs
+++ b/src/Spring/Spring.Data/Dao/Attributes/PersistenceExceptionTranslationPostProcessor.cs
@@ -21,7 +21,6 @@
using System;
using Spring.Aop.Framework;
using Spring.Core;
-using Spring.Dao;
using Spring.Dao.Support;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
@@ -80,9 +79,9 @@ public Type RepositoryAttributeType
}
}
- ///
- /// Callback that supplies the owning factory to an object instance.
- ///
+ ///
+ /// Callback that supplies the owning factory to an object instance.
+ ///
public IObjectFactory ObjectFactory
{
set
diff --git a/src/Spring/Spring.Data/Dao/Support/IPersistenceExceptionTranslator.cs b/src/Spring/Spring.Data/Dao/Support/IPersistenceExceptionTranslator.cs
index 970428544..57d6b5b2a 100644
--- a/src/Spring/Spring.Data/Dao/Support/IPersistenceExceptionTranslator.cs
+++ b/src/Spring/Spring.Data/Dao/Support/IPersistenceExceptionTranslator.cs
@@ -21,7 +21,7 @@
#endregion
using System;
-using Spring.Dao;
+
using Spring.Data.Support;
namespace Spring.Dao.Support
diff --git a/src/Spring/Spring.Data/Dao/Support/PersistenceExceptionTranslationInterceptor.cs b/src/Spring/Spring.Data/Dao/Support/PersistenceExceptionTranslationInterceptor.cs
index 1d0fe69c4..f075121f2 100644
--- a/src/Spring/Spring.Data/Dao/Support/PersistenceExceptionTranslationInterceptor.cs
+++ b/src/Spring/Spring.Data/Dao/Support/PersistenceExceptionTranslationInterceptor.cs
@@ -19,11 +19,9 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using AopAlliance.Intercept;
using Spring.Objects.Factory;
-using Spring.Objects.Factory.Config;
using Spring.Util;
namespace Spring.Dao.Support
diff --git a/src/Spring/Spring.Data/Data/Common/DbProviderFactoryObject.cs b/src/Spring/Spring.Data/Data/Common/DbProviderFactoryObject.cs
index 889fde16c..2bd20d374 100644
--- a/src/Spring/Spring.Data/Data/Common/DbProviderFactoryObject.cs
+++ b/src/Spring/Spring.Data/Data/Common/DbProviderFactoryObject.cs
@@ -19,7 +19,7 @@
#endregion
using System;
-using Spring.Core.IO;
+
using Spring.Objects.Factory;
using Spring.Util;
diff --git a/src/Spring/Spring.Data/Data/Config/DatabaseNamespaceParser.cs b/src/Spring/Spring.Data/Data/Config/DatabaseNamespaceParser.cs
index 3174f6603..80510018a 100644
--- a/src/Spring/Spring.Data/Data/Config/DatabaseNamespaceParser.cs
+++ b/src/Spring/Spring.Data/Data/Config/DatabaseNamespaceParser.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-using System.Globalization;
using System.Xml;
using Spring.Data.Common;
diff --git a/src/Spring/Spring.Data/Data/Core/RowMapperResultSetExtractor.cs b/src/Spring/Spring.Data/Data/Core/RowMapperResultSetExtractor.cs
index 34d7f3002..0696b37e2 100644
--- a/src/Spring/Spring.Data/Data/Core/RowMapperResultSetExtractor.cs
+++ b/src/Spring/Spring.Data/Data/Core/RowMapperResultSetExtractor.cs
@@ -23,7 +23,6 @@
using System;
using System.Collections;
using Spring.Collections;
-using Spring.Data.Support;
#endregion
diff --git a/src/Spring/Spring.Data/Data/ICommandCallback.cs b/src/Spring/Spring.Data/Data/ICommandCallback.cs
index 1c0e5f7c5..888e125bf 100644
--- a/src/Spring/Spring.Data/Data/ICommandCallback.cs
+++ b/src/Spring/Spring.Data/Data/ICommandCallback.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using System.Data;
namespace Spring.Data
diff --git a/src/Spring/Spring.Data/Data/Objects/AdoNonQuery.cs b/src/Spring/Spring.Data/Data/Objects/AdoNonQuery.cs
index c7626530a..b3047a87d 100644
--- a/src/Spring/Spring.Data/Data/Objects/AdoNonQuery.cs
+++ b/src/Spring/Spring.Data/Data/Objects/AdoNonQuery.cs
@@ -21,7 +21,7 @@
#region Imports
using System.Collections;
-using System.Data;
+
using Spring.Data.Common;
#endregion
diff --git a/src/Spring/Spring.Data/Data/Objects/AdoScalar.cs b/src/Spring/Spring.Data/Data/Objects/AdoScalar.cs
index 175b1c099..312c8f69f 100644
--- a/src/Spring/Spring.Data/Data/Objects/AdoScalar.cs
+++ b/src/Spring/Spring.Data/Data/Objects/AdoScalar.cs
@@ -21,7 +21,7 @@
#region Imports
using System.Collections;
-using System.Data;
+
using Spring.Data.Common;
#endregion
diff --git a/src/Spring/Spring.Data/Data/Support/AdoTransactionObjectSupport.cs b/src/Spring/Spring.Data/Data/Support/AdoTransactionObjectSupport.cs
index 83298db51..5df2bacec 100644
--- a/src/Spring/Spring.Data/Data/Support/AdoTransactionObjectSupport.cs
+++ b/src/Spring/Spring.Data/Data/Support/AdoTransactionObjectSupport.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Data;
using Common.Logging;
using Spring.Transaction;
diff --git a/src/Spring/Spring.Data/Spring.Data.2010.csproj b/src/Spring/Spring.Data/Spring.Data.2010.csproj
index bb7eec46b..b83629140 100644
--- a/src/Spring/Spring.Data/Spring.Data.2010.csproj
+++ b/src/Spring/Spring.Data/Spring.Data.2010.csproj
@@ -29,7 +29,6 @@
3.5
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Data\Debug\
@@ -344,11 +343,5 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Data/Transaction/Config/TxNamespaceUtils.cs b/src/Spring/Spring.Data/Transaction/Config/TxNamespaceUtils.cs
index a57c5f93f..7da864f4e 100644
--- a/src/Spring/Spring.Data/Transaction/Config/TxNamespaceUtils.cs
+++ b/src/Spring/Spring.Data/Transaction/Config/TxNamespaceUtils.cs
@@ -18,9 +18,7 @@
#endregion
-using System;
using Spring.Core;
-using Spring.Transaction.Interceptor;
namespace Spring.Transaction.Config
{
diff --git a/src/Spring/Spring.Data/Transaction/IPlatformTransactionManager.cs b/src/Spring/Spring.Data/Transaction/IPlatformTransactionManager.cs
index 1f13d56d0..b6c260dee 100644
--- a/src/Spring/Spring.Data/Transaction/IPlatformTransactionManager.cs
+++ b/src/Spring/Spring.Data/Transaction/IPlatformTransactionManager.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Transaction
{
///
diff --git a/src/Spring/Spring.Data/Transaction/ISavepointManager.cs b/src/Spring/Spring.Data/Transaction/ISavepointManager.cs
index ceae1e5ef..6f5f38c7e 100644
--- a/src/Spring/Spring.Data/Transaction/ISavepointManager.cs
+++ b/src/Spring/Spring.Data/Transaction/ISavepointManager.cs
@@ -16,8 +16,6 @@
*/
#endregion
-using System;
-
namespace Spring.Transaction
{
///
diff --git a/src/Spring/Spring.Data/Transaction/ITransactionStatus.cs b/src/Spring/Spring.Data/Transaction/ITransactionStatus.cs
index 0e1ffca24..11f455c69 100644
--- a/src/Spring/Spring.Data/Transaction/ITransactionStatus.cs
+++ b/src/Spring/Spring.Data/Transaction/ITransactionStatus.cs
@@ -18,9 +18,6 @@
#endregion
-using System;
-using System.Data;
-
namespace Spring.Transaction
{
///
diff --git a/src/Spring/Spring.Data/Transaction/Interceptor/ObjectFactoryTransactionAttributeSourceAdvisor.cs b/src/Spring/Spring.Data/Transaction/Interceptor/ObjectFactoryTransactionAttributeSourceAdvisor.cs
index 00090de4d..5f6fc392b 100644
--- a/src/Spring/Spring.Data/Transaction/Interceptor/ObjectFactoryTransactionAttributeSourceAdvisor.cs
+++ b/src/Spring/Spring.Data/Transaction/Interceptor/ObjectFactoryTransactionAttributeSourceAdvisor.cs
@@ -16,9 +16,8 @@
* limitations under the License.
*/
-#endregion
-
-using System;
+#endregion
+
using Spring.Aop;
using Spring.Aop.Support;
diff --git a/src/Spring/Spring.Data/Transaction/Interceptor/RollbackRuleAttribute.cs b/src/Spring/Spring.Data/Transaction/Interceptor/RollbackRuleAttribute.cs
index 33e4ebd87..334e25dcd 100644
--- a/src/Spring/Spring.Data/Transaction/Interceptor/RollbackRuleAttribute.cs
+++ b/src/Spring/Spring.Data/Transaction/Interceptor/RollbackRuleAttribute.cs
@@ -19,7 +19,7 @@
#endregion
using System;
-using Spring.Aop.Framework;
+
using Spring.Util;
namespace Spring.Transaction.Interceptor
diff --git a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAspectSupport.cs b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAspectSupport.cs
index 6cb9a1112..954c3b43c 100644
--- a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAspectSupport.cs
+++ b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAspectSupport.cs
@@ -25,7 +25,6 @@
using Spring.Objects.Factory;
using Spring.Threading;
using Spring.Util;
-using IsolationLevel=System.Data.IsolationLevel;
namespace Spring.Transaction.Interceptor
{
diff --git a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAttributeSourceEditor.cs b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAttributeSourceEditor.cs
index 251e00567..e091d5261 100644
--- a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAttributeSourceEditor.cs
+++ b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionAttributeSourceEditor.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using System.Collections;
using Spring.Util;
diff --git a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs
index c4eaafabb..ca4ab8614 100644
--- a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs
+++ b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs
@@ -27,7 +27,6 @@
using Spring.Aop;
using Spring.Aop.Framework;
using Spring.Aop.Framework.Adapter;
-using Spring.Aop.Framework.DynamicProxy;
using Spring.Aop.Support;
using Spring.Aop.Target;
using Spring.Core.TypeResolution;
diff --git a/src/Spring/Spring.Data/Transaction/Support/ISmartTransactionObject.cs b/src/Spring/Spring.Data/Transaction/Support/ISmartTransactionObject.cs
index 9b896531f..4b3b1a16c 100644
--- a/src/Spring/Spring.Data/Transaction/Support/ISmartTransactionObject.cs
+++ b/src/Spring/Spring.Data/Transaction/Support/ISmartTransactionObject.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Transaction.Support
{
///
diff --git a/src/Spring/Spring.Data/Transaction/Support/ITransactionSynchronization.cs b/src/Spring/Spring.Data/Transaction/Support/ITransactionSynchronization.cs
index bf707bf8e..9e2c1a3da 100644
--- a/src/Spring/Spring.Data/Transaction/Support/ITransactionSynchronization.cs
+++ b/src/Spring/Spring.Data/Transaction/Support/ITransactionSynchronization.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Transaction.Support
{
///
diff --git a/src/Spring/Spring.Data/Transaction/Support/TransactionCallbackWithoutResult.cs b/src/Spring/Spring.Data/Transaction/Support/TransactionCallbackWithoutResult.cs
index a85ad7d84..d4f9fb44a 100644
--- a/src/Spring/Spring.Data/Transaction/Support/TransactionCallbackWithoutResult.cs
+++ b/src/Spring/Spring.Data/Transaction/Support/TransactionCallbackWithoutResult.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationManager.cs b/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationManager.cs
index 6ec964cbe..883dc3468 100644
--- a/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationManager.cs
+++ b/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationManager.cs
@@ -21,8 +21,7 @@
using System;
using System.Collections;
using System.Data;
-using System.Globalization;
-using System.Threading;
+
using Spring.Core;
using Spring.Threading;
using Spring.Util;
@@ -325,9 +324,9 @@ public static IList Synchronizations
{
get
{
- if ( ! SynchronizationActive )
+ if (!SynchronizationActive)
{
- throw new InvalidOperationException( "Transaction synchronization is not active" );
+ throw new InvalidOperationException("Transaction synchronization is not active");
}
ArrayList syncs = LogicalThreadContext.GetData(syncsDataSlotName) as ArrayList;
if (syncs != null)
@@ -336,9 +335,9 @@ public static IList Synchronizations
object root = syncs.SyncRoot;
lock (root)
{
- // #SPRNET-1160, tx Ben Rowlands
+ // #SPRNET-1160, tx Ben Rowlands
CollectionUtils.StableSortInPlace(syncs, syncComparer);
- }
+ }
// Return unmodifiable snapshot, to avoid exceptions
// while iterating and invoking synchronization callbacks that in turn
diff --git a/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationState.cs b/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationState.cs
index 9fee7fdf8..4bc1f35c3 100644
--- a/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationState.cs
+++ b/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationState.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Transaction.Support
{
///
diff --git a/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationStatus.cs b/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationStatus.cs
index e900c2674..ccf8ca087 100644
--- a/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationStatus.cs
+++ b/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationStatus.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Transaction.Support
{
///
diff --git a/src/Spring/Spring.Data/Transaction/TransactionOutcomeState.cs b/src/Spring/Spring.Data/Transaction/TransactionOutcomeState.cs
index 08dde703f..1bfde3620 100644
--- a/src/Spring/Spring.Data/Transaction/TransactionOutcomeState.cs
+++ b/src/Spring/Spring.Data/Transaction/TransactionOutcomeState.cs
@@ -4,7 +4,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/src/Spring/Spring.Messaging.Ems/AssemblyInfo.cs b/src/Spring/Spring.Messaging.Ems/AssemblyInfo.cs
index 86b224ce8..fbbf4aab4 100644
--- a/src/Spring/Spring.Messaging.Ems/AssemblyInfo.cs
+++ b/src/Spring/Spring.Messaging.Ems/AssemblyInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring.Messaging.Ems")]
diff --git a/src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.2010.csproj b/src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.2010.csproj
index 7baf362c1..e9fe724c7 100644
--- a/src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.2010.csproj
+++ b/src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.2010.csproj
@@ -16,7 +16,6 @@
3.5
..\..\..\
- true
true
@@ -181,13 +180,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Config/NmsNamespaceParser.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Config/NmsNamespaceParser.cs
index d93dea0d3..a166f9126 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Config/NmsNamespaceParser.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Config/NmsNamespaceParser.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using Spring.Objects.Factory.Xml;
namespace Spring.Messaging.Nms.Config
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs
index f64c97033..d7316cd3e 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs
@@ -24,7 +24,6 @@
using Common.Logging;
using Spring.Collections;
using Spring.Util;
-using IQueue=Apache.NMS.IQueue;
namespace Spring.Messaging.Nms.Connections
{
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/AbstractMessageListenerContainer.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/AbstractMessageListenerContainer.cs
index 96e0fc40b..19b10e513 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/AbstractMessageListenerContainer.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/AbstractMessageListenerContainer.cs
@@ -19,8 +19,7 @@
#endregion
using System;
-using System.Collections;
-using System.IO;
+
using Common.Logging;
using Spring.Messaging.Nms.Core;
using Spring.Messaging.Nms.Support;
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/Adapter/MessageListenerAdapter.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/Adapter/MessageListenerAdapter.cs
index 05815ced8..8a406616e 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/Adapter/MessageListenerAdapter.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/Adapter/MessageListenerAdapter.cs
@@ -20,7 +20,6 @@
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using Common.Logging;
@@ -29,7 +28,6 @@
using Spring.Messaging.Nms.Support;
using Spring.Messaging.Nms.Support.Converter;
using Spring.Messaging.Nms.Support.Destinations;
-using Spring.Messaging.Nms.Listener;
using Spring.Util;
using Apache.NMS;
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/SimpleMessageConverter.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/SimpleMessageConverter.cs
index 6c6e5e3c2..03345939d 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/SimpleMessageConverter.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/SimpleMessageConverter.cs
@@ -20,7 +20,7 @@
using System;
using System.Collections;
-using System.Runtime.Serialization;
+
using Apache.NMS;
namespace Spring.Messaging.Nms.Support.Converter
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/XmlMessageConverter.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/XmlMessageConverter.cs
index 802b7ff26..7ed00351c 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/XmlMessageConverter.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Support/Converter/XmlMessageConverter.cs
@@ -5,7 +5,6 @@
using System.Xml;
using System.Xml.Serialization;
using Apache.NMS;
-using Spring.Messaging.Nms.Support.Converter;
namespace Spring.Messaging.Nms.Support.Converter
{
diff --git a/src/Spring/Spring.Messaging.Nms/Spring.Messaging.Nms.2010.csproj b/src/Spring/Spring.Messaging.Nms/Spring.Messaging.Nms.2010.csproj
index 960a233dd..f28fb2e0e 100644
--- a/src/Spring/Spring.Messaging.Nms/Spring.Messaging.Nms.2010.csproj
+++ b/src/Spring/Spring.Messaging.Nms/Spring.Messaging.Nms.2010.csproj
@@ -16,7 +16,6 @@
3.5
..\..\..\
- true
true
@@ -138,13 +137,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Messaging/Messaging/Listener/MessageListenerAdapter.cs b/src/Spring/Spring.Messaging/Messaging/Listener/MessageListenerAdapter.cs
index 011222091..63c6b310f 100644
--- a/src/Spring/Spring.Messaging/Messaging/Listener/MessageListenerAdapter.cs
+++ b/src/Spring/Spring.Messaging/Messaging/Listener/MessageListenerAdapter.cs
@@ -18,15 +18,12 @@
#endregion
-using System;
-using System.Collections;
using System.Collections.Generic;
using System.Messaging;
using Common.Logging;
using Spring.Context;
using Spring.Expressions;
using Spring.Messaging.Core;
-using Spring.Messaging.Support;
using Spring.Messaging.Support.Converters;
using Spring.Objects.Factory;
using Spring.Reflection.Dynamic;
diff --git a/src/Spring/Spring.Messaging/Messaging/Listener/TransactionalMessageListenerContainer.cs b/src/Spring/Spring.Messaging/Messaging/Listener/TransactionalMessageListenerContainer.cs
index 08f740219..7babe1d7e 100644
--- a/src/Spring/Spring.Messaging/Messaging/Listener/TransactionalMessageListenerContainer.cs
+++ b/src/Spring/Spring.Messaging/Messaging/Listener/TransactionalMessageListenerContainer.cs
@@ -23,7 +23,6 @@
using Common.Logging;
using Spring.Data.Core;
using Spring.Messaging.Core;
-using Spring.Messaging.Support;
using Spring.Transaction;
using Spring.Transaction.Support;
diff --git a/src/Spring/Spring.Messaging/Messaging/Support/Converters/MessageConverterCreatorDelegate.cs b/src/Spring/Spring.Messaging/Messaging/Support/Converters/MessageConverterCreatorDelegate.cs
index b7668c90a..49e933985 100644
--- a/src/Spring/Spring.Messaging/Messaging/Support/Converters/MessageConverterCreatorDelegate.cs
+++ b/src/Spring/Spring.Messaging/Messaging/Support/Converters/MessageConverterCreatorDelegate.cs
@@ -19,7 +19,6 @@
#endregion
using Spring.Messaging.Core;
-using Spring.Messaging.Support.Converters;
namespace Spring.Messaging.Support.Converters
{
diff --git a/src/Spring/Spring.Messaging/Messaging/Support/Converters/XmlDocumentConverter.cs b/src/Spring/Spring.Messaging/Messaging/Support/Converters/XmlDocumentConverter.cs
index d247e58bc..9e8eb8678 100644
--- a/src/Spring/Spring.Messaging/Messaging/Support/Converters/XmlDocumentConverter.cs
+++ b/src/Spring/Spring.Messaging/Messaging/Support/Converters/XmlDocumentConverter.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using System.Messaging;
using System.Xml;
diff --git a/src/Spring/Spring.Messaging/Spring.Messaging.2010.csproj b/src/Spring/Spring.Messaging/Spring.Messaging.2010.csproj
index 31f1ae44f..7fe322868 100644
--- a/src/Spring/Spring.Messaging/Spring.Messaging.2010.csproj
+++ b/src/Spring/Spring.Messaging/Spring.Messaging.2010.csproj
@@ -16,7 +16,6 @@
3.5
..\..\..\
- true
true
@@ -115,13 +114,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Scheduling.Quartz2/AssemblyInfo.cs b/src/Spring/Spring.Scheduling.Quartz2/AssemblyInfo.cs
index c0c2824d8..2b03876cd 100644
--- a/src/Spring/Spring.Scheduling.Quartz2/AssemblyInfo.cs
+++ b/src/Spring/Spring.Scheduling.Quartz2/AssemblyInfo.cs
@@ -20,23 +20,12 @@
using System.Reflection;
using System.Runtime.InteropServices;
-using System.Security;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle("Spring.Scheduling.Quartz")]
[assembly: AssemblyDescription("Quartz.NET scheduler integration for Spring.NET")]
-//
-// Security Permissions
-//
-// we need full, unrestricted access to reflection metadata...
-//[assembly: ReflectionPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
-//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")]
-//[assembly: AssemblyKeyFile(@"C:\projects\Spring.Net\Spring.Net.snk")]
-
#if !NET_4_0
-[assembly: AllowPartiallyTrustedCallers]
-
-[assembly: SecurityCritical]
-
+[assembly: System.Security.AllowPartiallyTrustedCallers]
+[assembly: System.Security.SecurityCritical]
#endif
diff --git a/src/Spring/Spring.Scheduling.Quartz2/Spring.Scheduling.Quartz2.2010.csproj b/src/Spring/Spring.Scheduling.Quartz2/Spring.Scheduling.Quartz2.2010.csproj
index 3fe42bde0..a9c801545 100644
--- a/src/Spring/Spring.Scheduling.Quartz2/Spring.Scheduling.Quartz2.2010.csproj
+++ b/src/Spring/Spring.Scheduling.Quartz2/Spring.Scheduling.Quartz2.2010.csproj
@@ -17,7 +17,6 @@
..\..\..\
- true
true
@@ -103,7 +102,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Services/Remoting/CaoExporter.cs b/src/Spring/Spring.Services/Remoting/CaoExporter.cs
index 07648e4a7..2febd3fa7 100644
--- a/src/Spring/Spring.Services/Remoting/CaoExporter.cs
+++ b/src/Spring/Spring.Services/Remoting/CaoExporter.cs
@@ -24,12 +24,9 @@
using System.Runtime.Remoting;
using Spring.Context;
-using Spring.Core;
-using Spring.Objects;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Support;
using Spring.Remoting.Support;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Services/Remoting/Config/RemotingNamespaceParser.cs b/src/Spring/Spring.Services/Remoting/Config/RemotingNamespaceParser.cs
index b4f82d8ee..71615e57c 100644
--- a/src/Spring/Spring.Services/Remoting/Config/RemotingNamespaceParser.cs
+++ b/src/Spring/Spring.Services/Remoting/Config/RemotingNamespaceParser.cs
@@ -22,7 +22,6 @@
using System.Xml;
-using Spring.Context.Support;
using Spring.Core.TypeResolution;
using Spring.Objects;
using Spring.Objects.Factory.Support;
diff --git a/src/Spring/Spring.Services/Remoting/RemoteObjectFactory.cs b/src/Spring/Spring.Services/Remoting/RemoteObjectFactory.cs
index 7055c0bb1..b228a9186 100644
--- a/src/Spring/Spring.Services/Remoting/RemoteObjectFactory.cs
+++ b/src/Spring/Spring.Services/Remoting/RemoteObjectFactory.cs
@@ -22,12 +22,10 @@
using System;
using System.Reflection;
-using System.Reflection.Emit;
using Spring.Proxy;
using Spring.Objects.Factory;
using Spring.Remoting.Support;
-using Spring.Util;
using Spring.Core.TypeResolution;
#endregion
diff --git a/src/Spring/Spring.Services/Spring.Services.2010.csproj b/src/Spring/Spring.Services/Spring.Services.2010.csproj
index c74c32f8f..2df3677bf 100644
--- a/src/Spring/Spring.Services/Spring.Services.2010.csproj
+++ b/src/Spring/Spring.Services/Spring.Services.2010.csproj
@@ -31,7 +31,6 @@
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Services\Debug\
@@ -175,11 +174,5 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Template.Velocity.Castle/AssemblyInfo.cs b/src/Spring/Spring.Template.Velocity.Castle/AssemblyInfo.cs
index 81db3173e..632b3d406 100644
--- a/src/Spring/Spring.Template.Velocity.Castle/AssemblyInfo.cs
+++ b/src/Spring/Spring.Template.Velocity.Castle/AssemblyInfo.cs
@@ -20,23 +20,12 @@
using System.Reflection;
using System.Runtime.InteropServices;
-using System.Security;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle("Spring.Template.Velocity.Castle")]
[assembly: AssemblyDescription("Castle NVelocity template engine integration for Spring.NET")]
-//
-// Security Permissions
-//
-// we need full, unrestricted access to reflection metadata...
-//[assembly: ReflectionPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
-//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")]
-//[assembly: AssemblyKeyFile(@"C:\projects\Spring.Net\Spring.Net.snk")]
-
#if !NET_4_0
-[assembly: AllowPartiallyTrustedCallers]
-
-[assembly: SecurityCritical]
-
+[assembly: System.Security.AllowPartiallyTrustedCallers]
+[assembly: System.Security.SecurityCritical]
#endif
diff --git a/src/Spring/Spring.Template.Velocity.Castle/Spring.Template.Velocity.Castle.2010.csproj b/src/Spring/Spring.Template.Velocity.Castle/Spring.Template.Velocity.Castle.2010.csproj
index 1706c6e7a..4b6a71ffa 100644
--- a/src/Spring/Spring.Template.Velocity.Castle/Spring.Template.Velocity.Castle.2010.csproj
+++ b/src/Spring/Spring.Template.Velocity.Castle/Spring.Template.Velocity.Castle.2010.csproj
@@ -33,7 +33,6 @@
v4.0
3.5
..\..\..\
- true
true
@@ -109,13 +108,6 @@
-
-
-
- Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti sul computer in uso. Abilitare il ripristino dei pacchetti NuGet per scaricarli. Per ulteriori informazioni, visitare http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Template.Velocity/AssemblyInfo.cs b/src/Spring/Spring.Template.Velocity/AssemblyInfo.cs
index be9ce1337..80a16c09c 100644
--- a/src/Spring/Spring.Template.Velocity/AssemblyInfo.cs
+++ b/src/Spring/Spring.Template.Velocity/AssemblyInfo.cs
@@ -20,23 +20,12 @@
using System.Reflection;
using System.Runtime.InteropServices;
-using System.Security;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle("Spring.Template.Velocity")]
[assembly: AssemblyDescription("NVelocity template engine integration for Spring.NET")]
-//
-// Security Permissions
-//
-// we need full, unrestricted access to reflection metadata...
-//[assembly: ReflectionPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
-//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")]
-//[assembly: AssemblyKeyFile(@"C:\projects\Spring.Net\Spring.Net.snk")]
-
#if !NET_4_0
-[assembly: AllowPartiallyTrustedCallers]
-
-[assembly: SecurityCritical]
-
+[assembly: System.Security.AllowPartiallyTrustedCallers]
+[assembly: System.Security.SecurityCritical]
#endif
diff --git a/src/Spring/Spring.Template.Velocity/Spring.Template.Velocity.2010.csproj b/src/Spring/Spring.Template.Velocity/Spring.Template.Velocity.2010.csproj
index ea2ea1882..1381b1f38 100644
--- a/src/Spring/Spring.Template.Velocity/Spring.Template.Velocity.2010.csproj
+++ b/src/Spring/Spring.Template.Velocity/Spring.Template.Velocity.2010.csproj
@@ -32,7 +32,6 @@
v4.0
3.5
..\..\..\
- true
true
@@ -122,13 +121,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Testing.Microsoft/AssemblyInfo.cs b/src/Spring/Spring.Testing.Microsoft/AssemblyInfo.cs
index 1fa90498c..48788a278 100644
--- a/src/Spring/Spring.Testing.Microsoft/AssemblyInfo.cs
+++ b/src/Spring/Spring.Testing.Microsoft/AssemblyInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring.Testing.Microsoft")]
diff --git a/src/Spring/Spring.Testing.Microsoft/Spring.Testing.Microsoft.2010.csproj b/src/Spring/Spring.Testing.Microsoft/Spring.Testing.Microsoft.2010.csproj
index 22cdeabd3..68934e1f4 100644
--- a/src/Spring/Spring.Testing.Microsoft/Spring.Testing.Microsoft.2010.csproj
+++ b/src/Spring/Spring.Testing.Microsoft/Spring.Testing.Microsoft.2010.csproj
@@ -33,7 +33,6 @@
true
..\..\..\
- true
true
@@ -122,13 +121,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractTransactionalDbProviderSpringContextTests.cs b/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractTransactionalDbProviderSpringContextTests.cs
index cc4bd79b8..93da96788 100644
--- a/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractTransactionalDbProviderSpringContextTests.cs
+++ b/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractTransactionalDbProviderSpringContextTests.cs
@@ -23,7 +23,6 @@
using System.Data;
using Spring.Data.Common;
using Spring.Data.Core;
-using Spring.Objects.Factory.Config;
namespace Spring.Testing.Microsoft
{
diff --git a/src/Spring/Spring.Testing.NUnit/AssemblyInfo.cs b/src/Spring/Spring.Testing.NUnit/AssemblyInfo.cs
index 03bb47d6d..01dade9d6 100644
--- a/src/Spring/Spring.Testing.NUnit/AssemblyInfo.cs
+++ b/src/Spring/Spring.Testing.NUnit/AssemblyInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring.Testing.NUnit")]
diff --git a/src/Spring/Spring.Testing.NUnit/Spring.Testing.NUnit.2010.csproj b/src/Spring/Spring.Testing.NUnit/Spring.Testing.NUnit.2010.csproj
index 6a32e427a..beec9dfc8 100644
--- a/src/Spring/Spring.Testing.NUnit/Spring.Testing.NUnit.2010.csproj
+++ b/src/Spring/Spring.Testing.NUnit/Spring.Testing.NUnit.2010.csproj
@@ -16,7 +16,6 @@
3.5
..\..\..\
- true
true
@@ -48,9 +47,9 @@
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
@@ -79,9 +78,10 @@
+
+
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Web.Extensions/AssemblyInfo.cs b/src/Spring/Spring.Web.Extensions/AssemblyInfo.cs
index 035118185..089232b1b 100644
--- a/src/Spring/Spring.Web.Extensions/AssemblyInfo.cs
+++ b/src/Spring/Spring.Web.Extensions/AssemblyInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring.Web.Extensions")]
diff --git a/src/Spring/Spring.Web.Extensions/Spring.Web.Extensions.2010.csproj b/src/Spring/Spring.Web.Extensions/Spring.Web.Extensions.2010.csproj
index fdc1d478a..4dec56842 100644
--- a/src/Spring/Spring.Web.Extensions/Spring.Web.Extensions.2010.csproj
+++ b/src/Spring/Spring.Web.Extensions/Spring.Web.Extensions.2010.csproj
@@ -16,7 +16,6 @@
3.5
..\..\..\
- true
true
@@ -76,13 +75,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContext.cs b/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContext.cs
index fdb34f713..c82237d50 100644
--- a/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContext.cs
+++ b/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContext.cs
@@ -18,12 +18,6 @@
#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Spring.Context.Support;
using Spring.Core.IO;
namespace Spring.Context.Support
diff --git a/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContextArgs.cs b/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContextArgs.cs
index d8828dea4..39b1abc60 100644
--- a/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContextArgs.cs
+++ b/src/Spring/Spring.Web.Mvc3/Context/Support/MvcApplicationContextArgs.cs
@@ -18,8 +18,6 @@
#endregion
-
-using System;
using Spring.Core.IO;
namespace Spring.Context.Support
diff --git a/src/Spring/Spring.Web.Mvc3/Context/Support/MvcContextHandler.cs b/src/Spring/Spring.Web.Mvc3/Context/Support/MvcContextHandler.cs
index b235ac56d..8372aa10c 100644
--- a/src/Spring/Spring.Web.Mvc3/Context/Support/MvcContextHandler.cs
+++ b/src/Spring/Spring.Web.Mvc3/Context/Support/MvcContextHandler.cs
@@ -18,12 +18,6 @@
#endregion
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Spring.Context.Support;
-
namespace Spring.Context.Support
{
///
diff --git a/src/Spring/Spring.Web.Mvc3/Spring.Web.Mvc3.2010.csproj b/src/Spring/Spring.Web.Mvc3/Spring.Web.Mvc3.2010.csproj
index 21610d116..ca5116d68 100644
--- a/src/Spring/Spring.Web.Mvc3/Spring.Web.Mvc3.2010.csproj
+++ b/src/Spring/Spring.Web.Mvc3/Spring.Web.Mvc3.2010.csproj
@@ -14,7 +14,6 @@
512
..\..\..\
- true
true
@@ -109,7 +108,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Web.Mvc3/SpringMvcDependencyResolver.cs b/src/Spring/Spring.Web.Mvc3/SpringMvcDependencyResolver.cs
index 46377ac00..c04478124 100644
--- a/src/Spring/Spring.Web.Mvc3/SpringMvcDependencyResolver.cs
+++ b/src/Spring/Spring.Web.Mvc3/SpringMvcDependencyResolver.cs
@@ -6,8 +6,6 @@
using Common.Logging;
-using Microsoft.Win32;
-
using Spring.Context;
using Spring.Context.Support;
diff --git a/src/Spring/Spring.Web.Mvc4/Spring.Web.Mvc4.2010.csproj b/src/Spring/Spring.Web.Mvc4/Spring.Web.Mvc4.2010.csproj
index a1a220ae3..a6e4a4e58 100644
--- a/src/Spring/Spring.Web.Mvc4/Spring.Web.Mvc4.2010.csproj
+++ b/src/Spring/Spring.Web.Mvc4/Spring.Web.Mvc4.2010.csproj
@@ -14,7 +14,6 @@
512
..\..\..\
- true
true
@@ -136,7 +135,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Web.Mvc5/Spring.Web.Mvc5.2010.csproj b/src/Spring/Spring.Web.Mvc5/Spring.Web.Mvc5.2010.csproj
index aefedd907..143298627 100644
--- a/src/Spring/Spring.Web.Mvc5/Spring.Web.Mvc5.2010.csproj
+++ b/src/Spring/Spring.Web.Mvc5/Spring.Web.Mvc5.2010.csproj
@@ -14,7 +14,6 @@
512
..\..\..\
- true
true
@@ -140,7 +139,6 @@
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Web/AssemblyInfo.cs b/src/Spring/Spring.Web/AssemblyInfo.cs
index 1f285198c..2fef74c12 100644
--- a/src/Spring/Spring.Web/AssemblyInfo.cs
+++ b/src/Spring/Spring.Web/AssemblyInfo.cs
@@ -1,13 +1,11 @@
using System.Reflection;
-using System.Security;
using System.Web.UI;
[assembly: AssemblyTitle("Spring.Web")]
[assembly: AssemblyDescription("Interfaces and classes that provide web application support in Spring.Net")]
[assembly: TagPrefix("Spring.Web.UI.Controls", "spring")]
-//[assembly: AssemblyKeyFile(@"C:\users\aseovic\projects\OpenSource\Spring.Net\Spring.Net.PrivateKey.keys")]
#if !NET_4_0
-[assembly: AllowPartiallyTrustedCallers]
-[assembly: SecurityCritical]
+[assembly: System.Security.AllowPartiallyTrustedCallers]
+[assembly: System.Security.SecurityCritical]
#endif
diff --git a/src/Spring/Spring.Web/Context/Support/HttpApplicationConfigurer.cs b/src/Spring/Spring.Web/Context/Support/HttpApplicationConfigurer.cs
index 7911ed985..76dc01673 100644
--- a/src/Spring/Spring.Web/Context/Support/HttpApplicationConfigurer.cs
+++ b/src/Spring/Spring.Web/Context/Support/HttpApplicationConfigurer.cs
@@ -20,12 +20,10 @@
#region Imports
-using System;
using System.Collections;
using System.Web;
using Common.Logging;
using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/Context/Support/WebApplicationContext.cs b/src/Spring/Spring.Web/Context/Support/WebApplicationContext.cs
index 1b10f7b33..48ecf466a 100644
--- a/src/Spring/Spring.Web/Context/Support/WebApplicationContext.cs
+++ b/src/Spring/Spring.Web/Context/Support/WebApplicationContext.cs
@@ -20,7 +20,6 @@
using System;
using System.Collections;
-using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Reflection;
@@ -29,11 +28,8 @@
using System.Xml;
using Common.Logging;
using Spring.Collections;
-using Spring.Objects;
-using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
-using Spring.Objects.Support;
using Spring.Reflection.Dynamic;
using Spring.Util;
using Spring.Core.IO;
diff --git a/src/Spring/Spring.Web/Context/Support/WebApplicationContextArgs.cs b/src/Spring/Spring.Web/Context/Support/WebApplicationContextArgs.cs
index cb70737d2..126b94bcf 100644
--- a/src/Spring/Spring.Web/Context/Support/WebApplicationContextArgs.cs
+++ b/src/Spring/Spring.Web/Context/Support/WebApplicationContextArgs.cs
@@ -18,8 +18,6 @@
#endregion
-
-using System;
using Spring.Core.IO;
namespace Spring.Context.Support
diff --git a/src/Spring/Spring.Web/Core/IO/WebResource.cs b/src/Spring/Spring.Web/Core/IO/WebResource.cs
index 536554251..3dfdf5071 100644
--- a/src/Spring/Spring.Web/Core/IO/WebResource.cs
+++ b/src/Spring/Spring.Web/Core/IO/WebResource.cs
@@ -21,7 +21,7 @@
#region Imports
using System.IO;
-using Spring.Core.IO;
+
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/DataBinding/HttpRequestBindingContainer.cs b/src/Spring/Spring.Web/DataBinding/HttpRequestBindingContainer.cs
index b8da1e796..7d173176f 100644
--- a/src/Spring/Spring.Web/DataBinding/HttpRequestBindingContainer.cs
+++ b/src/Spring/Spring.Web/DataBinding/HttpRequestBindingContainer.cs
@@ -3,11 +3,9 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Reflection;
-using System.Web;
-using Spring.Core;
+
using Spring.Expressions;
using Spring.Globalization;
-using Spring.Objects;
using Spring.Util;
using Spring.Validation;
diff --git a/src/Spring/Spring.Web/DataBinding/IBindingAwareFormatter.cs b/src/Spring/Spring.Web/DataBinding/IBindingAwareFormatter.cs
index 50e541b0e..b4dfb47b6 100644
--- a/src/Spring/Spring.Web/DataBinding/IBindingAwareFormatter.cs
+++ b/src/Spring/Spring.Web/DataBinding/IBindingAwareFormatter.cs
@@ -1,4 +1,3 @@
-using System.Collections;
using System.Collections.Generic;
using Spring.Globalization;
diff --git a/src/Spring/Spring.Web/DataBinding/MultipleSelectionListControlBinding.cs b/src/Spring/Spring.Web/DataBinding/MultipleSelectionListControlBinding.cs
index c217787d1..e04e9b368 100644
--- a/src/Spring/Spring.Web/DataBinding/MultipleSelectionListControlBinding.cs
+++ b/src/Spring/Spring.Web/DataBinding/MultipleSelectionListControlBinding.cs
@@ -2,7 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Web.UI.WebControls;
-using Spring.DataBinding;
+
using Spring.Globalization;
namespace Spring.DataBinding
diff --git a/src/Spring/Spring.Web/Globalization/AspNetResourceCache.cs b/src/Spring/Spring.Web/Globalization/AspNetResourceCache.cs
index d3f36f6d3..0c1330018 100644
--- a/src/Spring/Spring.Web/Globalization/AspNetResourceCache.cs
+++ b/src/Spring/Spring.Web/Globalization/AspNetResourceCache.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Caching;
diff --git a/src/Spring/Spring.Web/Globalization/Resolvers/RequestCultureResolver.cs b/src/Spring/Spring.Web/Globalization/Resolvers/RequestCultureResolver.cs
index ff36c0385..520b997a7 100644
--- a/src/Spring/Spring.Web/Globalization/Resolvers/RequestCultureResolver.cs
+++ b/src/Spring/Spring.Web/Globalization/Resolvers/RequestCultureResolver.cs
@@ -22,7 +22,6 @@
using System.Globalization;
using System.Threading;
using System.Web;
-using Spring.Util;
namespace Spring.Globalization.Resolvers
{
diff --git a/src/Spring/Spring.Web/Objects/Factory/Support/ChildWebObjectDefinition.cs b/src/Spring/Spring.Web/Objects/Factory/Support/ChildWebObjectDefinition.cs
index b06c5332d..ede1e613c 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Support/ChildWebObjectDefinition.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Support/ChildWebObjectDefinition.cs
@@ -20,7 +20,7 @@
using System;
using System.Globalization;
-using System.Web;
+
using Spring.Objects.Factory.Config;
using Spring.Util;
diff --git a/src/Spring/Spring.Web/Objects/Factory/Support/IWebObjectNameGenerator.cs b/src/Spring/Spring.Web/Objects/Factory/Support/IWebObjectNameGenerator.cs
index 70fa4c43f..ba4e8c3a3 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Support/IWebObjectNameGenerator.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Support/IWebObjectNameGenerator.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Objects.Factory.Support
{
///
diff --git a/src/Spring/Spring.Web/Objects/Factory/Support/RootWebObjectDefinition.cs b/src/Spring/Spring.Web/Objects/Factory/Support/RootWebObjectDefinition.cs
index dcf55f381..421ff6adb 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Support/RootWebObjectDefinition.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Support/RootWebObjectDefinition.cs
@@ -22,7 +22,7 @@
using System;
using System.Globalization;
-using System.Web;
+
using Spring.Objects.Factory.Config;
using Spring.Util;
diff --git a/src/Spring/Spring.Web/Objects/Factory/Support/WebInstantiationStrategy.cs b/src/Spring/Spring.Web/Objects/Factory/Support/WebInstantiationStrategy.cs
index d08dc4e3a..b237b3153 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Support/WebInstantiationStrategy.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Support/WebInstantiationStrategy.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectDefinitionFactory.cs b/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectDefinitionFactory.cs
index 50f08d2ec..b54514a97 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectDefinitionFactory.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectDefinitionFactory.cs
@@ -21,7 +21,7 @@
#region Imports
using System;
-using Spring.Core;
+
using Spring.Core.TypeResolution;
using Spring.Objects.Factory.Config;
using Spring.Util;
diff --git a/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectFactory.cs b/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectFactory.cs
index 4520fa2f3..c4e37f591 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectFactory.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Support/WebObjectFactory.cs
@@ -22,7 +22,6 @@
using System;
using System.Collections;
-using System.Collections.Specialized;
using System.Web;
using System.Web.Caching;
using System.Web.SessionState;
diff --git a/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionReader.cs b/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionReader.cs
index 8378d0870..844d34534 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionReader.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionReader.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Web;
using System.Xml;
using Spring.Objects.Factory.Support;
using Spring.Util;
diff --git a/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectsNamespaceParser.cs b/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectsNamespaceParser.cs
index ba3c43ffb..6861dd283 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectsNamespaceParser.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectsNamespaceParser.cs
@@ -20,14 +20,7 @@
#region Imports
-using System;
-using System.Collections;
-using System.Web;
-using System.Xml;
-using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/Spring.Web.2010.csproj b/src/Spring/Spring.Web/Spring.Web.2010.csproj
index 20b745104..949611e5c 100644
--- a/src/Spring/Spring.Web/Spring.Web.2010.csproj
+++ b/src/Spring/Spring.Web/Spring.Web.2010.csproj
@@ -31,7 +31,6 @@
3.5
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Web\Debug\
@@ -305,11 +304,5 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
\ No newline at end of file
+
+
diff --git a/src/Spring/Spring.Web/Util/HttpContextSwitch.cs b/src/Spring/Spring.Web/Util/HttpContextSwitch.cs
index 01984dccb..6f5a2ac63 100644
--- a/src/Spring/Spring.Web/Util/HttpContextSwitch.cs
+++ b/src/Spring/Spring.Web/Util/HttpContextSwitch.cs
@@ -23,7 +23,6 @@
using System;
using System.Web;
using Common.Logging;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/Util/IVirtualEnvironment.cs b/src/Spring/Spring.Web/Util/IVirtualEnvironment.cs
index ce1c05dc0..5ac0924d9 100644
--- a/src/Spring/Spring.Web/Util/IVirtualEnvironment.cs
+++ b/src/Spring/Spring.Web/Util/IVirtualEnvironment.cs
@@ -23,13 +23,7 @@
using System;
using System.Collections;
using System.Collections.Specialized;
-using System.Globalization;
-using System.Reflection;
using System.Web;
-using System.Web.UI;
-using Common.Logging;
-using Spring.Context;
-using Spring.Objects.Factory;
#endregion
diff --git a/src/Spring/Spring.Web/Web/Providers/ConfigurableActiveDirectoryMembershipProvider.cs b/src/Spring/Spring.Web/Web/Providers/ConfigurableActiveDirectoryMembershipProvider.cs
index 1a197c4aa..9ed6215a6 100644
--- a/src/Spring/Spring.Web/Web/Providers/ConfigurableActiveDirectoryMembershipProvider.cs
+++ b/src/Spring/Spring.Web/Web/Providers/ConfigurableActiveDirectoryMembershipProvider.cs
@@ -22,11 +22,7 @@
#region Imports
-using System.Collections.Specialized;
-using System.DirectoryServices;
-using System.Security.Permissions;
-using System.Web;
-using System.Web.Security;
+
#endregion
diff --git a/src/Spring/Spring.Web/Web/Support/ControlInterceptor.cs b/src/Spring/Spring.Web/Web/Support/ControlInterceptor.cs
index b15dccfa8..a444e2b0a 100644
--- a/src/Spring/Spring.Web/Web/Support/ControlInterceptor.cs
+++ b/src/Spring/Spring.Web/Web/Support/ControlInterceptor.cs
@@ -18,7 +18,6 @@
#region Imports
-using System;
using System.Collections;
using System.Web.UI;
using Common.Logging;
diff --git a/src/Spring/Spring.Web/Web/Support/DefaultResultWebNavigator.cs b/src/Spring/Spring.Web/Web/Support/DefaultResultWebNavigator.cs
index 40bf5b6de..0084f9b98 100644
--- a/src/Spring/Spring.Web/Web/Support/DefaultResultWebNavigator.cs
+++ b/src/Spring/Spring.Web/Web/Support/DefaultResultWebNavigator.cs
@@ -24,7 +24,6 @@
using System.Collections;
using Spring.Collections;
using Spring.Core;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/Web/Support/ISupportsWebDependencyInjection.cs b/src/Spring/Spring.Web/Web/Support/ISupportsWebDependencyInjection.cs
index 557702d45..206e4c8e5 100644
--- a/src/Spring/Spring.Web/Web/Support/ISupportsWebDependencyInjection.cs
+++ b/src/Spring/Spring.Web/Web/Support/ISupportsWebDependencyInjection.cs
@@ -19,8 +19,6 @@
#region Imports
using Spring.Context;
-using Spring.Context.Support;
-using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/Web/Support/MappingHandlerFactory.cs b/src/Spring/Spring.Web/Web/Support/MappingHandlerFactory.cs
index 8b324118b..426c9b96a 100644
--- a/src/Spring/Spring.Web/Web/Support/MappingHandlerFactory.cs
+++ b/src/Spring/Spring.Web/Web/Support/MappingHandlerFactory.cs
@@ -24,7 +24,6 @@
using System.Net;
using System.Web;
using Spring.Context;
-using Spring.Context.Support;
#endregion
diff --git a/src/Spring/Spring.Web/Web/Support/PageHandlerFactory.cs b/src/Spring/Spring.Web/Web/Support/PageHandlerFactory.cs
index de16eaec6..2badcc8f5 100644
--- a/src/Spring/Spring.Web/Web/Support/PageHandlerFactory.cs
+++ b/src/Spring/Spring.Web/Web/Support/PageHandlerFactory.cs
@@ -20,11 +20,9 @@
#region Imports
-using System;
using System.Collections;
-using System.Security.Permissions;
using System.Web;
-using System.Web.UI;
+
using Spring.Context;
using Spring.Context.Support;
using Spring.Objects;
diff --git a/src/Spring/Spring.Web/Web/Support/SharedStateResourceCache.cs b/src/Spring/Spring.Web/Web/Support/SharedStateResourceCache.cs
index 14f51274e..96c339307 100644
--- a/src/Spring/Spring.Web/Web/Support/SharedStateResourceCache.cs
+++ b/src/Spring/Spring.Web/Web/Support/SharedStateResourceCache.cs
@@ -20,7 +20,6 @@
#region Imports
-using System.Collections;
using System.Collections.Generic;
using Spring.Globalization;
using Spring.Objects;
diff --git a/src/Spring/Spring.Web/Web/Support/SupportsWebDependencyInjectionTypeBuilder.cs b/src/Spring/Spring.Web/Web/Support/SupportsWebDependencyInjectionTypeBuilder.cs
index d6ebca720..fc4c33b2c 100644
--- a/src/Spring/Spring.Web/Web/Support/SupportsWebDependencyInjectionTypeBuilder.cs
+++ b/src/Spring/Spring.Web/Web/Support/SupportsWebDependencyInjectionTypeBuilder.cs
@@ -24,7 +24,6 @@
using Spring.Context;
using Spring.Proxy;
-using Spring.Web.Support;
using Spring.Util;
#endregion
diff --git a/src/Spring/Spring.Web/Web/Support/WebFormsResultWebNavigator.cs b/src/Spring/Spring.Web/Web/Support/WebFormsResultWebNavigator.cs
index fd85e6f21..08a410561 100644
--- a/src/Spring/Spring.Web/Web/Support/WebFormsResultWebNavigator.cs
+++ b/src/Spring/Spring.Web/Web/Support/WebFormsResultWebNavigator.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using System.Web.UI;
using Spring.Util;
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/AbstractValidationControl.cs b/src/Spring/Spring.Web/Web/UI/Controls/AbstractValidationControl.cs
index 8d82eaf68..4c7dd6bff 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/AbstractValidationControl.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/AbstractValidationControl.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Web.UI;
using Spring.Context;
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/Calendar.cs b/src/Spring/Spring.Web/Web/UI/Controls/Calendar.cs
index da21e37d7..2ba3cab04 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/Calendar.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/Calendar.cs
@@ -22,7 +22,6 @@
using System;
using System.Collections.Specialized;
-using System.IO;
using System.Threading;
using System.Web.UI;
using System.Web.UI.WebControls;
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/Content.cs b/src/Spring/Spring.Web/Web/UI/Controls/Content.cs
index 9c979fa1c..d91f3377b 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/Content.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/Content.cs
@@ -20,9 +20,7 @@
#region Imports
-using System;
-using System.ComponentModel;
-using System.Web.UI;
+
#endregion
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/DataBindingPanel.cs b/src/Spring/Spring.Web/Web/UI/Controls/DataBindingPanel.cs
index a10db65bd..d68d14845 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/DataBindingPanel.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/DataBindingPanel.cs
@@ -29,11 +29,10 @@
using System.Web.UI.WebControls;
using Common.Logging;
-using Spring.Core;
+
using Spring.Core.TypeResolution;
using Spring.DataBinding;
using Spring.Globalization;
-using Spring.Objects;
using Spring.Util;
using AttributeCollection=System.Web.UI.AttributeCollection;
using BindingDirection=Spring.DataBinding.BindingDirection;
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/Form.cs b/src/Spring/Spring.Web/Web/UI/Controls/Form.cs
index 23117cf49..71a3f5882 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/Form.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/Form.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/Head.cs b/src/Spring/Spring.Web/Web/UI/Controls/Head.cs
index 9acf4923f..ec13ff86c 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/Head.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/Head.cs
@@ -19,7 +19,6 @@
#endregion
using System.Collections;
-using System.IO;
using System.Web.UI;
using Spring.Util;
using Spring.Web.Support;
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/Panel.cs b/src/Spring/Spring.Web/Web/UI/Controls/Panel.cs
index 2ee702cf2..bc38eb8c4 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/Panel.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/Panel.cs
@@ -21,17 +21,13 @@
#region Imports
using System;
-using System.Collections;
using System.ComponentModel;
-using System.Diagnostics;
-using System.Reflection;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
-using System.Web.UI.HtmlControls;
+
using Spring.Context;
using Spring.Context.Support;
-using Spring.Util;
using Spring.Web.Support;
#endregion
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/RadioButtonGroup.cs b/src/Spring/Spring.Web/Web/UI/Controls/RadioButtonGroup.cs
index 362728921..abfd888b1 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/RadioButtonGroup.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/RadioButtonGroup.cs
@@ -19,13 +19,11 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
-using Spring.Util;
namespace Spring.Web.UI.Controls
{
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventArgs.cs b/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventArgs.cs
index fe56f3847..863eae3a0 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventArgs.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventArgs.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
#endregion
using System.Web.UI.WebControls;
diff --git a/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventHandler.cs b/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventHandler.cs
index c4f8ddf24..d1d28e116 100644
--- a/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventHandler.cs
+++ b/src/Spring/Spring.Web/Web/UI/Controls/TabCommandEventHandler.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/src/Spring/Spring.Web/Web/UI/MasterPage.cs b/src/Spring/Spring.Web/Web/UI/MasterPage.cs
index bbe409c76..7b35dd801 100644
--- a/src/Spring/Spring.Web/Web/UI/MasterPage.cs
+++ b/src/Spring/Spring.Web/Web/UI/MasterPage.cs
@@ -23,7 +23,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Collections.Specialized;
using System.Web.UI;
using Spring.Collections;
using Spring.Validation;
diff --git a/src/Spring/Spring.Web/Web/UI/Validation/AbstractValidationErrorsRenderer.cs b/src/Spring/Spring.Web/Web/UI/Validation/AbstractValidationErrorsRenderer.cs
index 1285cb06c..9f0ff3328 100644
--- a/src/Spring/Spring.Web/Web/UI/Validation/AbstractValidationErrorsRenderer.cs
+++ b/src/Spring/Spring.Web/Web/UI/Validation/AbstractValidationErrorsRenderer.cs
@@ -18,10 +18,8 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Web.UI;
-using Page=Spring.Web.UI.Page;
namespace Spring.Web.UI.Validation
{
diff --git a/src/Spring/Spring.Web/Web/UI/Validation/DivValidationErrorsRenderer.cs b/src/Spring/Spring.Web/Web/UI/Validation/DivValidationErrorsRenderer.cs
index b64b4a412..df751e631 100644
--- a/src/Spring/Spring.Web/Web/UI/Validation/DivValidationErrorsRenderer.cs
+++ b/src/Spring/Spring.Web/Web/UI/Validation/DivValidationErrorsRenderer.cs
@@ -18,11 +18,8 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Web.UI;
-using Spring.Web.UI.Validation;
-using Page=Spring.Web.UI.Page;
namespace Spring.Web.UI.Validation
{
diff --git a/src/Spring/Spring.Web/Web/UI/Validation/IValidationErrorsRenderer.cs b/src/Spring/Spring.Web/Web/UI/Validation/IValidationErrorsRenderer.cs
index 8a0c4bae0..bd74303cc 100644
--- a/src/Spring/Spring.Web/Web/UI/Validation/IValidationErrorsRenderer.cs
+++ b/src/Spring/Spring.Web/Web/UI/Validation/IValidationErrorsRenderer.cs
@@ -18,14 +18,11 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Web.UI;
using Spring.Web.UI.Controls;
-using Page=Spring.Web.UI.Page;
-
namespace Spring.Web.UI.Validation
{
///
diff --git a/src/Spring/Spring.Web/Web/UI/Validation/SpanValidationErrorsRenderer.cs b/src/Spring/Spring.Web/Web/UI/Validation/SpanValidationErrorsRenderer.cs
index 5d22bbcfb..ddd05f164 100644
--- a/src/Spring/Spring.Web/Web/UI/Validation/SpanValidationErrorsRenderer.cs
+++ b/src/Spring/Spring.Web/Web/UI/Validation/SpanValidationErrorsRenderer.cs
@@ -18,13 +18,10 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.Web.UI;
using Spring.Web.UI.Controls;
-using Spring.Web.UI.Validation;
-using Page=Spring.Web.UI.Page;
namespace Spring.Web.UI.Validation
{
diff --git a/test/Spring/CommonAssemblyInfo.cs b/test/Spring/CommonAssemblyInfo.cs
index f841e7e18..56d53108b 100644
--- a/test/Spring/CommonAssemblyInfo.cs
+++ b/test/Spring/CommonAssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs
index 4171f5df0..36610422d 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs
@@ -54,17 +54,15 @@ protected abstract AbstractMethodInvocation CreateMethodInvocation(
object[] arguments, Type targetType, IList interceptors);
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullMethod()
{
- CreateMethodInvocation(null, this, null, null, null, GetType(), null);
+ Assert.Throws(() => CreateMethodInvocation(null, this, null, null, null, GetType(), null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullTarget()
{
- CreateMethodInvocation(null, null, null, null, null, GetType(), null);
+ Assert.Throws(() => CreateMethodInvocation(null, null, null, null, null, GetType(), null));
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs
index c3d4eb313..0b04f1d0c 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs
@@ -39,10 +39,9 @@ namespace Spring.Aop.Framework.Adapter
public sealed class AfterReturningAdviceInterceptorTests
{
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void PassNullAdviceToCtor()
{
- new AfterReturningAdviceInterceptor(null);
+ Assert.Throws(() => new AfterReturningAdviceInterceptor(null));
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs
index 32453266b..a7a5263ff 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs
@@ -42,17 +42,15 @@ namespace Spring.Aop.Framework.Adapter
public sealed class ThrowsAdviceInterceptorTests
{
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void NoHandlerMethods()
{
- new ThrowsAdviceInterceptor(new object());
+ Assert.Throws(() => new ThrowsAdviceInterceptor(new object()));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void PassNullAdviceToCtor()
{
- new ThrowsAdviceInterceptor(null);
+ Assert.Throws(() => new ThrowsAdviceInterceptor(null));
}
[Test]
@@ -163,11 +161,10 @@ public void NestedInnerExceptionsAreNotPickedUp()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ChokesOnHandlerWhereMultipleMethodsAreApplicable()
{
object throwsHandler = new MultipleMethodsAreApplicableThrowsHandler();
- new ThrowsAdviceInterceptor(throwsHandler);
+ Assert.Throws(() => new ThrowsAdviceInterceptor(throwsHandler));
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AopContextTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AopContextTests.cs
index f72337e1c..8b6fa315a 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AopContextTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AopContextTests.cs
@@ -25,10 +25,8 @@
using AopAlliance.Aop;
using NUnit.Framework;
-using Spring.Objects;
using AopAlliance.Intercept;
using Spring.Threading;
-using Spring.Util;
#endregion
@@ -58,10 +56,9 @@ public void SetUp()
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void CurrentProxyChokesIfNoAopProxyIsOnTheStack()
{
- AopContext.CurrentProxy.ToString();
+ Assert.Throws(() => AopContext.CurrentProxy.ToString());
}
[Test]
@@ -79,10 +76,9 @@ public void CurrentProxyStackJustPeeksItDoesntPop()
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void PopProxyWithNothingOnStack()
{
- AopContext.PopProxy();
+ Assert.Throws(() => AopContext.PopProxy());
}
[Test(Description = "SPRNET-1158")]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AttributeAutoProxyCreatorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AttributeAutoProxyCreatorTests.cs
index fe22d7ef0..5f1f85f11 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AttributeAutoProxyCreatorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AttributeAutoProxyCreatorTests.cs
@@ -56,19 +56,17 @@ public void SomeMethod() {}
}
[Test]
- [ExpectedException( typeof( ArgumentNullException ) )]
public void ThrowsOnMissingAttributeTypeList()
{
AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
- apc.PostProcessAfterInitialization( new ApcTestObject(), "testObject" );
+ Assert.Throws(() => apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject"));
}
[Test]
- [ExpectedException( typeof( ArgumentNullException ) )]
public void ThrowsOnAssigningNullAttributeList()
{
AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
- apc.AttributeTypes = null;
+ Assert.Throws(() => apc.AttributeTypes = null);
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/PointcutFilteringAutoProxyCreatorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/PointcutFilteringAutoProxyCreatorTests.cs
index 28e32eaa9..6e5894248 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/PointcutFilteringAutoProxyCreatorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/PointcutFilteringAutoProxyCreatorTests.cs
@@ -55,11 +55,10 @@ public void DoesNotCreateProxyIfNoPointcutMatch()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ThrowsArgumentExceptionIfNoCriteriaSpecified()
{
PointcutFilteringAutoProxyCreator apc = new PointcutFilteringAutoProxyCreator();
- apc.PostProcessAfterInitialization( new TestObject(), "testObject" );
+ Assert.Throws(() => apc.PostProcessAfterInitialization(new TestObject(), "testObject"));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/TypeNameAutoProxyCreatorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/TypeNameAutoProxyCreatorTests.cs
index 7e9733971..84ed61904 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/TypeNameAutoProxyCreatorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/TypeNameAutoProxyCreatorTests.cs
@@ -39,19 +39,17 @@ private class MyLocalTestObject: TestObject
{}
[Test]
- [ExpectedException( typeof( ArgumentNullException ) )]
public void ThrowsOnMissingTypeNames()
{
TypeNameAutoProxyCreator apc = new TypeNameAutoProxyCreator();
- apc.PostProcessAfterInitialization( new TestObject(), "testObject" );
+ Assert.Throws(() => apc.PostProcessAfterInitialization(new TestObject(), "testObject"));
}
[Test]
- [ExpectedException( typeof( ArgumentNullException ) )]
public void ThrowsOnAssigningNullTypeNames()
{
TypeNameAutoProxyCreator apc = new TypeNameAutoProxyCreator();
- apc.TypeNames = null;
+ Assert.Throws(() => apc.TypeNames = null);
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingAfterReturningAdvice.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingAfterReturningAdvice.cs
index 612e5ad45..71cb49dcf 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingAfterReturningAdvice.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingAfterReturningAdvice.cs
@@ -21,7 +21,7 @@
#region Imports
using System;
using System.Reflection;
-using Spring.Aop.Framework;
+
#endregion
namespace Spring.Aop.Framework
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingBeforeAdvice.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingBeforeAdvice.cs
index 86da270fb..3aac75744 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingBeforeAdvice.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingBeforeAdvice.cs
@@ -21,7 +21,7 @@
#region Imports
using System;
using System.Reflection;
-using Spring.Aop.Framework;
+
#endregion
namespace Spring.Aop.Framework
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingMultiAdvice.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingMultiAdvice.cs
index ddb22005c..866d1815d 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingMultiAdvice.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingMultiAdvice.cs
@@ -22,7 +22,6 @@
using System;
using System.Reflection;
-using Spring.Aop.Framework;
#endregion
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingThrowsAdvice.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingThrowsAdvice.cs
index fe7388276..e5f5794ec 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingThrowsAdvice.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/CountingThrowsAdvice.cs
@@ -21,8 +21,6 @@
#region Imports
using System;
-using System.Reflection;
-using Spring.Aop.Framework;
#endregion
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs
index 0d5c0b554..c7229e632 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs
@@ -64,7 +64,7 @@ public abstract class AbstractAopProxyTests
* to ensure that it was used appropriately by code.
*/
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// SystemUtils.RegisterLoadedAssemblyResolver();
@@ -322,8 +322,6 @@ public virtual void Equality()
}
[Test]
- [ExpectedException(typeof(NotSupportedException)
- , ExpectedMessage = "Target 'target' is null.")]
public void Does_proxy_interfacemethods_without_implementation_and_by_default_throws_NotSupportedException()
{
AdvisedSupport advised = new AdvisedSupport();
@@ -333,7 +331,7 @@ public void Does_proxy_interfacemethods_without_implementation_and_by_default_th
ITestObject proxy = CreateProxy(advised) as ITestObject;
Assert.IsNotNull(proxy);
- proxy.GetDescription();
+ Assert.Throws(() => proxy.GetDescription(), "Target 'target' is null.");
}
[Test]
@@ -357,7 +355,6 @@ public void Does_proxy_interfacemethods_without_implementation_and_delegates_to_
}
[Test]
- [ExpectedException(typeof(ArgumentNullException), MatchType=MessageMatch.Contains, UserMessage="'target'")]
public void Does_proxy_interfacemethods_without_implementation_and_throws_ArgumentNullException_On_NullTarget()
{
DynamicInvocationTestInterceptor invocationInterceptor = new DynamicInvocationTestInterceptor();
@@ -373,12 +370,11 @@ public void Does_proxy_interfacemethods_without_implementation_and_throws_Argume
// target null, call not handled by interceptor
targetSource.Target = null;
invocationInterceptor.CallProceed = true;
- proxy.GetDescription();
+ var ex = Assert.Throws(() => proxy.GetDescription());
+ Assert.That(ex.Message, Does.Contain("'target'"));
}
[Test]
- [ExpectedException(typeof(NotSupportedException)
- , ExpectedMessage = "Target 'target' of type 'System.Object' does not support methods of 'Spring.Objects.ITestObject'.")]
public void Does_proxy_interfacemethods_without_implementation_and_throws_NotSupportedException_On_Incompatible_Target()
{
DynamicInvocationTestInterceptor invocationInterceptor = new DynamicInvocationTestInterceptor();
@@ -394,19 +390,17 @@ public void Does_proxy_interfacemethods_without_implementation_and_throws_NotSup
// target incompatible, call not handled by interceptor
targetSource.Target = new object();
invocationInterceptor.CallProceed = true;
- proxy.GetDescription();
+ Assert.Throws(() => proxy.GetDescription(), "Target 'target' of type 'System.Object' does not support methods of 'Spring.Objects.ITestObject'.");
}
[Test]
- [ExpectedException(typeof(NotSupportedException)
- , ExpectedMessage = "Target 'target' of type 'System.Object' does not support methods of 'Spring.Objects.ITestObject'.")]
public void NoInterceptorWithNoTarget()
{
AdvisedSupport advised = new AdvisedSupport();
advised.Interfaces = new Type[] { typeof(ITestObject) };
ITestObject to = CreateProxy(advised) as ITestObject;
- to.GetDescription();
+ Assert.Throws(() => to.GetDescription(), "Target 'target' of type 'System.Object' does not support methods of 'Spring.Objects.ITestObject'.");
}
[Test]
@@ -426,8 +420,6 @@ public void InterceptorHandledCallWithNoTarget()
}
[Test]
- [ExpectedException(typeof(NotSupportedException)
- , ExpectedMessage = "Target 'target' of type 'System.Object' does not support methods of 'Spring.Objects.ITestObject'.")]
public void InterceptorUnhandledCallWithNoTarget()
{
AdvisedSupport advised = new AdvisedSupport();
@@ -436,7 +428,7 @@ public void InterceptorUnhandledCallWithNoTarget()
ITestObject to = CreateProxy(advised) as ITestObject;
Assert.IsNotNull(to);
- to.GetDescription();
+ Assert.Throws(() => to.GetDescription(), "Target 'target' of type 'System.Object' does not support methods of 'Spring.Objects.ITestObject'.");
}
[Test]
@@ -1388,14 +1380,13 @@ public void TargetCanGetProxyEvenIfNoAdviceChain()
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void TargetCantGetProxyByDefault()
{
NeedsToSeeProxy et = new NeedsToSeeProxy();
ProxyFactory pf1 = new ProxyFactory(et);
Assert.IsFalse(pf1.ExposeProxy);
INeedsToSeeProxy proxied = (INeedsToSeeProxy)CreateProxy(pf1);
- proxied.IncrementViaProxy();
+ Assert.Throws(() => proxied.IncrementViaProxy());
}
#region TargetReturnsThis
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AopUtilsTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AopUtilsTests.cs
index ce44b58ae..7431b9021 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AopUtilsTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AopUtilsTests.cs
@@ -124,10 +124,9 @@ public void GetAllInterfacesWithNull()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void GetAllInterfacesFromTypeWithNull()
{
- AopUtils.GetAllInterfacesFromType(null);
+ Assert.Throws(() => AopUtils.GetAllInterfacesFromType(null));
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/CachedAopProxyFactoryTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/CachedAopProxyFactoryTests.cs
index 73ef9d7d3..74bb37b36 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/CachedAopProxyFactoryTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/CachedAopProxyFactoryTests.cs
@@ -21,8 +21,6 @@
#region Imports
using System;
-using System.Reflection;
-using System.Collections;
using NUnit.Framework;
using Spring.Objects;
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DecoratorAopProxyTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DecoratorAopProxyTests.cs
index cab6573f6..02af77a8d 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DecoratorAopProxyTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DecoratorAopProxyTests.cs
@@ -61,7 +61,6 @@ public override void Equality()
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void CannotProxySealedClass()
{
SealedTestObject target = new SealedTestObject();
@@ -69,11 +68,10 @@ public void CannotProxySealedClass()
AdvisedSupport advised = new AdvisedSupport(new Type[] { });
advised.TargetSource = mockTargetSource;
- IAopProxy aop = CreateAopProxy(advised);
+ Assert.Throws(() => CreateAopProxy(advised));
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void CannotProxyNonPublicClass()
{
NonPublicTestObject target = new NonPublicTestObject();
@@ -81,7 +79,7 @@ public void CannotProxyNonPublicClass()
AdvisedSupport advised = new AdvisedSupport(new Type[] { });
advised.TargetSource = mockTargetSource;
- IAopProxy aop = CreateAopProxy(advised);
+ Assert.Throws(() => CreateAopProxy(advised));
}
[Test]
@@ -224,15 +222,23 @@ public void InterceptFinalMethodThatBelongsToAnInterface()
}
[Test]
- [ExpectedException(typeof(AopConfigException), ExpectedMessage="Cannot create decorator-based IAopProxy for a non visible class [Spring.Aop.Framework.DynamicProxy.AbstractAopProxyTests+InternalRefOutTestObject]")]
public override void ProxyMethodWithRefOutParametersWithStandardReflection()
{
- base.ProxyMethodWithRefOutParametersWithStandardReflection();
+ Assert.Throws(() => ProxyMethodWithRefOutParametersWithStandardReflectionWrapped(), "Cannot create decorator-based IAopProxy for a non visible class [Spring.Aop.Framework.DynamicProxy.AbstractAopProxyTests+InternalRefOutTestObject]");
+ }
+
+ private void ProxyMethodWithRefOutParametersWithStandardReflectionWrapped()
+ {
+ base.ProxyMethodWithRefOutParametersWithStandardReflection();
}
[Test]
- [ExpectedException(typeof(AopConfigException), ExpectedMessage="Cannot create decorator-based IAopProxy for a non visible class [Spring.Aop.Framework.DynamicProxy.AbstractAopProxyTests+InternalRefOutGenericTestObject]")]
public override void ProxyGenericMethodWithRefOutParametersWithStandardReflection()
+ {
+ Assert.Throws(() => ProxyGenericMethodWithRefOutParametersWithStandardReflectionWrapped(), "Cannot create decorator-based IAopProxy for a non visible class [Spring.Aop.Framework.DynamicProxy.AbstractAopProxyTests+InternalRefOutGenericTestObject]");
+ }
+
+ private void ProxyGenericMethodWithRefOutParametersWithStandardReflectionWrapped()
{
base.ProxyGenericMethodWithRefOutParametersWithStandardReflection();
}
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DefaultAopProxyFactoryTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DefaultAopProxyFactoryTests.cs
index 3705daaa3..b551b2785 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DefaultAopProxyFactoryTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/DefaultAopProxyFactoryTests.cs
@@ -44,19 +44,17 @@ protected virtual IAopProxy CreateAopProxy(ProxyFactory advisedSupport)
}
[Test]
- [ExpectedException(typeof(AopConfigException), ExpectedMessage="Cannot create IAopProxy with null ProxyConfig")]
public void NullConfig()
{
IAopProxyFactory apf = new DefaultAopProxyFactory();
- apf.CreateAopProxy(null);
+ Assert.Throws(() => apf.CreateAopProxy(null),"Cannot create IAopProxy with null ProxyConfig" );
}
[Test]
- [ExpectedException(typeof(AopConfigException), ExpectedMessage="Cannot create IAopProxy with no advisors and no target source")]
public void NoInterceptorsAndNoTarget()
{
ProxyFactory advisedSupport = new ProxyFactory(new Type[] { typeof(ITestObject) });
- CreateAopProxy(advisedSupport);
+ Assert.Throws(() => CreateAopProxy(advisedSupport), "Cannot create IAopProxy with no advisors and no target source");
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/IsAopProxyTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/IsAopProxyTests.cs
index 29e8afa1b..5da275758 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/IsAopProxyTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/IsAopProxyTests.cs
@@ -1,5 +1,4 @@
-using System;
-using NUnit.Framework;
+using NUnit.Framework;
using Spring.Aop.Advice;
using Spring.Context.Support;
using Spring.Objects;
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/MockTargetSource.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/MockTargetSource.cs
index 752eb8d2f..ae5394f55 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/MockTargetSource.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/MockTargetSource.cs
@@ -22,8 +22,6 @@
using System;
-using Spring.Aop.Target;
-
#endregion
namespace Spring.Aop.Framework.DynamicProxy
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/HashtableCachingAdvisorChainFactoryTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/HashtableCachingAdvisorChainFactoryTests.cs
index b7a13371e..4433f8020 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/HashtableCachingAdvisorChainFactoryTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/HashtableCachingAdvisorChainFactoryTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
@@ -40,7 +38,7 @@ public sealed class HashtableCachingAdvisorChainFactoryTests
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
}
@@ -68,7 +66,7 @@ public void TearDown()
///
/// The tear down logic executed after the entire test fixture has executed.
///
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void FixtureTearDown()
{
}
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/PrototypeTargetTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/PrototypeTargetTests.cs
index 17d676bd7..c447ff458 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/PrototypeTargetTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/PrototypeTargetTests.cs
@@ -17,7 +17,6 @@
#endregion
#region Imports
-using System;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Xml;
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs
index de3b5d0d9..89d352bcd 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs
@@ -454,24 +454,23 @@ public void CanAddThrowsAdviceWithoutAdvisor()
/// to be included in proxiedInterface [].
///
[Test]
- [ExpectedException(typeof(InvalidCastException))]
public void GlobalsCanAddAspectInterfaces()
{
- IAddedGlobalInterface agi = (IAddedGlobalInterface)factory.GetObject("autoInvoker");
+ IAddedGlobalInterface agi = (IAddedGlobalInterface) factory.GetObject("autoInvoker");
Assert.IsTrue(agi.GlobalsAdded == -1);
- ProxyFactoryObject pfb = (ProxyFactoryObject)factory.GetObject("&validGlobals");
+ ProxyFactoryObject pfb = (ProxyFactoryObject) factory.GetObject("&validGlobals");
pfb.GetObject(); // for creation
Assert.AreEqual(2, pfb.Advisors.Count, "Proxy should have 1 global and 1 explicit advisor");
Assert.AreEqual(1, pfb.Introductions.Count, "Proxy should have 1 global introduction");
- agi.GlobalsAdded = ((IAdvised)agi).Introductions.Count;
+ agi.GlobalsAdded = ((IAdvised) agi).Introductions.Count;
Assert.IsTrue(agi.GlobalsAdded == 1);
- IApplicationEventListener l = (IApplicationEventListener)factory.GetObject("validGlobals");
- agi = (IAddedGlobalInterface)l;
+ IApplicationEventListener l = (IApplicationEventListener) factory.GetObject("validGlobals");
+ agi = (IAddedGlobalInterface) l;
Assert.IsTrue(agi.GlobalsAdded == -1);
- agi = (IAddedGlobalInterface)factory.GetObject("test1");
+ Assert.Throws(() => factory.GetObject("test1"));
}
[Test]
@@ -542,21 +541,19 @@ public void AddAdvisorWhenConfigIsFrozen()
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void RemoveAdvisorWhenConfigIsFrozen()
{
ProxyFactoryObject fac = CreateFrozenProxyFactory();
fac.IsFrozen = true;
- fac.RemoveAdvisor(new PointcutForVoid());
+ Assert.Throws(() => fac.RemoveAdvisor(new PointcutForVoid()));
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void ReplaceAdvisorWhenConfigIsFrozen()
{
ProxyFactoryObject fac = CreateFrozenProxyFactory();
fac.IsFrozen = true;
- fac.ReplaceAdvisor(new PointcutForVoid(), new PointcutForVoid());
+ Assert.Throws(() => fac.ReplaceAdvisor(new PointcutForVoid(), new PointcutForVoid()));
}
[Test]
@@ -746,35 +743,31 @@ public void PassEmptyInterceptorNamesArray_WithTargetThatImplementsAnInterfaceCa
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void PassNullToTheProxyInterfacesProperty()
{
ProxyFactoryObject fac = new ProxyFactoryObject();
- fac.ProxyInterfaces = null;
+ Assert.Throws(() => fac.ProxyInterfaces = null);
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void PassClassNotInterfaceNameToTheProxyInterfacesProperty()
{
ProxyFactoryObject fac = new ProxyFactoryObject();
- fac.ProxyInterfaces = new string[] { typeof(GoodCommand).FullName };
+ Assert.Throws(() => fac.ProxyInterfaces = new string[] { typeof(GoodCommand).FullName });
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void PassRubbishNameToTheProxyInterfacesProperty()
{
ProxyFactoryObject fac = new ProxyFactoryObject();
- fac.ProxyInterfaces = new string[] { "Hey" };
+ Assert.Throws(() => fac.ProxyInterfaces = new string[] { "Hey" });
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void PassNullElementListToTheProxyInterfacesProperty()
{
ProxyFactoryObject fac = new ProxyFactoryObject();
- fac.ProxyInterfaces = new string[] { null };
+ Assert.Throws(() => fac.ProxyInterfaces = new string[] { null });
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs
index a2b2b6739..7987ea7d4 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs
@@ -225,26 +225,23 @@ public void CreateProxyFactoryWithoutTargetThenSetTarget()
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void InstantiateWithNullTarget()
{
- new ProxyFactory((object)null);
+ Assert.Throws(() => new ProxyFactory((object) null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void AddNullInterface()
{
- new ProxyFactory().AddInterface(null);
+ Assert.Throws(() => new ProxyFactory().AddInterface(null));
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void AddInterfaceWhenConfigurationIsFrozen()
{
ProxyFactory factory = new ProxyFactory();
factory.IsFrozen = true;
- factory.AddInterface(typeof(ITestObject));
+ Assert.Throws(() => factory.AddInterface(typeof(ITestObject)));
}
[Test]
@@ -609,12 +606,11 @@ public void RemoveAdvisedSupportListener()
}
[Test]
- [ExpectedException(typeof(AopConfigException))]
public void Frozen_RemoveAdvisor()
{
ProxyFactory factory = new ProxyFactory();
factory.IsFrozen = true;
- factory.RemoveAdvisor(null);
+ Assert.Throws(() => factory.RemoveAdvisor(null));
}
public interface IMultiProxyingTestInterface
diff --git a/test/Spring/Spring.Aop.Tests/Aop/ISimpleBeforeAdvice.cs b/test/Spring/Spring.Aop.Tests/Aop/ISimpleBeforeAdvice.cs
index 38e7c860e..7448291b8 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/ISimpleBeforeAdvice.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/ISimpleBeforeAdvice.cs
@@ -17,7 +17,9 @@
#endregion
#region Imports
-using System;
+
+
+
#endregion
namespace Spring.Aop
diff --git a/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceImpl.cs b/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceImpl.cs
index f339c5b24..7e59d2276 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceImpl.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceImpl.cs
@@ -17,7 +17,9 @@
#endregion
#region Imports
-using System;
+
+
+
#endregion
namespace Spring.Aop
diff --git a/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceInterceptor.cs b/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceInterceptor.cs
index 5c86979fd..af5ef65df 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceInterceptor.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/SimpleBeforeAdviceInterceptor.cs
@@ -17,7 +17,6 @@
#endregion
#region Imports
-using System;
using AopAlliance.Intercept;
#endregion
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Support/AttributeMatchMethodPointcutTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Support/AttributeMatchMethodPointcutTests.cs
index a3face483..0d665783f 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Support/AttributeMatchMethodPointcutTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Support/AttributeMatchMethodPointcutTests.cs
@@ -43,18 +43,16 @@ public void InstantiationWithASunnyDayAttributeType()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void InstantiationWithNonAttributeType()
{
- new AttributeMatchMethodPointcut(GetType());
+ Assert.Throws(() => new AttributeMatchMethodPointcut(GetType()));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void AttributeSetterWithNonAttributeType()
{
AttributeMatchMethodPointcut cut = new AttributeMatchMethodPointcut();
- cut.Attribute = GetType();
+ Assert.Throws(() => cut.Attribute = GetType());
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Support/DefaultIntroductionAdvisorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Support/DefaultIntroductionAdvisorTests.cs
index 455205c85..4bccbf245 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Support/DefaultIntroductionAdvisorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Support/DefaultIntroductionAdvisorTests.cs
@@ -1,19 +1,19 @@
#region License
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * Copyright 2002-2010 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#endregion
@@ -69,18 +69,16 @@ public void EqualsOnAdviceEqualAndInterfacesEqual()
}
[Test]
- [ExpectedException(typeof(ArgumentException), ExpectedMessage = "Type [Spring.Aop.Support.DefaultIntroductionAdvisorTests] is not an interface; cannot be used in an introduction.")]
public void BailsIfInterfaceTypeIsNotAnInterface()
{
- DefaultIntroductionAdvisor a = new DefaultIntroductionAdvisor(new TestIntroductionAdvice(), this.GetType());
+ Assert.Throws(() => new DefaultIntroductionAdvisor(new TestIntroductionAdvice(), GetType()), "Type [Spring.Aop.Support.DefaultIntroductionAdvisorTests] is not an interface; cannot be used in an introduction.");
}
[Test]
- [ExpectedException(typeof(ArgumentException), ExpectedMessage = "Introduction [Spring.Aop.Support.DefaultIntroductionAdvisorTests+TestIntroductionAdvice] does not implement interface 'System.ICloneable' specified in introduction advice.")]
public void IntroductionMustImplementIntroducedInterfaces()
{
DefaultIntroductionAdvisor advisor = new DefaultIntroductionAdvisor(new TestIntroductionAdvice(), typeof(ICloneable));
- advisor.ValidateInterfaces();
+ Assert.Throws(() => advisor.ValidateInterfaces(), "Introduction [Spring.Aop.Support.DefaultIntroductionAdvisorTests+TestIntroductionAdvice] does not implement interface 'System.ICloneable' specified in introduction advice.");
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Support/DelegatingIntroductionInterceptorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Support/DelegatingIntroductionInterceptorTests.cs
index 6ab64f309..0fe68b0b8 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Support/DelegatingIntroductionInterceptorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Support/DelegatingIntroductionInterceptorTests.cs
@@ -43,10 +43,9 @@ public class DelegatingIntroductionInterceptorTests
private static readonly DateTime EXPECTED_TIMESTAMP = new DateTime(2004,8,1);
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void testNullTarget()
{
- DefaultIntroductionAdvisor advisor = new DefaultIntroductionAdvisor(null, typeof(ITimeStamped));
+ Assert.Throws(() => new DefaultIntroductionAdvisor(null, typeof(ITimeStamped)));
}
public interface ITimeStampedIntroduction: ITimeStamped, IAdvice
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Support/RegularExpressionMethodPointcutAdvisorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Support/RegularExpressionMethodPointcutAdvisorTests.cs
index bb2c498ec..1acad1b9a 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Support/RegularExpressionMethodPointcutAdvisorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Support/RegularExpressionMethodPointcutAdvisorTests.cs
@@ -17,11 +17,9 @@
#endregion
#region Imports
-using System;
using Spring.Aop.Framework;
using Spring.Aop.Interceptor;
-using Spring.Context.Support;
using Spring.Objects;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Xml;
@@ -40,7 +38,7 @@ namespace Spring.Aop.Support
[TestFixture]
public class RegularExpressionMethodPointcutAdvisorTests
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
SystemUtils.RegisterLoadedAssemblyResolver();
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Support/RootTypeFilterTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Support/RootTypeFilterTests.cs
index 4ff14c0d6..66bfaa938 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Support/RootTypeFilterTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Support/RootTypeFilterTests.cs
@@ -36,10 +36,9 @@ namespace Spring.Aop.Support
public sealed class RootTypeFilterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void InstantiationWithNullRootType()
+ public void InstantiationWithNullRootType()
{
- new RootTypeFilter(null);
+ Assert.Throws(() => new RootTypeFilter(null));
}
}
}
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Support/SdkRegularExpressionMethodPointcutTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Support/SdkRegularExpressionMethodPointcutTests.cs
index 558e5f1a2..511a28a30 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Support/SdkRegularExpressionMethodPointcutTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Support/SdkRegularExpressionMethodPointcutTests.cs
@@ -41,7 +41,7 @@ public sealed class SdkRegularExpressionMethodPointcutTests : AbstractRegularExp
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, to ensure that the logging code is exercised
@@ -105,28 +105,25 @@ public void MixedPatternsAndDefaultOptions()
Assert.IsTrue(pcut.Matches(type.GetMethod("ForMatchingPurposesOnly"), type));
}
- [ExpectedException(typeof(ArgumentNullException))]
[Test]
public void SetPatternToNull()
{
SdkRegularExpressionMethodPointcut pcut = new SdkRegularExpressionMethodPointcut();
- pcut.Pattern = null;
+ Assert.Throws(() => pcut.Pattern = null);
}
- [ExpectedException(typeof(ArgumentNullException))]
[Test]
public void SetPatternsPluralToNull()
{
SdkRegularExpressionMethodPointcut pcut = new SdkRegularExpressionMethodPointcut();
- pcut.Patterns = null;
+ Assert.Throws(() => pcut.Patterns = null);
}
- [ExpectedException(typeof(ArgumentNullException))]
[Test]
public void SetPatternsPluralToStringArrayWithNullValue()
{
SdkRegularExpressionMethodPointcut pcut = new SdkRegularExpressionMethodPointcut();
- pcut.Patterns = new string[] { null };
+ Assert.Throws(() => pcut.Patterns = new string[] { null });
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Target/HotSwappableTargetSourceTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Target/HotSwappableTargetSourceTests.cs
index 49c058cd4..b2450bf70 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Target/HotSwappableTargetSourceTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Target/HotSwappableTargetSourceTests.cs
@@ -89,11 +89,10 @@ public void ValidSwaps()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void RejectsSwapToNull()
{
HotSwappableTargetSource source = new HotSwappableTargetSource(null);
- source.Swap(null);
+ Assert.Throws(() => source.Swap(null));
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs
index 29181ec4c..dc10ea1e5 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs
@@ -43,7 +43,7 @@ public sealed class PrototypeTargetSourceTests
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, just to ensure that the logging code is correct
@@ -155,11 +155,10 @@ public void GetTarget()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void AfterPropertiesSetWithoutTargetObjectNameBeingSet()
{
PrototypeTargetSource source = new PrototypeTargetSource();
- source.AfterPropertiesSet();
+ Assert.Throws(() => source.AfterPropertiesSet());
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Target/SimplePoolTargetSourceTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Target/SimplePoolTargetSourceTests.cs
index 567ab3fa8..c9f703c39 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Target/SimplePoolTargetSourceTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Target/SimplePoolTargetSourceTests.cs
@@ -1,5 +1,5 @@
using NUnit.Framework;
-using Spring.Aop.Target;
+
using Spring.Objects.Factory;
using Spring.Objects.Factory.Xml;
/*
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Target/SingletonTargetSourceTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Target/SingletonTargetSourceTests.cs
index 20a9d5576..952816d75 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Target/SingletonTargetSourceTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Target/SingletonTargetSourceTests.cs
@@ -35,10 +35,9 @@ namespace Spring.Aop.Target
public sealed class SingletonTargetSourceTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void InstantiationWithNullTargetSource()
{
- new SingletonTargetSource(null);
+ Assert.Throws(() => new SingletonTargetSource(null));
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Target/ThreadLocalTargetSourceTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Target/ThreadLocalTargetSourceTests.cs
index 6e86bffd6..580b18595 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Target/ThreadLocalTargetSourceTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Target/ThreadLocalTargetSourceTests.cs
@@ -14,7 +14,6 @@
* limitations under the License.
*/
using System;
-using System.IO;
using System.Reflection;
using System.Threading;
using System.Collections;
diff --git a/test/Spring/Spring.Aop.Tests/AopCompilerOptionsTests.cs b/test/Spring/Spring.Aop.Tests/AopCompilerOptionsTests.cs
index f61796f29..f2c47029d 100644
--- a/test/Spring/Spring.Aop.Tests/AopCompilerOptionsTests.cs
+++ b/test/Spring/Spring.Aop.Tests/AopCompilerOptionsTests.cs
@@ -34,7 +34,7 @@ namespace Spring
[TestFixture]
public sealed class AopCompilerOptionsTests : CompilerOptionsTests
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
AssemblyToCheck = Assembly.GetAssembly(typeof (TruePointcut));
diff --git a/test/Spring/Spring.Aop.Tests/AopExceptionTests.cs b/test/Spring/Spring.Aop.Tests/AopExceptionTests.cs
index 3ec1996b3..9874b8a13 100644
--- a/test/Spring/Spring.Aop.Tests/AopExceptionTests.cs
+++ b/test/Spring/Spring.Aop.Tests/AopExceptionTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Reflection;
using NUnit.Framework;
@@ -36,7 +35,7 @@ namespace Spring
[TestFixture]
public sealed class AopExceptionTests : ExceptionsTest
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp ()
{
AssemblyToCheck = Assembly.GetAssembly (typeof (Spring.Aop.TruePointcut));
diff --git a/test/Spring/Spring.Aop.Tests/AopSerializationTests.cs b/test/Spring/Spring.Aop.Tests/AopSerializationTests.cs
index 751d268bb..8e2e19572 100644
--- a/test/Spring/Spring.Aop.Tests/AopSerializationTests.cs
+++ b/test/Spring/Spring.Aop.Tests/AopSerializationTests.cs
@@ -29,7 +29,6 @@
using NUnit.Framework;
using Spring.Aop;
using Spring.Aop.Framework;
-using Spring.Aop.Support;
using Spring.Context;
using Spring.Objects.Factory;
diff --git a/test/Spring/Spring.Aop.Tests/Aspects/Cache/CacheAspectIntegrationTests.cs b/test/Spring/Spring.Aop.Tests/Aspects/Cache/CacheAspectIntegrationTests.cs
index 3671b8ce4..e8e0480db 100644
--- a/test/Spring/Spring.Aop.Tests/Aspects/Cache/CacheAspectIntegrationTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aspects/Cache/CacheAspectIntegrationTests.cs
@@ -26,7 +26,6 @@
using NUnit.Framework;
using Spring.Aop.Framework;
using Spring.Caching;
-using Spring.Context;
using Spring.Context.Support;
using Spring.Objects.Factory;
@@ -105,7 +104,6 @@ public void TestCacheResultDoesNotReturnInvalidType()
/// http://jira.springframework.org/browse/SPRNET-1226
///
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void NoCacheKeySpecified()
{
ICache cache = new NonExpiringCache();
@@ -115,12 +113,10 @@ public void NoCacheKeySpecified()
pf.AddAdvisors(cacheAspect);
IInventorStore store = (IInventorStore)pf.GetProxy();
- IList items = store.GetAllNoCacheKey();
- Assert.IsNotNull(items);
+ Assert.Throws(() => store.GetAllNoCacheKey());
}
[Test]
- [ExpectedException(typeof(NoSuchObjectDefinitionException))]
public void CacheDoesNotExist()
{
//ICache cache = new NonExpiringCache();
@@ -130,11 +126,10 @@ public void CacheDoesNotExist()
pf.AddAdvisors(cacheAspect);
IInventorStore store = (IInventorStore)pf.GetProxy();
- IList items = store.GetAll();
+ Assert.Throws(() => store.GetAll());
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void CacheDoesNotImplementICache()
{
context.ObjectFactory.RegisterSingleton("inventors", new Object());
@@ -143,7 +138,7 @@ public void CacheDoesNotImplementICache()
pf.AddAdvisors(cacheAspect);
IInventorStore store = (IInventorStore)pf.GetProxy();
- IList items = store.GetAll();
+ Assert.Throws(() => store.GetAll());
}
[Test(Description = "http://jira.springframework.org/browse/SPRNET-959")]
diff --git a/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs b/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs
index f976c324e..7199a6959 100644
--- a/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs
@@ -22,13 +22,11 @@
using System;
using System.Collections;
-using System.Collections.Specialized;
+
using Common.Logging;
-using Common.Logging.Simple;
+
using NUnit.Framework;
using Spring.Aop.Framework;
-using Spring.Aspects.Exceptions;
-using Spring.Expressions;
using Spring.Objects;
using Spring.Util;
@@ -170,12 +168,11 @@ public void LoggingTestWithConstraintExpressionWithKeyedExceptionHandler()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void LoggingTestWithBadString()
{
string logHandlerText = "on foobar name ArithmeticException log 'My Message, Method Name ' + #method.Name";
- ExecuteLoggingHandler(logHandlerText, "My Message");
+ Assert.Throws(() => ExecuteLoggingHandler(logHandlerText, "My Message"));
}
[Test]
diff --git a/test/Spring/Spring.Aop.Tests/Aspects/Logging/SimpleLoggingAdviceTests.cs b/test/Spring/Spring.Aop.Tests/Aspects/Logging/SimpleLoggingAdviceTests.cs
index 907dc56a2..716e0c7cc 100644
--- a/test/Spring/Spring.Aop.Tests/Aspects/Logging/SimpleLoggingAdviceTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aspects/Logging/SimpleLoggingAdviceTests.cs
@@ -22,7 +22,7 @@
using System;
using System.Reflection;
-using System.Text;
+
using AopAlliance.Intercept;
using Common.Logging;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Aop.Tests/Aspects/Validation/ParameterValidationAdviceTests.cs b/test/Spring/Spring.Aop.Tests/Aspects/Validation/ParameterValidationAdviceTests.cs
index 4d7cb60a5..638fc40c8 100644
--- a/test/Spring/Spring.Aop.Tests/Aspects/Validation/ParameterValidationAdviceTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aspects/Validation/ParameterValidationAdviceTests.cs
@@ -80,7 +80,6 @@ public void TestValidArgument()
}
[Test]
- [ExpectedException(typeof(ValidationException))]
public void TestInvalidArgument()
{
MethodInfo method = typeof(ValidationTarget).GetMethod("Save");
@@ -92,7 +91,7 @@ public void TestInvalidArgument()
using (mocks.Playback())
{
- advice.Before(method, new object[] { null }, new ValidationTarget());
+ Assert.Throws(() => advice.Before(method, new object[] { null }, new ValidationTarget()));
}
}
diff --git a/test/Spring/Spring.Aop.Tests/AssemblyInfo.cs b/test/Spring/Spring.Aop.Tests/AssemblyInfo.cs
index 95b354288..517f67c13 100644
--- a/test/Spring/Spring.Aop.Tests/AssemblyInfo.cs
+++ b/test/Spring/Spring.Aop.Tests/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("Spring.Aop Tests")]
[assembly: AssemblyDescription("Unit tests for Spring.Aop assembly")]
diff --git a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj
index 7906ee8e9..b0136bd7f 100644
--- a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj
+++ b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj
@@ -30,7 +30,6 @@
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Aop.Tests\Debug\
@@ -86,9 +85,9 @@
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
False
@@ -327,5 +326,5 @@
xcopy "$(ProjectDir)Data" ..\..\..\..\build\VS.Net.2010\Spring.Aop.Tests\$(ConfigurationName)\ /y /s /q /d
xcopy "$(ProjectDir)$(TargetFileName).config" ..\..\..\..\build\VS.Net.2010\Spring.Aop.Tests\$(ConfigurationName)\ /y /s /q
-
-
\ No newline at end of file
+
+
diff --git a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.build b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.build
index 07ed56c1e..fdfac60dc 100644
--- a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.build
+++ b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.build
@@ -57,7 +57,7 @@
-
+
diff --git a/test/Spring/Spring.Aop.Tests/packages.config b/test/Spring/Spring.Aop.Tests/packages.config
index 9e2afc91b..52407b923 100644
--- a/test/Spring/Spring.Aop.Tests/packages.config
+++ b/test/Spring/Spring.Aop.Tests/packages.config
@@ -2,5 +2,5 @@
-
+
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/AssemblyInfo.cs b/test/Spring/Spring.Core.Tests/AssemblyInfo.cs
index 4c097f757..42c32a495 100644
--- a/test/Spring/Spring.Core.Tests/AssemblyInfo.cs
+++ b/test/Spring/Spring.Core.Tests/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
#if NET_4_0
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
diff --git a/test/Spring/Spring.Core.Tests/Caching/BaseCacheAttributeTests.cs b/test/Spring/Spring.Core.Tests/Caching/BaseCacheAttributeTests.cs
index 01f1ba4b8..ebdac10a8 100644
--- a/test/Spring/Spring.Core.Tests/Caching/BaseCacheAttributeTests.cs
+++ b/test/Spring/Spring.Core.Tests/Caching/BaseCacheAttributeTests.cs
@@ -92,17 +92,15 @@ public void AllowsForExtendedTimeSpanConverterSyntax()
}
[Test]
- [ExpectedException(typeof(ArgumentOutOfRangeException))]
public void KeyCannotBeEmptyString()
{
- att = new DerivedCacheAttribute("someName", string.Empty);
+ Assert.Throws(() => att = new DerivedCacheAttribute("someName", string.Empty));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void KeyCannotBeNull()
{
- att = new DerivedCacheAttribute("someName", null);
+ Assert.Throws(() => att = new DerivedCacheAttribute("someName", null));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Collections/AbstractQueueTests.cs b/test/Spring/Spring.Core.Tests/Collections/AbstractQueueTests.cs
index 6864e3184..5a9de2ed0 100644
--- a/test/Spring/Spring.Core.Tests/Collections/AbstractQueueTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/AbstractQueueTests.cs
@@ -160,19 +160,17 @@ public void AddSucceed()
}
[Test]
- [ExpectedException(typeof (InvalidOperationException))]
public void AddFail()
{
FailQueue q = new FailQueue();
- q.Add(Int32.Parse("1"));
+ Assert.Throws(() => q.Add(Int32.Parse("1")));
}
[Test]
- [ExpectedException(typeof (NullReferenceException))]
public void AddNPE()
{
SucceedQueue q = new SucceedQueue();
- q.Add(null);
+ Assert.Throws(() => q.Add(null));
}
[Test]
@@ -183,11 +181,10 @@ public void RemoveSucceed()
}
[Test]
- [ExpectedException(typeof (NoElementsException))]
public void RemoveFail()
{
FailQueue q = new FailQueue();
- q.Remove();
+ Assert.Throws(() => q.Remove());
}
[Test]
@@ -198,27 +195,24 @@ public void ElementSucceed()
}
[Test]
- [ExpectedException(typeof (NoElementsException))]
public void ElementF()
{
FailQueue q = new FailQueue();
- q.Element();
+ Assert.Throws(() => q.Element());
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddAll1()
{
SucceedQueue q = new SucceedQueue();
- q.AddAll(null);
+ Assert.Throws(() => q.AddAll(null));
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void AddAllSelf()
{
SucceedQueue q = new SucceedQueue();
- q.AddAll(q);
+ Assert.Throws(() => q.AddAll(q));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Collections/CaseInsensitiveHashtableTests.cs b/test/Spring/Spring.Core.Tests/Collections/CaseInsensitiveHashtableTests.cs
index 98322e516..b268d17de 100644
--- a/test/Spring/Spring.Core.Tests/Collections/CaseInsensitiveHashtableTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/CaseInsensitiveHashtableTests.cs
@@ -27,7 +27,6 @@
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using NUnit.Framework;
-using Rhino.Mocks;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Collections/HashedSetTests.cs b/test/Spring/Spring.Core.Tests/Collections/HashedSetTests.cs
index 5d386ca4f..e1d16271d 100644
--- a/test/Spring/Spring.Core.Tests/Collections/HashedSetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/HashedSetTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Collections/HybridSetTests.cs b/test/Spring/Spring.Core.Tests/Collections/HybridSetTests.cs
index 90dd5bb94..642100da4 100644
--- a/test/Spring/Spring.Core.Tests/Collections/HybridSetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/HybridSetTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Collections/ImmutableSetTests.cs b/test/Spring/Spring.Core.Tests/Collections/ImmutableSetTests.cs
index 9cce1a768..adfb3d7b4 100644
--- a/test/Spring/Spring.Core.Tests/Collections/ImmutableSetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/ImmutableSetTests.cs
@@ -52,46 +52,40 @@ public void TearDown () {
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void Add()
{
- Set.Add (1);
+ Assert.Throws(() => Set.Add(1));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void AddAll()
{
- Set.AddAll (new int [] {4, 5, 6});
+ Assert.Throws(() => Set.AddAll(new int[] {4, 5, 6}));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void Remove()
{
- Set.Remove (1);
+ Assert.Throws(() => Set.Remove(1));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void RemoveAll()
{
- object [] removed = new object [] {1, 3};
- Set.RemoveAll (removed);
+ object[] removed = new object[] {1, 3};
+ Assert.Throws(() => Set.RemoveAll(removed));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void RetainAll()
{
- Set.RetainAll (new object [] {1, 9});
+ Assert.Throws(() => Set.RetainAll(new object[] {1, 9}));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void Clear()
{
- Set.Clear ();
+ Assert.Throws(() => Set.Clear());
}
[Test]
@@ -108,10 +102,11 @@ public void Contains() {
}
[Test]
- public void ContainsAll() {
- Assert.IsFalse (Set.ContainsAll (new object [] {"Funk", 1, 2, 3}));
- Assert.IsTrue (Set.ContainsAll (new object [] {1, 3, 2}));
- }
+ public void ContainsAll()
+ {
+ Assert.IsFalse(Set.ContainsAll(new object[] {"Funk", 1, 2, 3}));
+ Assert.IsTrue(Set.ContainsAll(new object[] {1, 3, 2}));
+ }
[Test]
public void CopyTo() {
@@ -134,55 +129,50 @@ public void EnumeratesOk () {
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ClonedInstanceMustStillBeImmutable ()
+ public void ClonedInstanceMustStillBeImmutable()
{
- ISet clone = (ISet) Set.Clone ();
- clone.Add ("bad chair, bad chair");
+ ISet clone = (ISet) Set.Clone();
+ Assert.Throws(() => clone.Add("bad chair, bad chair"));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void MinusYieldsImmutableCone ()
+ public void MinusYieldsImmutableCone()
{
- ISet mySet = new ListSet (new int [] {1, 2});
- ISet clone = Set.Minus (mySet);
- Assert.IsNotNull (clone);
- Assert.AreEqual (1, clone.Count);
- clone.Add ("bad chair, bad chair");
+ ISet mySet = new ListSet(new int[] {1, 2});
+ ISet clone = Set.Minus(mySet);
+ Assert.IsNotNull(clone);
+ Assert.AreEqual(1, clone.Count);
+ Assert.Throws(() => clone.Add("bad chair, bad chair"));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void UnionYieldsImmutableCone ()
+ public void UnionYieldsImmutableCone()
{
- ISet mySet = new ListSet (new int [] {1, 4});
- ISet clone = Set.Union (mySet);
- Assert.IsNotNull (clone);
- Assert.AreEqual (4, clone.Count);
- clone.Add ("bad chair, bad chair");
+ ISet mySet = new ListSet(new int[] {1, 4});
+ ISet clone = Set.Union(mySet);
+ Assert.IsNotNull(clone);
+ Assert.AreEqual(4, clone.Count);
+ Assert.Throws(() => clone.Add("bad chair, bad chair"));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void IntersectionYieldsImmutableCone ()
+ public void IntersectionYieldsImmutableCone()
{
- ISet mySet = new ListSet (new int [] {1, 4});
- ISet clone = Set.Intersect (mySet);
- Assert.IsNotNull (clone);
- Assert.AreEqual (1, clone.Count);
- clone.Add ("bad chair, bad chair");
+ ISet mySet = new ListSet(new int[] {1, 4});
+ ISet clone = Set.Intersect(mySet);
+ Assert.IsNotNull(clone);
+ Assert.AreEqual(1, clone.Count);
+ Assert.Throws(() => clone.Add("bad chair, bad chair"));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ExclusiveOrYieldsImmutableCone ()
+ public void ExclusiveOrYieldsImmutableCone()
{
- ISet mySet = new ListSet (new int [] {1, 4});
- ISet clone = Set.ExclusiveOr (mySet);
- Assert.IsNotNull (clone);
- Assert.AreEqual (3, clone.Count);
- clone.Add ("bad chair, bad chair");
+ ISet mySet = new ListSet(new int[] {1, 4});
+ ISet clone = Set.ExclusiveOr(mySet);
+ Assert.IsNotNull(clone);
+ Assert.AreEqual(3, clone.Count);
+ Assert.Throws(() => clone.Add("bad chair, bad chair"));
}
///
diff --git a/test/Spring/Spring.Core.Tests/Collections/LinkedListTests.cs b/test/Spring/Spring.Core.Tests/Collections/LinkedListTests.cs
index eed931b97..ac9c8d6ba 100644
--- a/test/Spring/Spring.Core.Tests/Collections/LinkedListTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/LinkedListTests.cs
@@ -91,11 +91,10 @@ public void RemoveObject()
}
[Test]
- [ExpectedException(typeof(System.ArgumentOutOfRangeException))]
public void RemoveAtOnEmptyLinkedList()
{
LinkedList ll = new LinkedList();
- ll.RemoveAt(0);
+ Assert.Throws(() => ll.RemoveAt(0));
}
[Test]
@@ -113,7 +112,6 @@ public void Enumerator()
}
[Test]
- [ExpectedException(typeof(System.InvalidOperationException))]
public void EnumeratorModification()
{
LinkedList ll = new LinkedList();
@@ -123,8 +121,7 @@ public void EnumeratorModification()
IEnumerator ienum = ll.GetEnumerator();
Assert.IsTrue(ienum.MoveNext());
ll.RemoveAt(0);
- ienum.MoveNext();
- Assert.Fail("Expected enumerator to fail with InvalidOperationException");
+ Assert.Throws(() => ienum.MoveNext());
}
[Test]
@@ -187,43 +184,39 @@ public void CopyToWithNonZeroIndex()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void CopyToWithNullArray()
{
LinkedList ll = new LinkedList();
ll.Add("item1");
- ll.CopyTo(null, 0);
+ Assert.Throws(() => ll.CopyTo(null, 0));
}
[Test]
- [ExpectedException(typeof(ArgumentOutOfRangeException))]
public void CopyToWithNegativeIndex()
{
LinkedList ll = new LinkedList();
ll.Add("item1");
string[] strings = new string[1];
- ll.CopyTo(strings, -1);
+ Assert.Throws(() => ll.CopyTo(strings, -1));
}
[Test]
- [ExpectedException(typeof(ArgumentOutOfRangeException))]
public void CopyToWithIndexGreaterThanArrayLength()
{
LinkedList ll = new LinkedList();
ll.Add("item1");
string[] strings = new string[1];
- ll.CopyTo(strings, 2);
+ Assert.Throws(() => ll.CopyTo(strings, 2));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void CopyToWithInsufficientSizeArray()
{
LinkedList ll = new LinkedList();
ll.Add("item1");
ll.Add("item2");
string[] strings = new string[2];
- ll.CopyTo(strings, 1);
+ Assert.Throws(() => ll.CopyTo(strings, 1));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Collections/ListSetTests.cs b/test/Spring/Spring.Core.Tests/Collections/ListSetTests.cs
index 66899f9ee..908fd55d7 100644
--- a/test/Spring/Spring.Core.Tests/Collections/ListSetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/ListSetTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Collections/PriorityQueueTests.cs b/test/Spring/Spring.Core.Tests/Collections/PriorityQueueTests.cs
index 096e032c7..ec98005a4 100644
--- a/test/Spring/Spring.Core.Tests/Collections/PriorityQueueTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/PriorityQueueTests.cs
@@ -62,35 +62,31 @@ public void CreateUnboundedQueue()
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void ThrowsArgumentExceptionForZeroCapacity()
{
- new PriorityQueue(0);
+ Assert.Throws(() => new PriorityQueue(0));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void ThrowsArgumentNullExceptionForNullCollection()
{
- PriorityQueue q = new PriorityQueue((ICollection) null);
+ Assert.Throws(() => new PriorityQueue((ICollection) null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ThrowsArgumentNullExceptionForNullCollectionElements()
{
object[] ints = new object[SIZE];
- PriorityQueue q = new PriorityQueue(new ArrayList(ints));
+ Assert.Throws(() => new PriorityQueue(new ArrayList(ints)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void ThrowsArgumentNullExceptionForSomeNullCollectionElements()
{
object[] ints = new object[SIZE];
for (int i = 0; i < SIZE - 1; ++i)
ints[i] = i;
- PriorityQueue q = new PriorityQueue(new ArrayList(ints));
+ Assert.Throws(() => new PriorityQueue(new ArrayList(ints)));
}
[Test]
@@ -150,19 +146,17 @@ public void Size()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void OfferWithNullObject()
{
PriorityQueue q = new PriorityQueue(1);
- q.Offer(null);
+ Assert.Throws(() => q.Offer(null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddWithNullObject()
{
PriorityQueue q = new PriorityQueue(1);
- q.Add(null);
+ Assert.Throws(() => q.Add(null));
}
[Test]
@@ -174,13 +168,11 @@ public void OfferWithComparableElements()
}
[Test]
- [ExpectedException(typeof (InvalidCastException))]
public void OfferNonComparable()
{
PriorityQueue q = new PriorityQueue(1);
q.Offer(new Object());
- q.Offer(new Object());
- q.Offer(new Object());
+ Assert.Throws(() => q.Offer(new Object()));
}
[Test]
@@ -195,31 +187,28 @@ public void AddWithComparableElements()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddAllWithNullElements()
{
PriorityQueue q = new PriorityQueue(1);
- q.AddAll(null);
+ Assert.Throws(() => q.AddAll(null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddAllWithCollectionWithNullElements()
{
PriorityQueue q = new PriorityQueue(SIZE);
object[] ints = new object[SIZE];
- q.AddAll(new ArrayList(ints));
+ Assert.Throws(() => q.AddAll(new ArrayList(ints)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddAllWithCollectionWithSomeNullElements()
{
PriorityQueue q = new PriorityQueue(SIZE);
object[] ints = new object[SIZE];
for (int i = 0; i < SIZE - 1; ++i)
ints[i] = i;
- q.AddAll(new ArrayList(ints));
+ Assert.Throws(() => q.AddAll(new ArrayList(ints)));
}
[Test]
@@ -261,7 +250,6 @@ public void Peek()
}
[Test]
- [ExpectedException(typeof (NoElementsException))]
public void Element()
{
PriorityQueue q = populatedQueue(SIZE);
@@ -270,11 +258,10 @@ public void Element()
Assert.AreEqual(i, (q.Element()));
q.Poll();
}
- q.Element();
+ Assert.Throws(() => q.Element());
}
[Test]
- [ExpectedException(typeof (NoElementsException))]
public void Remove()
{
PriorityQueue q = populatedQueue(SIZE);
@@ -282,7 +269,7 @@ public void Remove()
{
Assert.AreEqual(i, (q.Remove()));
}
- q.Remove();
+ Assert.Throws(() => q.Remove());
}
[Test]
@@ -409,44 +396,46 @@ public void Serialization()
while (!(q.Count == 0))
Assert.AreEqual(q.Remove(), r.Remove());
}
- [Test]
- [ExpectedException(typeof(ArgumentException))]
- public void QueueCopyToArrayWithSmallerDestinationArray()
- {
- PriorityQueue source = populatedQueue(SIZE);
- object[] dest = new object[SIZE/2];
- source.CopyTo(dest);
- }
- [Test]
- [ExpectedException(typeof(ArgumentException))]
- public void QueueCopyToArrayWithIndexOutOfDestinationArrayRange()
- {
- PriorityQueue source = populatedQueue(SIZE);
- object[] dest = new object[SIZE/2];
- source.CopyTo(dest, 11);
- }
- [Test]
- [ExpectedException(typeof(IndexOutOfRangeException))]
- public void QueueCopyToArrayWithValidSizeButInvalidStartingIndex()
- {
- PriorityQueue source = populatedQueue(SIZE);
- object[] dest = new object[SIZE];
- source.CopyTo(dest, 10);
- }
- [Test]
- public void CompleteQueueCopyToArrayWithValidSize()
- {
- PriorityQueue source = populatedQueue(SIZE);
- object[] dest = new object[SIZE];
- source.CopyTo(dest);
- for ( int i = 0; i < SIZE; i++ )
- {
- Assert.AreEqual(source.Poll(), dest[i]);
- }
- }
- [Test]
- public void PartialQueueCopyToArrayWithValidSize()
- {
+
+ [Test]
+ public void QueueCopyToArrayWithSmallerDestinationArray()
+ {
+ PriorityQueue source = populatedQueue(SIZE);
+ object[] dest = new object[SIZE / 2];
+ Assert.Throws(() => source.CopyTo(dest));
+ }
+
+ [Test]
+ public void QueueCopyToArrayWithIndexOutOfDestinationArrayRange()
+ {
+ PriorityQueue source = populatedQueue(SIZE);
+ object[] dest = new object[SIZE / 2];
+ Assert.Throws(() => source.CopyTo(dest, 11));
+ }
+
+ [Test]
+ public void QueueCopyToArrayWithValidSizeButInvalidStartingIndex()
+ {
+ PriorityQueue source = populatedQueue(SIZE);
+ object[] dest = new object[SIZE];
+ Assert.Throws(() => source.CopyTo(dest, 10));
+ }
+
+ [Test]
+ public void CompleteQueueCopyToArrayWithValidSize()
+ {
+ PriorityQueue source = populatedQueue(SIZE);
+ object[] dest = new object[SIZE];
+ source.CopyTo(dest);
+ for (int i = 0; i < SIZE; i++)
+ {
+ Assert.AreEqual(source.Poll(), dest[i]);
+ }
+ }
+
+ [Test]
+ public void PartialQueueCopyToArrayWithValidSize()
+ {
PriorityQueue source = populatedQueue(SIZE);
object[] dest = new object[SIZE*2];
source.CopyTo(dest, SIZE / 2);
diff --git a/test/Spring/Spring.Core.Tests/Collections/SetTests.cs b/test/Spring/Spring.Core.Tests/Collections/SetTests.cs
index 03c404938..96fd0ea14 100644
--- a/test/Spring/Spring.Core.Tests/Collections/SetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/SetTests.cs
@@ -20,11 +20,6 @@
#region Imports
-using System;
-using System.Collections;
-
-using Spring.Collections;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Collections/SortedSetTests.cs b/test/Spring/Spring.Core.Tests/Collections/SortedSetTests.cs
index ebeea1173..588a99547 100644
--- a/test/Spring/Spring.Core.Tests/Collections/SortedSetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/SortedSetTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
@@ -35,7 +33,7 @@ namespace Spring.Collections
[TestFixture]
public class SortedSetTests : SetTests
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void Init ()
{
SupportsNull = false;
diff --git a/test/Spring/Spring.Core.Tests/Collections/StaticSetTests.cs b/test/Spring/Spring.Core.Tests/Collections/StaticSetTests.cs
index 76b9f713b..bea8670cf 100644
--- a/test/Spring/Spring.Core.Tests/Collections/StaticSetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/StaticSetTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Collections/SynchronizedHashtableTests.cs b/test/Spring/Spring.Core.Tests/Collections/SynchronizedHashtableTests.cs
index ded49abf0..f1ecb8d4b 100644
--- a/test/Spring/Spring.Core.Tests/Collections/SynchronizedHashtableTests.cs
+++ b/test/Spring/Spring.Core.Tests/Collections/SynchronizedHashtableTests.cs
@@ -22,7 +22,7 @@
using System;
using System.Collections;
-using System.Text;
+
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Context/Attributes/AssemblyTypeScannerTests.cs b/test/Spring/Spring.Core.Tests/Context/Attributes/AssemblyTypeScannerTests.cs
index 0241999a3..d9acac896 100644
--- a/test/Spring/Spring.Core.Tests/Context/Attributes/AssemblyTypeScannerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Attributes/AssemblyTypeScannerTests.cs
@@ -21,7 +21,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Reflection;
+
using NUnit.Framework;
using Spring.Core;
using Spring.Util;
diff --git a/test/Spring/Spring.Core.Tests/Context/Attributes/ScanningConfigurationClassPostProcessorTests.cs b/test/Spring/Spring.Core.Tests/Context/Attributes/ScanningConfigurationClassPostProcessorTests.cs
index 4290deab4..7b82160b2 100644
--- a/test/Spring/Spring.Core.Tests/Context/Attributes/ScanningConfigurationClassPostProcessorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Attributes/ScanningConfigurationClassPostProcessorTests.cs
@@ -19,7 +19,7 @@
#endregion
using NUnit.Framework;
-using Spring.Context.Config;
+
using Spring.Context.Support;
using Spring.Objects.Factory.Xml;
diff --git a/test/Spring/Spring.Core.Tests/Context/Attributes/SimpleScanTests.cs b/test/Spring/Spring.Core.Tests/Context/Attributes/SimpleScanTests.cs
index 9f59cc940..7acf0cb83 100644
--- a/test/Spring/Spring.Core.Tests/Context/Attributes/SimpleScanTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Attributes/SimpleScanTests.cs
@@ -22,7 +22,7 @@
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
-using Spring.Context.Config;
+
using Spring.Context.Support;
using Spring.Example.Scannable;
using Spring.Objects.Factory;
diff --git a/test/Spring/Spring.Core.Tests/Context/Config/ComponentScanObjectDefinitionParserTypeFilterTests.cs b/test/Spring/Spring.Core.Tests/Context/Config/ComponentScanObjectDefinitionParserTypeFilterTests.cs
index 5d2454845..f4b850f25 100644
--- a/test/Spring/Spring.Core.Tests/Context/Config/ComponentScanObjectDefinitionParserTypeFilterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Config/ComponentScanObjectDefinitionParserTypeFilterTests.cs
@@ -25,7 +25,6 @@
using Spring.Objects.Factory;
using Spring.Objects.Factory.Xml;
using Spring.Context.Support;
-using Spring.Stereotype;
namespace Spring.Context.Config
diff --git a/test/Spring/Spring.Core.Tests/Context/ContextExceptionTests.cs b/test/Spring/Spring.Core.Tests/Context/ContextExceptionTests.cs
index 66be8c9dd..d515fb4a4 100644
--- a/test/Spring/Spring.Core.Tests/Context/ContextExceptionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/ContextExceptionTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Reflection;
using NUnit.Framework;
@@ -36,7 +35,7 @@ namespace Spring.Context
[TestFixture]
public sealed class ContextExceptionTests : ExceptionsTest
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp ()
{
AssemblyToCheck = Assembly.GetAssembly (typeof (Spring.Context.ApplicationContextException));
diff --git a/test/Spring/Spring.Core.Tests/Context/ContextListenerObject.cs b/test/Spring/Spring.Core.Tests/Context/ContextListenerObject.cs
index 744fef362..9743cc08c 100644
--- a/test/Spring/Spring.Core.Tests/Context/ContextListenerObject.cs
+++ b/test/Spring/Spring.Core.Tests/Context/ContextListenerObject.cs
@@ -1,4 +1,3 @@
-using System;
using Spring.Context.Events;
#region License
diff --git a/test/Spring/Spring.Core.Tests/Context/Events/ConsoleListenerTests.cs b/test/Spring/Spring.Core.Tests/Context/Events/ConsoleListenerTests.cs
index 550214072..18ad9af00 100644
--- a/test/Spring/Spring.Core.Tests/Context/Events/ConsoleListenerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Events/ConsoleListenerTests.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using NUnit.Framework;
namespace Spring.Context.Events
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs
index 986e1bf24..616a3061d 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs
@@ -40,14 +40,13 @@ public void Init()
}
[Test]
- [ExpectedException(typeof (NoSuchMessageException))]
public void GetResolvableNullCodes()
{
IMessageSourceResolvable res = mocks.StrictMock();
Expect.Call(res.GetCodes()).Return(null);
Expect.Call(res.DefaultMessage).Return(null);
mocks.ReplayAll();
- GetMessage(res, CultureInfo.CurrentCulture);
+ Assert.Throws(() => GetMessage(res, CultureInfo.CurrentCulture));
mocks.VerifyAll();
}
@@ -113,7 +112,6 @@ public void GetMessageResolvableReturnsFirstCode()
}
[Test]
- [ExpectedException(typeof (NoSuchMessageException))]
public void GetMessageResolvableNoValidMessage()
{
IMessageSourceResolvable res = mocks.StrictMock();
@@ -121,7 +119,7 @@ public void GetMessageResolvableNoValidMessage()
Expect.Call(res.GetCodes()).Return(null);
Expect.Call(res.GetArguments()).Return(null).Repeat.AtLeastOnce();
mocks.ReplayAll();
- GetMessage(res, CultureInfo.CurrentCulture);
+ Assert.Throws(() => GetMessage(res, CultureInfo.CurrentCulture));
}
[Test]
@@ -147,10 +145,9 @@ public void GetMessageResolvableValidMessageAndCodeNullCulture()
}
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void GetMessageNullCode()
{
- Assert.IsNull(GetMessage(null));
+ Assert.Throws(() => GetMessage(null));
}
[Test]
@@ -174,10 +171,9 @@ public void GetMessageUseDefaultCode()
}
[Test]
- [ExpectedException(typeof (NoSuchMessageException))]
public void GetMessageNoValidMessage()
{
- GetMessage("null", new object[] {"arguments"});
+ Assert.Throws(() => GetMessage("null", new object[] {"arguments"}));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs
index d3f948c45..a9e678a70 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using NUnit.Framework;
@@ -431,11 +430,10 @@ public bool Init
[Test]
- [ExpectedException(typeof (ApplicationContextException))]
public void InvalidContextSubclass()
{
ApplicationObjectSupport support = new MyApplicationObjectSupport();
- support.ApplicationContext = new MyContext2();
+ Assert.Throws(() => support.ApplicationContext = new MyContext2());
}
[Test]
@@ -472,12 +470,11 @@ public void ReinitWithSameContext()
}
[Test]
- [ExpectedException(typeof (ApplicationContextException))]
public void ReinitWithDiffContext()
{
MockApplicationContext ctx = new MockApplicationContext();
ApplicationObjectSupport support = new MyApplicationObjectSupport(ctx);
- support.ApplicationContext = new MockApplicationContext();
+ Assert.Throws(() => support.ApplicationContext = new MockApplicationContext());
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/ContextLocatorHandlerTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/ContextLocatorHandlerTests.cs
index 74200d452..ca3828c2d 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/ContextLocatorHandlerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/ContextLocatorHandlerTests.cs
@@ -20,13 +20,11 @@
#region Imports
-using System;
using System.Configuration;
using System.IO;
-using System.Security.Policy;
using System.Xml;
using NUnit.Framework;
-using Spring.Objects;
+
using Spring.Objects.Factory;
using Spring.Util;
@@ -117,7 +115,6 @@ public void CreateChildContextFailure()
/// Expect failure when using a type that does not inherit from IApplicationContext
///
[Test]
- [ExpectedException(typeof(ConfigurationErrorsException))]
public void ContextNotOfCorrectType()
{
const string xmlData =
@@ -126,15 +123,14 @@ public void ContextNotOfCorrectType()
";
CreateConfigurationElement(xmlData);
ContextHandler ctxHandler = new ContextHandler();
- ctxHandler.Create(null, null, configurationElement);
+ Assert.Throws(() => ctxHandler.Create(null, null, configurationElement));
}
[Test]
- [ExpectedException(typeof(ConfigurationErrorsException))]
public void CreatedFromNullXmlElement()
{
ContextHandler ctxHandler = new ContextHandler();
- ctxHandler.Create(null, null, null);
+ Assert.Throws(() => ctxHandler.Create(null, null, null));
}
[Test]
@@ -151,7 +147,6 @@ public void DefaultsToXmlApplicationContextType()
"Default type is not the XmlApplicationContext type; it must be.");
}
- [ExpectedException(typeof(ConfigurationErrorsException))]
[Test(Description="SPRNET-105")]
public void ChokesIfChildContextsUseTheSameName()
{
@@ -162,7 +157,7 @@ public void ChokesIfChildContextsUseTheSameName()
";
CreateConfigurationElement(xmlData);
ContextHandler ctxHandler = new ContextHandler();
- ctxHandler.Create(null, null, configurationElement);
+ Assert.Throws(() => ctxHandler.Create(null, null, configurationElement));
}
private void CreateConfigurationElement(string xmlData)
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/ContextRegistryTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/ContextRegistryTests.cs
index af94a10bc..fc8284e70 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/ContextRegistryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/ContextRegistryTests.cs
@@ -135,38 +135,36 @@ public void RegisterNamedContext()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void GetContextWithNullName()
{
- ContextRegistry.GetContext(null);
+ Assert.Throws(() => ContextRegistry.GetContext(null));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void GetContextWithEmptyName()
{
- ContextRegistry.GetContext("");
+ Assert.Throws(() => ContextRegistry.GetContext(""));
}
[Test]
- // [Ignore("How can we test that one ???")]
- [ExpectedException(typeof(ApplicationContextException),
- ExpectedMessage = "No context registered. Use the 'RegisterContext' method or the 'spring/context' section from your configuration file.")]
public void GetRootContextNotRegisteredThrowsException()
{
- using (new HookableContextHandler.Guard(new HookableContextHandler.CreateContextFromSectionHandler(GetNullSection)))
+ Assert.Throws(() =>
{
- IApplicationContext context = ContextRegistry.GetContext();
- }
+ using (new HookableContextHandler.Guard(GetNullSection))
+ {
+ ContextRegistry.GetContext();
+ }
+ }, "No context registered. Use the 'RegisterContext' method or the 'spring/context' section from your configuration file.");
}
[Test]
- [ExpectedException(typeof(ApplicationContextException),
- ExpectedMessage = "No context registered under name 'bingo'. Use the 'RegisterContext' method or the 'spring/context' section from your configuration file.")]
public void GetContextByNameNotRegisteredThrowsException()
{
- IApplicationContext context = ContextRegistry.GetContext("bingo");
+ Assert.Throws(
+ () => ContextRegistry.GetContext("bingo"),
+ "No context registered under name 'bingo'. Use the 'RegisterContext' method or the 'spring/context' section from your configuration file.");
}
[Test]
@@ -221,13 +219,12 @@ public void ClearWithConfigurationSection()
}
[Test(Description = "SPRNET-105")]
- [ExpectedException(typeof(ApplicationContextException))]
public void ChokesIfChildContextRegisteredUnderNameOfAnExistingContext()
{
MockApplicationContext original = new MockApplicationContext("original");
ContextRegistry.RegisterContext(original);
MockApplicationContext duplicate = new MockApplicationContext("original");
- ContextRegistry.RegisterContext(duplicate);
+ Assert.Throws(() => ContextRegistry.RegisterContext(duplicate));
}
@@ -256,7 +253,7 @@ public class WhenHierarchicalContextsAllHaveDefaultNames
private string _expectedGreatGrandChildName;
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void InitializeAllTests()
{
_expectedParentName = AbstractApplicationContext.DefaultRootContextName;
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/DefaultMessageSourceResolvableTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/DefaultMessageSourceResolvableTests.cs
index 1ce6af140..2f5237d1b 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/DefaultMessageSourceResolvableTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/DefaultMessageSourceResolvableTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Text;
using NUnit.Framework;
using Rhino.Mocks;
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/DelegatingMessageSourceTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/DelegatingMessageSourceTests.cs
index 38517ca5d..f772a8598 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/DelegatingMessageSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/DelegatingMessageSourceTests.cs
@@ -91,11 +91,10 @@ DelegatingMessageSource source
}
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void GetMessageNoDelegateTarget()
{
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetMessage(LookupKey);
+ Assert.Throws(() => source.GetMessage(LookupKey));
}
[Test]
@@ -112,11 +111,10 @@ DelegatingMessageSource source
}
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void GetMessageWithCultureNoDelegateTarget()
{
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetMessage(LookupKey, CultureInfo.InvariantCulture);
+ Assert.Throws(() => source.GetMessage(LookupKey, CultureInfo.InvariantCulture));
}
[Test]
@@ -133,11 +131,10 @@ DelegatingMessageSource source
}
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void GetMessageWithParamsNoDelegateTarget()
{
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetMessage(LookupKey, "Rick", "Evans");
+ Assert.Throws(() => source.GetMessage(LookupKey, "Rick", "Evans"));
}
[Test]
@@ -155,11 +152,10 @@ DelegatingMessageSource source
}
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void GetMessageWithCultureAndParamsNoDelegateTarget()
{
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans");
+ Assert.Throws(() => source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans"));
}
[Test]
@@ -194,23 +190,21 @@ public void GetMessageWithNoParentMessageSourceAndMessageSourceResolvableAndCult
}
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void GetMessageWithNoParentMessageSourceAndNullDefaultMessageSourceResolvableWithNoCodesAndCulture()
{
IMessageSourceResolvable resolver = new DefaultMessageSourceResolvable(
new string[] {}, new object[] {}, string.Empty);
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetMessage(resolver, CultureInfo.InvariantCulture);
+ Assert.Throws(() => source.GetMessage(resolver, CultureInfo.InvariantCulture));
}
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void GetMessageWithNoParentMessageSourceAndNullDefaultMessageSourceResolvableAndCulture()
{
IMessageSourceResolvable resolver = new DefaultMessageSourceResolvable(
new string[] {"foo"}, new object[] {}, string.Empty);
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetMessage(resolver, CultureInfo.InvariantCulture);
+ Assert.Throws(() => source.GetMessage(resolver, CultureInfo.InvariantCulture));
}
[Test]
@@ -227,11 +221,10 @@ DelegatingMessageSource source
}
[Test]
- [ExpectedException(typeof(ApplicationContextException))]
public void GetResourceObjectWithNoParentMessageSource()
{
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetResourceObject(LookupKey);
+ Assert.Throws(() => source.GetResourceObject(LookupKey));
}
[Test]
@@ -248,11 +241,10 @@ DelegatingMessageSource source
}
[Test]
- [ExpectedException(typeof(ApplicationContextException))]
public void GetResourceObjectWithNoParentMessageSourceWithCulture()
{
DelegatingMessageSource source = new DelegatingMessageSource();
- source.GetResourceObject(LookupKey, CultureInfo.InvariantCulture);
+ Assert.Throws(() => source.GetResourceObject(LookupKey, CultureInfo.InvariantCulture));
}
[Test]
@@ -267,11 +259,10 @@ DelegatingMessageSource source
}
[Test]
- [ExpectedException(typeof(ApplicationContextException))]
public void ApplyResourcesWithNoParentMessageSource()
{
DelegatingMessageSource source = new DelegatingMessageSource();
- source.ApplyResources(12, "rick", CultureInfo.InvariantCulture);
+ Assert.Throws(() => source.ApplyResources(12, "rick", CultureInfo.InvariantCulture));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/MessageSourceAccessorTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/MessageSourceAccessorTests.cs
index 7f9d69ff3..10345a7b3 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/MessageSourceAccessorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/MessageSourceAccessorTests.cs
@@ -29,13 +29,13 @@ namespace Spring.Context.Support
[TestFixture]
public class MessageSourceAccessorTests
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void TestFixtureSetUp()
{
CultureTestScope.Set();
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TestFixtureTearDown()
{
CultureTestScope.Reset();
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/NamespaceParsersSectionHandlerTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/NamespaceParsersSectionHandlerTests.cs
index 9169c3f06..99782772e 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/NamespaceParsersSectionHandlerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/NamespaceParsersSectionHandlerTests.cs
@@ -49,7 +49,6 @@ public void ParseSectionSunnyDay()
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void ParseSectionWithHandlerThatDoesNotImplement_IXmlObjectDefinitionParser()
{
const string xml = @"
@@ -58,11 +57,10 @@ public void ParseSectionWithHandlerThatDoesNotImplement_IXmlObjectDefinitionPars
";
NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
- [ExpectedException(typeof (TypeLoadException))]
public void ParseSectionWithBadTypeForHandler()
{
const string xml = @"
@@ -71,7 +69,7 @@ public void ParseSectionWithBadTypeForHandler()
";
NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
@@ -87,7 +85,6 @@ public void ParseSectionWithNoChildParserNamespaceElements()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void ParseSectionWithEmptyType()
{
const string xml = @"
@@ -96,11 +93,10 @@ public void ParseSectionWithEmptyType()
";
NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
- [ExpectedException(typeof(ConfigurationErrorsException))]
public void WithParserElementThatIsMissingTheTypeAttribute()
{
const string xml = @"
@@ -109,7 +105,7 @@ public void WithParserElementThatIsMissingTheTypeAttribute()
";
NamespaceParsersSectionHandler handler = new NamespaceParsersSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
private static XmlNode BuildConfigurationSection(string xml)
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/NullMessageSourceTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/NullMessageSourceTests.cs
index f585deae2..2529568fd 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/NullMessageSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/NullMessageSourceTests.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using NUnit.Framework;
namespace Spring.Context.Support
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/ResourceSetMessageSourceTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/ResourceSetMessageSourceTests.cs
index c820a9b3b..e87407e19 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/ResourceSetMessageSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/ResourceSetMessageSourceTests.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
@@ -54,13 +53,13 @@ public sealed class ResourceSetMessageSourceTests
private const string ResourceBaseName = ResourceNamespace + "." + ResourceFileName;
private IList
[Test]
- [ExpectedException(typeof(NoSuchMessageException))]
public void ResourceSetMessageSourceGetNonExistantResource()
{
messageSource.ResourceManagers = resourceManagerList;
- messageSource.GetMessage("MyNonExistantMessage", CultureInfo.CurrentCulture, new object[] { "Spring", ".NET" });
+ Assert.Throws(() => messageSource.GetMessage("MyNonExistantMessage", CultureInfo.CurrentCulture, new object[] { "Spring", ".NET" }));
}
///
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/StaticMessageSourceTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/StaticMessageSourceTests.cs
index ad1e060f9..66c6ebae6 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/StaticMessageSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/StaticMessageSourceTests.cs
@@ -32,13 +32,13 @@ namespace Spring.Context.Support
[TestFixture]
public sealed class StaticMessageSourceTests
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void TestFixtureSetUp()
{
CultureTestScope.Set();
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TestFixtureTearDown()
{
CultureTestScope.Reset();
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/TypeAliasesSectionHandlerTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/TypeAliasesSectionHandlerTests.cs
index 916f2bf7c..e4406ff0e 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/TypeAliasesSectionHandlerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/TypeAliasesSectionHandlerTests.cs
@@ -26,7 +26,6 @@
using NUnit.Framework;
using Spring.Core.TypeResolution;
using Spring.Objects;
-using Spring.Util;
#endregion
@@ -81,7 +80,6 @@ public void WithGenericTypeDefinition()
}
[Test]
- [ExpectedException(typeof (TypeLoadException))]
public void WithNonExistentType()
{
const string xml = @"
@@ -90,11 +88,10 @@ public void WithNonExistentType()
";
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void WithEmptyTypeName()
{
const string xml = @"
@@ -103,11 +100,10 @@ public void WithEmptyTypeName()
";
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void WithWhitespacedTypeName()
{
const string xml = @"
@@ -118,11 +114,10 @@ public void WithWhitespacedTypeName()
";
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void WithEmptyAlias()
{
const string xml = @"
@@ -131,11 +126,10 @@ public void WithEmptyAlias()
";
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void WithWhitespacedAlias()
{
const string xml = @"
@@ -145,7 +139,7 @@ public void WithWhitespacedAlias()
";
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
@@ -177,7 +171,6 @@ public void ParseSectionWithGuffChildParserNamespaceElementsIsAllowed()
}
[Test]
- [ExpectedException(typeof(ConfigurationErrorsException))]
public void WithAliasElementThatIsMissingTheNameAttribute()
{
const string xml = @"
@@ -186,11 +179,10 @@ public void WithAliasElementThatIsMissingTheNameAttribute()
";
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
[Test]
- [ExpectedException(typeof(ConfigurationErrorsException))]
public void WithAliasElementThatIsMissingTheTypeAttribute()
{
const string xml = @"
@@ -199,7 +191,7 @@ public void WithAliasElementThatIsMissingTheTypeAttribute()
";
TypeAliasesSectionHandler handler = new TypeAliasesSectionHandler();
- handler.Create(null, null, BuildConfigurationSection(xml));
+ Assert.Throws(() => handler.Create(null, null, BuildConfigurationSection(xml)));
}
private static XmlNode BuildConfigurationSection(string xml)
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/XmlApplicationContextTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/XmlApplicationContextTests.cs
index 033dd0c00..f2974b137 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/XmlApplicationContextTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/XmlApplicationContextTests.cs
@@ -82,10 +82,9 @@ public void InnerObjectWithPostProcessing()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void NoConfigLocation()
{
- new XmlApplicationContext();
+ Assert.Throws(() => new XmlApplicationContext());
}
[Test]
@@ -155,14 +154,13 @@ public void CaseInsensitiveContext()
}
[Test]
- [ExpectedException(typeof(NoSuchObjectDefinitionException))]
public void GetObjectOnUnknownIdThrowsNoSuchObjectDefinition()
{
XmlApplicationContext ctx =
new XmlApplicationContext(false, "assembly://Spring.Core.Tests/Spring.Context.Support/objects.xml");
string DOES_NOT_EXIST = "does_not_exist";
Assert.IsFalse(ctx.ContainsObject(DOES_NOT_EXIST));
- Assert.IsNull(ctx.GetObject(DOES_NOT_EXIST));
+ Assert.Throws(() => ctx.GetObject(DOES_NOT_EXIST));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/AssemblyResourceTest.cs b/test/Spring/Spring.Core.Tests/Core/IO/AssemblyResourceTest.cs
index 7b57c0a07..17db26079 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/AssemblyResourceTest.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/AssemblyResourceTest.cs
@@ -54,10 +54,9 @@ public void TearDown()
/// comma delimited instead of '/'.
///
[Test]
- [ExpectedException(typeof(UriFormatException))]
public void CreateWithMalformedResourceName()
{
- new AssemblyResource("assembly://Spring.Core.Tests,Spring.TestResource.txt");
+ Assert.Throws(() => new AssemblyResource("assembly://Spring.Core.Tests,Spring.TestResource.txt"));
}
///
@@ -65,20 +64,18 @@ public void CreateWithMalformedResourceName()
/// that used 'dot' notation to seperate the namespace and resource name.
///
[Test]
- [ExpectedException(typeof(UriFormatException))]
public void CreateWithObsoleteResourceName()
{
- new AssemblyResource("assembly://Spring.Core.Tests/Spring.TestResource.txt");
+ Assert.Throws(() => new AssemblyResource("assembly://Spring.Core.Tests/Spring.TestResource.txt"));
}
///
/// Use the correct format but with an invalid assembly name.
///
[Test]
- [ExpectedException(typeof(FileNotFoundException))]
public void CreateFromInvalidAssembly()
{
- new AssemblyResource("assembly://Xyz.Invalid.Assembly/Spring/TestResource.txt");
+ Assert.Throws(() => new AssemblyResource("assembly://Xyz.Invalid.Assembly/Spring/TestResource.txt"));
}
///
@@ -225,12 +222,10 @@ public void CreateRelativeWithAReferenceToAFileResource()
/// past the root namespace, off into la-la land.
///
[Test]
- [ExpectedException(typeof(UriFormatException))]
public void TooMuchParentNamespacesAbove()
{
IResource res = new AssemblyResource("assembly://Spring.Core.Tests/Spring.Core.IO/TestResource.txt");
- IResource res2 = res.CreateRelative("../../../../TestResource.txt");
- AssertResourceContent(res2, "Spring.TestResource.txt");
+ Assert.Throws(() => res.CreateRelative("../../../../TestResource.txt"));
}
///
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/ConfigSectionResourceTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/ConfigSectionResourceTests.cs
index f6ecf4875..75ad897fa 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/ConfigSectionResourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/ConfigSectionResourceTests.cs
@@ -1,9 +1,8 @@
using System;
using System.IO;
-using System.Net;
using System.Xml;
using NUnit.Framework;
-using Spring.Objects.Factory.Xml;
+
using Spring.Util;
namespace Spring.Core.IO
@@ -58,17 +57,15 @@ public void CanCreate()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ThrowsOnNullSectionName()
{
- new ConfigSectionResource((string)null);
+ Assert.Throws(() => new ConfigSectionResource((string) null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ThrowsOnNullConfigElement()
{
- new ConfigSectionResource((XmlElement)null);
+ Assert.Throws(() => new ConfigSectionResource((XmlElement) null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/ConfigurableResourceLoaderTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/ConfigurableResourceLoaderTests.cs
index d1b1f2397..2b0695cb3 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/ConfigurableResourceLoaderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/ConfigurableResourceLoaderTests.cs
@@ -177,10 +177,9 @@ public void GetAssemblyResource()
#endregion
[Test]
- [ExpectedException(typeof(UriFormatException))]
public void GetResourceForNonMappedProtocol()
{
- new ConfigurableResourceLoader().GetResource("beep://foo.xml");
+ Assert.Throws(() => new ConfigurableResourceLoader().GetResource("beep://foo.xml"));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceCommonTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceCommonTests.cs
index 2ecdad295..1e1a4df1b 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceCommonTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceCommonTests.cs
@@ -78,12 +78,11 @@ public void FileSystemResourceNotExists()
}
[Test]
- [ExpectedException(typeof(FileNotFoundException))]
public void FileSystemResourceOpenNonExistanceFile()
{
FileSystemResource fileSystemResource = CreateResourceInstance(TemporaryFileName);
- Stream inputStream = fileSystemResource.InputStream;
- inputStream.Close();
+ Stream inputStream;
+ Assert.Throws(() => inputStream = fileSystemResource.InputStream);
}
[Test]
@@ -150,11 +149,10 @@ public void CreateRelativeResourceIsEqualToOriginalAfterBouncingUpAndDownTheDire
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void CreateRelativeWithNullRelativePath()
{
IResource resource = CreateResourceInstance(".");
- resource.CreateRelative(null);
+ Assert.Throws(() => resource.CreateRelative(null));
}
[Test]
@@ -240,11 +238,10 @@ public void RelativeResourceFromSubfolder()
}
[Test]
- [ExpectedException(typeof(UriFormatException))]
public void RelativeResourceTooManyBackLevels()
{
FileSystemResource res = CreateResourceInstance("/samples/artfair/dummy.txt");
- res.CreateRelative("../../../index.html");
+ Assert.Throws(() => res.CreateRelative("../../../index.html"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceTests.cs
index e87a9b07d..5098cf84e 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/FileSystemResourceTests.cs
@@ -49,11 +49,10 @@ public void LeadingProtocolIsNotTreatedRelative()
}
[Test]
- [ExpectedException(typeof (UriFormatException))]
public void RelativeUncResourceTooManyBackLevels()
{
FileSystemResource res = new FileSystemResource(@"\\server\share\samples\artfair\dummy.txt");
- res.CreateRelative(@"..\..\..\index.html");
+ Assert.Throws(() => res.CreateRelative(@"..\..\..\index.html"));
}
[Test(Description="SPRNET-89")]
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/InputStreamResourceTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/InputStreamResourceTests.cs
index b68980701..475aaf87c 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/InputStreamResourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/InputStreamResourceTests.cs
@@ -69,13 +69,12 @@ public void Instantiation ()
}
[Test]
- [ExpectedException (typeof (ArgumentNullException))]
- public void InstantiationWithNull () {
- new InputStreamResource (null, "A null resource.");
+ public void InstantiationWithNull ()
+ {
+ Assert.Throws(() => new InputStreamResource (null, "A null resource."));
}
[Test]
- [ExpectedException (typeof (InvalidOperationException))]
public void ReadStreamMultipleTimes ()
{
FileInfo file = null;
@@ -87,7 +86,8 @@ public void ReadStreamMultipleTimes ()
// attempting to read this stream twice is an error...
InputStreamResource res = new InputStreamResource (stream, "A temporary resource.");
Stream streamOne = res.InputStream;
- Stream streamTwo = res.InputStream; // should bail here
+ Stream streamTwo;
+ Assert.Throws(() => streamTwo = res.InputStream); // should bail here
}
finally
{
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/ResourceConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/ResourceConverterTests.cs
index 9b0daac77..f35394c73 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/ResourceConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/ResourceConverterTests.cs
@@ -39,7 +39,7 @@ public sealed class ResourceConverterTests
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, just to ensure that the logging code is correct
@@ -66,19 +66,17 @@ public void ConvertFrom()
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNullReference()
{
ResourceConverter vrt = new ResourceConverter();
- vrt.ConvertFrom(null);
+ Assert.Throws(() => vrt.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
ResourceConverter vrt = new ResourceConverter();
- vrt.ConvertFrom(new TestFixtureAttribute());
+ Assert.Throws(() => vrt.ConvertFrom(new TestFixtureAttribute()));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/ResourceHandlerRegistryTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/ResourceHandlerRegistryTests.cs
index 4f7eb1e81..bc260ac29 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/ResourceHandlerRegistryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/ResourceHandlerRegistryTests.cs
@@ -36,38 +36,33 @@ namespace Spring.Core.IO
public sealed class ResourceHandlerRegistryTests
{
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void WithNullProtocolName()
{
- ResourceHandlerRegistry.RegisterResourceHandler(null, GetType());
+ Assert.Throws(() => ResourceHandlerRegistry.RegisterResourceHandler(null, GetType()));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void WithNullIResourceHandlerType()
{
- ResourceHandlerRegistry.RegisterResourceHandler("beep", (Type) null);
+ Assert.Throws(() => ResourceHandlerRegistry.RegisterResourceHandler("beep", (Type) null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void WithWhitespacedProtocolName()
{
- ResourceHandlerRegistry.RegisterResourceHandler("\t ", GetType());
+ Assert.Throws(() => ResourceHandlerRegistry.RegisterResourceHandler("\t ", GetType()));
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void WithNonIResourceHandlerType()
{
- ResourceHandlerRegistry.RegisterResourceHandler("beep", GetType());
+ Assert.Throws(() => ResourceHandlerRegistry.RegisterResourceHandler("beep", GetType()));
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void WithIResourceHandlerTypeWithNoValidCtor()
{
- ResourceHandlerRegistry.RegisterResourceHandler("beep", typeof(IncompatibleResource));
+ Assert.Throws(() => ResourceHandlerRegistry.RegisterResourceHandler("beep", typeof(IncompatibleResource)));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/StringResourceTests.cs b/test/Spring/Spring.Core.Tests/Core/IO/StringResourceTests.cs
index ce788bb54..100589b00 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/StringResourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/StringResourceTests.cs
@@ -72,11 +72,10 @@ public void ReturnsCorrectEncodedStream()
}
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void DoesntSupportRelativeResources()
{
StringResource r = new StringResource(string.Empty);
- r.CreateRelative("foo");
+ Assert.Throws(() => r.CreateRelative("foo"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/IO/UrlResourceTest.cs b/test/Spring/Spring.Core.Tests/Core/IO/UrlResourceTest.cs
index 53b9f176e..3325a5a91 100644
--- a/test/Spring/Spring.Core.Tests/Core/IO/UrlResourceTest.cs
+++ b/test/Spring/Spring.Core.Tests/Core/IO/UrlResourceTest.cs
@@ -45,11 +45,10 @@ public void CreateUrlResourceWithGivenPath()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void CreateInvalidUrlResource()
{
string uri = null;
- new UrlResource(uri);
+ Assert.Throws(() => new UrlResource(uri));
}
[Test]
@@ -67,21 +66,19 @@ public void ExistsValidHttp()
}
[Test]
- [ExpectedException(typeof(FileNotFoundException))]
public void GetInvalidFileInfo()
{
UrlResource urlResource = new UrlResource("http://www.springframework.net/");
- FileInfo file = urlResource.File;
- file.GetType();
+ FileInfo file;
+ Assert.Throws(() => file = urlResource.File);
}
[Test]
- [ExpectedException(typeof(FileNotFoundException))]
public void GetInvalidFileInfoWithOddPort()
{
UrlResource urlResource = new UrlResource("http://www.springframework.net:76/");
- FileInfo file = urlResource.File;
- file.GetType();
+ FileInfo temp;
+ Assert.Throws(() => temp = urlResource.File);
}
[Test]
@@ -156,11 +153,10 @@ public void RelativeResourceFromSubfolder()
}
[Test]
- [ExpectedException(typeof(UriFormatException))]
public void RelativeResourceTooManyBackLevels()
{
UrlResource res = new UrlResource("http://www.springframework.net/samples/artfair/download.html");
- res.CreateRelative("../../../index.html");
+ Assert.Throws(() => res.CreateRelative("../../../index.html"));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Core/MethodGenericArgumentsCountCriteriaTests.cs b/test/Spring/Spring.Core.Tests/Core/MethodGenericArgumentsCountCriteriaTests.cs
index f52e40ea6..e00b898e1 100644
--- a/test/Spring/Spring.Core.Tests/Core/MethodGenericArgumentsCountCriteriaTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/MethodGenericArgumentsCountCriteriaTests.cs
@@ -46,18 +46,16 @@ public void Instantiation ()
}
[Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
public void InstantiationBailsWithGenericArgumentCountSetToLessThanZero ()
{
- MethodGenericArgumentsCountCriteria criteria = new MethodGenericArgumentsCountCriteria(-10);
+ Assert.Throws(() => new MethodGenericArgumentsCountCriteria(-10));
}
[Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
public void BailsWhenExpectedGenericArgumentCountSetToLessThanZero()
{
MethodGenericArgumentsCountCriteria criteria = new MethodGenericArgumentsCountCriteria();
- criteria.ExpectedGenericArgumentCount = -12;
+ Assert.Throws(() => criteria.ExpectedGenericArgumentCount = -12);
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/MethodParametersCountCriteriaTests.cs b/test/Spring/Spring.Core.Tests/Core/MethodParametersCountCriteriaTests.cs
index 4d58e23b7..9aa984512 100644
--- a/test/Spring/Spring.Core.Tests/Core/MethodParametersCountCriteriaTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/MethodParametersCountCriteriaTests.cs
@@ -46,18 +46,16 @@ public void Instantiation ()
}
[Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
public void InstantiationBailsWithParameterCountSetToLessThanZero ()
{
- MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (-10);
+ Assert.Throws(() => new MethodParametersCountCriteria (-10));
}
[Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
public void BailsWhenExpectedParameterCountSetToLessThanZero ()
{
MethodParametersCountCriteria criteria = new MethodParametersCountCriteria ();
- criteria.ExpectedParameterCount = -12;
+ Assert.Throws(() => criteria.ExpectedParameterCount = -12);
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/MethodReturnTypeCriteriaTests.cs b/test/Spring/Spring.Core.Tests/Core/MethodReturnTypeCriteriaTests.cs
index 31657d6b5..f136a7773 100644
--- a/test/Spring/Spring.Core.Tests/Core/MethodReturnTypeCriteriaTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/MethodReturnTypeCriteriaTests.cs
@@ -20,11 +20,9 @@
#region Imports
-using System;
using System.Reflection;
using NUnit.Framework;
-using Spring.Objects;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Core/OrderComparatorTests.cs b/test/Spring/Spring.Core.Tests/Core/OrderComparatorTests.cs
index e65e1a905..59db54aea 100644
--- a/test/Spring/Spring.Core.Tests/Core/OrderComparatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/OrderComparatorTests.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using NUnit.Framework;
using Spring.Util;
diff --git a/test/Spring/Spring.Core.Tests/Core/RegularExpressionEventNameCriteriaTests.cs b/test/Spring/Spring.Core.Tests/Core/RegularExpressionEventNameCriteriaTests.cs
index d5a89b60a..152b586c3 100644
--- a/test/Spring/Spring.Core.Tests/Core/RegularExpressionEventNameCriteriaTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/RegularExpressionEventNameCriteriaTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-using System.Text.RegularExpressions;
using System.Reflection;
using Spring.Objects;
diff --git a/test/Spring/Spring.Core.Tests/Core/RegularExpressionMethodNameCriteriaTests.cs b/test/Spring/Spring.Core.Tests/Core/RegularExpressionMethodNameCriteriaTests.cs
index 44a667c14..bc778706e 100644
--- a/test/Spring/Spring.Core.Tests/Core/RegularExpressionMethodNameCriteriaTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/RegularExpressionMethodNameCriteriaTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Reflection;
using Spring.Objects;
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/CredentialConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/CredentialConverterTests.cs
index 3f23464bc..55f12c5aa 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/CredentialConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/CredentialConverterTests.cs
@@ -37,19 +37,17 @@ namespace Spring.Core.TypeConversion
public sealed class CredentialConverterTests
{
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void ConvertFromNullReference()
{
CredentialConverter cc = new CredentialConverter();
- cc.ConvertFrom(null);
+ Assert.Throws(() => cc.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
CredentialConverter cc = new CredentialConverter();
- cc.ConvertFrom(12);
+ Assert.Throws(() => cc.ConvertFrom(12));
}
[Test]
@@ -67,19 +65,17 @@ public void ConvertFrom()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConvertFromEmptyString()
{
CredentialConverter cc = new CredentialConverter();
- cc.ConvertFrom(string.Empty);
+ Assert.Throws(() => cc.ConvertFrom(string.Empty));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConvertFromMalformedString()
{
CredentialConverter cc = new CredentialConverter();
- object credential = cc.ConvertFrom(@"Spring:bbaia\sprnet");
+ Assert.Throws(() => cc.ConvertFrom(@"Spring:bbaia\sprnet"));
}
[Test]
@@ -97,11 +93,10 @@ public void ConvertFromStringWithoutDomain()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConvertFromStringWithIncorrectDomain()
{
CredentialConverter cc = new CredentialConverter();
- object credential = cc.ConvertFrom(@"\bbaia:sprnet");
+ Assert.Throws(() => cc.ConvertFrom(@"\bbaia:sprnet"));
}
[Test]
@@ -119,11 +114,10 @@ public void ConvertFromStringWithoutPassword()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConvertFromStringWithIncorrectPassword()
{
CredentialConverter cc = new CredentialConverter();
- object credential = cc.ConvertFrom(@"\bbaia:");
+ Assert.Throws(() => cc.ConvertFrom(@"\bbaia:"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/CustomNumberConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/CustomNumberConverterTests.cs
index 1f6b2fdc7..127eb4868 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/CustomNumberConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/CustomNumberConverterTests.cs
@@ -27,108 +27,97 @@
#endregion
-namespace Spring.Core.TypeConversion
+namespace Spring.Core.TypeConversion
{
///
/// Unit tests for the CustomNumberConverter class.
///
[TestFixture]
- public class CustomNumberConverterTests
+ public class CustomNumberConverterTests
{
[Test]
- public void Instantiation ()
+ public void Instantiation()
{
CustomNumberConverter verter
- = new CustomNumberConverter (typeof (int), null, true);
+ = new CustomNumberConverter(typeof(int), null, true);
// mmm, this should still pass... it aint a number though
verter
- = new CustomNumberConverter (typeof (bool), null, true);
+ = new CustomNumberConverter(typeof(bool), null, true);
}
[Test]
- [ExpectedException (typeof (ArgumentException))]
- public void InstantiationWithNonPrimitiveType ()
+ public void InstantiationWithNonPrimitiveType()
{
- CustomNumberConverter verter
- = new CustomNumberConverter (
- typeof (CustomNumberConverterTests), null, true);
+ Assert.Throws(() => new CustomNumberConverter(typeof(CustomNumberConverterTests), null, true));
}
[Test]
- public void CanConvertFromString ()
+ public void CanConvertFromString()
{
- CustomNumberConverter verter
- = new CustomNumberConverter (typeof (int), null, true);
- Assert.IsTrue (verter.CanConvertFrom (typeof (string)));
- Assert.IsFalse (verter.CanConvertFrom (null));
+ CustomNumberConverter verter = new CustomNumberConverter(typeof(int), null, true);
+ Assert.IsTrue(verter.CanConvertFrom(typeof(string)));
+ Assert.IsFalse(verter.CanConvertFrom(null));
}
[Test]
- public void ConvertsEmptyStringToZeroWhenAllowed ()
+ public void ConvertsEmptyStringToZeroWhenAllowed()
{
- CustomNumberConverter verter
- = new CustomNumberConverter (typeof (int), null, true);
- int actual = (int) verter.ConvertFrom (
- null, CultureInfo.CurrentUICulture, string.Empty);
- Assert.AreEqual (0, actual);
+ CustomNumberConverter verter = new CustomNumberConverter(typeof(int), null, true);
+ int actual = (int) verter.ConvertFrom(null, CultureInfo.CurrentUICulture, string.Empty);
+ Assert.AreEqual(0, actual);
}
[Test]
- public void ConvertFromSupportedNumericType ()
+ public void ConvertFromSupportedNumericType()
{
- Type [] numTypes = new Type [] {
- typeof (int),
- typeof (uint),
- typeof (short),
- typeof (ushort),
- typeof (long),
- typeof (ulong),
- typeof (float),
- typeof (double),
+ Type[] numTypes = new Type[]
+ {
+ typeof(int),
+ typeof(uint),
+ typeof(short),
+ typeof(ushort),
+ typeof(long),
+ typeof(ulong),
+ typeof(float),
+ typeof(double),
};
int expected = 12;
- foreach (Type numType in numTypes)
+ foreach (Type numType in numTypes)
{
- try
+ try
{
- CustomNumberConverter verter
- = new CustomNumberConverter (numType, null, true);
- object actual = verter.ConvertFrom (
- null, CultureInfo.CurrentUICulture, expected.ToString ());
- Assert.AreEqual (expected, actual);
- }
- catch (Exception ex)
+ CustomNumberConverter verter = new CustomNumberConverter(numType, null, true);
+ object actual = verter.ConvertFrom(null, CultureInfo.CurrentUICulture, expected.ToString());
+ Assert.AreEqual(expected, actual);
+ }
+ catch (Exception ex)
{
- Assert.Fail ("Bailed when converting type '" + numType + "' : " + ex);
+ Assert.Fail("Bailed when converting type '" + numType + "' : " + ex);
}
}
}
[Test]
- [ExpectedException (typeof (FormatException))]
- public void BailsOnEmptyStringWhenNotAllowed ()
+ public void BailsOnEmptyStringWhenNotAllowed()
{
CustomNumberConverter verter
- = new CustomNumberConverter (typeof (int), null, false);
- verter.ConvertFrom (null, CultureInfo.CurrentUICulture, string.Empty);
+ = new CustomNumberConverter(typeof(int), null, false);
+ Assert.Throws(() => verter.ConvertFrom(null, CultureInfo.CurrentUICulture, string.Empty));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ConvertFromNonSupportedNumericTypeOptionBails ()
+ public void ConvertFromNonSupportedNumericTypeOptionBails()
{
CustomNumberConverter verter
- = new CustomNumberConverter (typeof (char), null, false);
- object foo = verter.ConvertFrom ("12");
+ = new CustomNumberConverter(typeof(char), null, false);
+ Assert.Throws(() => verter.ConvertFrom("12"));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ConvertFromNonSupportedOptionBails ()
+ public void ConvertFromNonSupportedOptionBails()
{
- CustomNumberConverter verter
- = new CustomNumberConverter (typeof (int), null, false);
- object foo = verter.ConvertFrom (12);
- }
+ CustomNumberConverter verter = new CustomNumberConverter(typeof(int), null, false);
+ Assert.Throws(() => verter.ConvertFrom(12));
+ }
}
-}
+}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/FileInfoConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/FileInfoConverterTests.cs
index 32b13b05e..606e06f8a 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/FileInfoConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/FileInfoConverterTests.cs
@@ -63,19 +63,17 @@ public void FileConverter()
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNullReference()
{
FileInfoConverter vrt = new FileInfoConverter();
- vrt.ConvertFrom(null);
+ Assert.Throws(() => vrt.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
FileInfoConverter vrt = new FileInfoConverter();
- vrt.ConvertFrom(12);
+ Assert.Throws(() => vrt.ConvertFrom(12));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/NameValueConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/NameValueConverterTests.cs
index 08b49e437..c19879890 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/NameValueConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/NameValueConverterTests.cs
@@ -71,19 +71,17 @@ public void ConvertFrom ()
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ConvertFromNullReference ()
+ public void ConvertFromNullReference()
{
- NameValueConverter vrt = new NameValueConverter ();
- vrt.ConvertFrom (null);
+ NameValueConverter vrt = new NameValueConverter();
+ Assert.Throws(() => vrt.ConvertFrom(null));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ConvertFromNonSupportedOptionBails ()
+ public void ConvertFromNonSupportedOptionBails()
{
- NameValueConverter vrt = new NameValueConverter ();
- vrt.ConvertFrom (true);
+ NameValueConverter vrt = new NameValueConverter();
+ Assert.Throws(() => vrt.ConvertFrom(true));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RGBColorConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RGBColorConverterTests.cs
index ed753ae22..3329fa13e 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RGBColorConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RGBColorConverterTests.cs
@@ -49,51 +49,45 @@ public void ConvertFromRGB()
}
[Test]
- [ExpectedException(typeof (FormatException))]
public void ConvertFromCommaSeparatedListWithNotEnoughValues()
{
RGBColorConverter converter = new RGBColorConverter();
- converter.ConvertFrom("255, 235");
+ Assert.Throws(() => converter.ConvertFrom("255, 235"));
}
[Test]
- [ExpectedException(typeof (FormatException))]
public void ConvertFromCommaSeparatedListWithOutOfRangeValue()
{
RGBColorConverter converter = new RGBColorConverter();
- converter.ConvertFrom("255, 235, 4567");
+ Assert.Throws(() => converter.ConvertFrom("255, 235, 4567"));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNullReference()
{
RGBColorConverter vrt = new RGBColorConverter();
- vrt.ConvertFrom(null);
+ Assert.Throws(() => vrt.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromEmptyString()
{
RGBColorConverter vrt = new RGBColorConverter();
- vrt.ConvertFrom(string.Empty);
+ Assert.Throws(() => vrt.ConvertFrom(string.Empty));
}
[Test]
- [ExpectedException(typeof (FormatException))]
public void ConvertFromGarbageBails()
{
RGBColorConverter vrt = new RGBColorConverter();
- vrt.ConvertFrom("*&&%%^�");
+ Assert.Throws(() => vrt.ConvertFrom("*&&%%^�"));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
RGBColorConverter vrt = new RGBColorConverter();
- vrt.ConvertFrom(12);
+ Assert.Throws(() => vrt.ConvertFrom(12));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegexConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegexConverterTests.cs
index 96ae223e0..d4631c89a 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegexConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegexConverterTests.cs
@@ -37,19 +37,17 @@ namespace Spring.Core.TypeConversion
public sealed class RegexConverterTests
{
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void ConvertFromNullReference()
{
RegexConverter rc = new RegexConverter();
- rc.ConvertFrom(null);
+ Assert.Throws(() => rc.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
RegexConverter rc = new RegexConverter();
- rc.ConvertFrom(12);
+ Assert.Throws(() => rc.ConvertFrom(12));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegistryKeyConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegistryKeyConverterTests.cs
index 120d23bf6..d07a927ae 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegistryKeyConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RegistryKeyConverterTests.cs
@@ -36,19 +36,17 @@ namespace Spring.Core.TypeConversion
public sealed class RegistryKeyConverterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ConvertFromNullReference()
{
RegistryKeyConverter rkc = new RegistryKeyConverter();
- rkc.ConvertFrom(null);
+ Assert.Throws(() => rkc.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
RegistryKeyConverter rkc = new RegistryKeyConverter();
- rkc.ConvertFrom(12);
+ Assert.Throws(() => rkc.ConvertFrom(12));
}
[Test]
@@ -63,27 +61,24 @@ public void ConvertFrom()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ConvertFromEmptyString()
{
RegistryKeyConverter rkc = new RegistryKeyConverter();
- rkc.ConvertFrom(string.Empty);
+ Assert.Throws(() => rkc.ConvertFrom(string.Empty));
}
[Test]
- [ExpectedException(typeof(ArgumentException), ExpectedMessage = @"Registry key [HKEY_CURRENT_USER\sdgsdfgsdfgxadas] does not exist.")]
public void ConvertFromBadKeyString()
{
RegistryKeyConverter rkc = new RegistryKeyConverter();
- rkc.ConvertFrom(@"HKEY_CURRENT_USER\sdgsdfgsdfgxadas\Xyz\Abc");
+ Assert.Throws(() => rkc.ConvertFrom(@"HKEY_CURRENT_USER\sdgsdfgsdfgxadas\Xyz\Abc"), @"Registry key [HKEY_CURRENT_USER\sdgsdfgsdfgxadas] does not exist.");
}
[Test]
- [ExpectedException(typeof(ArgumentException), ExpectedMessage="Invalid root hive name [HKEY_ERROR].")]
public void ConvertFromBadHiveString()
{
RegistryKeyConverter rkc = new RegistryKeyConverter();
- rkc.ConvertFrom(@"HKEY_ERROR\sdgsdfgsdfgxadas");
+ Assert.Throws(() => rkc.ConvertFrom(@"HKEY_ERROR\sdgsdfgsdfgxadas"), "Invalid root hive name [HKEY_ERROR].");
}
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/ResourceManagerTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/ResourceManagerTests.cs
index bd38da6bb..6ece3bf3e 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/ResourceManagerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/ResourceManagerTests.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections.Specialized;
using System.Resources;
using NUnit.Framework;
@@ -66,71 +65,64 @@ public void ConvertFrom ()
/// Test passing a null instance and see if expected exception is raised
///
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ConvertFromNullReference ()
+ public void ConvertFromNullReference ()
{
ResourceManagerConverter cvt = new ResourceManagerConverter();
- object foo = cvt.ConvertFrom (null);
+ Assert.Throws(() => cvt.ConvertFrom (null));
}
///
/// Test passing a single string with no ','
///
[Test]
- [ExpectedException (typeof (ArgumentException))]
- public void ConvertFromSingleString ()
+ public void ConvertFromSingleString ()
{
ResourceManagerConverter cvt = new ResourceManagerConverter();
- object foo = cvt.ConvertFrom ("Spring.TestResource.txt");
+ Assert.Throws(() => cvt.ConvertFrom ("Spring.TestResource.txt"));
}
///
/// Test passing a single ','
///
[Test]
- [ExpectedException (typeof (ArgumentException))]
- public void ConvertFromSingleComma ()
+ public void ConvertFromSingleComma ()
{
ResourceManagerConverter cvt = new ResourceManagerConverter();
- object foo = cvt.ConvertFrom (",");
+ Assert.Throws(() => cvt.ConvertFrom (","));
}
///
/// Test passing only assembly name
///
[Test]
- [ExpectedException (typeof (ArgumentException))]
- public void ConvertFromOnlyAssemblyNAme ()
+ public void ConvertFromOnlyAssemblyNAme ()
{
ResourceManagerConverter cvt = new ResourceManagerConverter();
- object foo = cvt.ConvertFrom (",Spring.Core.Tests");
+ Assert.Throws(() => cvt.ConvertFrom (",Spring.Core.Tests"));
}
///
/// Test passing only assembly name
///
[Test]
- [ExpectedException (typeof (ArgumentException))]
- public void ConvertFromOnlyResourceName()
+ public void ConvertFromOnlyResourceName()
{
ResourceManagerConverter cvt = new ResourceManagerConverter();
- object foo = cvt.ConvertFrom ("Spring.TestResource.txt,");
+ Assert.Throws(() => cvt.ConvertFrom ("Spring.TestResource.txt,"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
- public void ConvertFromBadAssembly()
+ public void ConvertFromBadAssembly()
{
ResourceManagerConverter cvt = new ResourceManagerConverter();
- object foo = cvt.ConvertFrom ("Spring.TestResource.txt, FooAssembly");
+ Assert.Throws(() => cvt.ConvertFrom ("Spring.TestResource.txt, FooAssembly"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConvertFromBad_App_GlobalResources()
{
ResourceManagerConverter cvt = new ResourceManagerConverter();
- object foo = cvt.ConvertFrom("Spring.TestResource.txt, "+ResourceManagerConverter.APP_GLOBALRESOURCES_ASSEMBLYNAME);
+ Assert.Throws(() => cvt.ConvertFrom("Spring.TestResource.txt, "+ResourceManagerConverter.APP_GLOBALRESOURCES_ASSEMBLYNAME));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RuntimeTypeConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RuntimeTypeConverterTests.cs
index 4c1d23854..7b62d447e 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/RuntimeTypeConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/RuntimeTypeConverterTests.cs
@@ -51,11 +51,10 @@ public void CanConvertTo ()
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ConvertFromNonSupportedType ()
+ public void ConvertFromNonSupportedType ()
{
RuntimeTypeConverter cnv = new RuntimeTypeConverter ();
- object foo = cnv.ConvertFrom (12);
+ Assert.Throws(() => cnv.ConvertFrom (12));
}
[Test]
@@ -64,7 +63,7 @@ public void ConvertFromString ()
RuntimeTypeConverter cnv = new RuntimeTypeConverter ();
object foo = cnv.ConvertFrom ("System.String");
Assert.IsNotNull (foo);
- Assert.AreEqual (this.GetType().GetType().FullName, foo.GetType ().FullName);
+ Assert.AreEqual (GetType().GetType().FullName, foo.GetType ().FullName);
}
[Test]
@@ -77,11 +76,10 @@ public void ConvertToString ()
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
- public void ConvertToStringFromNonSupportedType ()
+ public void ConvertToStringFromNonSupportedType ()
{
RuntimeTypeConverter cnv = new RuntimeTypeConverter ();
- object foo = cnv.ConvertTo (typeof (string), GetType ());
+ Assert.Throws(() => cnv.ConvertTo (typeof (string), GetType ()));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/StreamConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/StreamConverterTests.cs
index 0dcaa135e..52e79d99f 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/StreamConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/StreamConverterTests.cs
@@ -56,24 +56,21 @@ public void ConvertFrom()
[Test]
[Explicit] // fails if there is a transparent proxy that redirects to error page for non existing URL
- [ExpectedException(typeof (WebException))]
public void ConvertFromValidButNonExistingStreamResource()
{
- new StreamConverter().ConvertFrom("http://www.aaaabbbbccccddd.com");
+ Assert.Throws(() => new StreamConverter().ConvertFrom("http://www.aaaabbbbccccddd.com"));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNullReference()
{
- new StreamConverter().ConvertFrom(null);
+ Assert.Throws(() => new StreamConverter().ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
- new StreamConverter().ConvertFrom(12);
+ Assert.Throws(() => new StreamConverter().ConvertFrom(12));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/StringArrayConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/StringArrayConverterTests.cs
index 8414daf22..c5c712589 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/StringArrayConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/StringArrayConverterTests.cs
@@ -71,19 +71,17 @@ public void ConvertFromPreservesExtraneousWhitespace()
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNullReference()
{
StringArrayConverter vrt = new StringArrayConverter();
- vrt.ConvertFrom(null);
+ Assert.Throws(() => vrt.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof (NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
StringArrayConverter vrt = new StringArrayConverter();
- vrt.ConvertFrom(12);
+ Assert.Throws(() => vrt.ConvertFrom(12));
}
[Test]
@@ -110,19 +108,17 @@ public void EnsureCultureListSeparatorIsIgnored()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
- public void EmptyListSeparator()
+ public void EmptyListSeparator()
{
StringArrayConverter vrt = new StringArrayConverter();
- vrt.ListSeparator = string.Empty;
+ Assert.Throws(() => vrt.ListSeparator = string.Empty);
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TooLongListSeparator()
{
StringArrayConverter vrt = new StringArrayConverter();
- vrt.ListSeparator = " ";
+ Assert.Throws(() => vrt.ListSeparator = " ");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/TimeSpanConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/TimeSpanConverterTests.cs
index aa022797c..f31bc1ac3 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/TimeSpanConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/TimeSpanConverterTests.cs
@@ -36,27 +36,24 @@ namespace Spring.Core.TypeConversion
public sealed class TimeSpanConverterTests
{
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void ConvertFromNullReference()
{
TimeSpanConverter tsc = new TimeSpanConverter();
- tsc.ConvertFrom(null);
+ Assert.Throws(() => tsc.ConvertFrom(null));
}
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void ConvertFromNonSupportedOptionBails()
{
TimeSpanConverter tsc = new TimeSpanConverter();
- tsc.ConvertFrom(12);
+ Assert.Throws(() => tsc.ConvertFrom(12));
}
[Test]
- [ExpectedException(typeof(FormatException))]
public void ConvertFromStringMalformed()
{
TimeSpanConverter tsc = new TimeSpanConverter();
- tsc.ConvertFrom("15a");
+ Assert.Throws(() => tsc.ConvertFrom("15a"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/TypeConverterRegistryTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/TypeConverterRegistryTests.cs
index 60cea205a..62f362dbf 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/TypeConverterRegistryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/TypeConverterRegistryTests.cs
@@ -64,17 +64,15 @@ public void RegisterConverter()
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void RegisterConverterWithNonResolvableType()
{
- TypeConverterRegistry.RegisterConverter("Systemm.DateTime", "System.ComponentModel.DateTimeConverter");
+ Assert.Throws(() => TypeConverterRegistry.RegisterConverter("Systemm.DateTime", "System.ComponentModel.DateTimeConverter"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void RegisterConverterWithNonTypeConverter()
{
- TypeConverterRegistry.RegisterConverter("System.DateTime", "System.DateTime");
+ Assert.Throws(() => TypeConverterRegistry.RegisterConverter("System.DateTime", "System.DateTime"));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeConversion/UriConverterTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeConversion/UriConverterTests.cs
index 08ef0bad9..cce1d787a 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeConversion/UriConverterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeConversion/UriConverterTests.cs
@@ -68,19 +68,17 @@ public void ConvertFromMalformedUriBails ()
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void ConvertFromNullReference ()
{
UriConverter vrt = new UriConverter ();
- object actual = vrt.ConvertFrom (null);
+ Assert.Throws(() => vrt.ConvertFrom (null));
}
[Test]
- [ExpectedException (typeof (NotSupportedException))]
public void ConvertFromNonSupportedOptionBails ()
{
UriConverter vrt = new UriConverter ();
- object actual = vrt.ConvertFrom (12);
+ Assert.Throws(() => vrt.ConvertFrom (12));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeResolution/CachedTypeResolverTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeResolution/CachedTypeResolverTests.cs
index a226ebc0c..9e7863b02 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeResolution/CachedTypeResolverTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeResolution/CachedTypeResolverTests.cs
@@ -45,20 +45,18 @@ public void SetUp()
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void ResolveWithNullTypeName() {
ITypeResolver mockResolver = (ITypeResolver) mocks.DynamicMock(typeof(ITypeResolver));
CachedTypeResolver resolver = new CachedTypeResolver(mockResolver);
- resolver.Resolve(null);
+ Assert.Throws(() => resolver.Resolve(null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void InstantiateWithNullTypeResolver()
{
- new CachedTypeResolver(null);
+ Assert.Throws(() => new CachedTypeResolver(null));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeResolution/GenericTypeResolverTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeResolution/GenericTypeResolverTests.cs
index 99f9c49b0..e328f3bad 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeResolution/GenericTypeResolverTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeResolution/GenericTypeResolverTests.cs
@@ -57,10 +57,9 @@ public void ResolveLocalAssemblyGenericTypeDefinition()
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void ResolveLocalAssemblyGenericTypeOpen()
{
- GetTypeResolver().Resolve("Spring.Objects.TestGenericObject");
+ Assert.Throws(() => GetTypeResolver().Resolve("Spring.Objects.TestGenericObject"));
}
[Test]
@@ -91,17 +90,15 @@ public void ResolveGenericArrayTypeWithAssemblyName()
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void ResolveAmbiguousGenericTypeWithAssemblyName()
{
- Type t = GetTypeResolver().Resolve("Spring.Objects.TestGenericObject, System, string>");
+ Assert.Throws(() => GetTypeResolver().Resolve("Spring.Objects.TestGenericObject, System, string>"));
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void ResolveMalformedGenericType()
{
- Type t = GetTypeResolver().Resolve("Spring.Objects.TestGenericObject>");
+ Assert.Throws(() => GetTypeResolver().Resolve("Spring.Objects.TestGenericObject>"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeRegistryTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeRegistryTests.cs
index 1c3db80b4..4e565a185 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeRegistryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeRegistryTests.cs
@@ -24,7 +24,7 @@
using NUnit.Framework;
using Spring.Objects;
using Spring.Objects.Factory;
-using Spring.Util;
+
using IBar=Spring.Objects.Factory.IBar;
using Spring.Context;
using Spring.Context.Support;
@@ -61,71 +61,63 @@ public void TestAliasResolution()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void ResolveTypeWithNullAliasArg()
{
- TypeRegistry.ResolveType(null);
+ Assert.Throws(() => TypeRegistry.ResolveType(null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void ResolveTypeWithEmptyAliasArg()
{
- TypeRegistry.ResolveType(string.Empty);
+ Assert.Throws(() => TypeRegistry.ResolveType(string.Empty));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void ResolveTypeWithWhitespacedAliasArg()
{
- TypeRegistry.ResolveType(" ");
+ Assert.Throws(() => TypeRegistry.ResolveType(" "));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterTypeWithNullAliasArg()
{
- TypeRegistry.RegisterType(null, typeof (TestObject));
+ Assert.Throws(() => TypeRegistry.RegisterType(null, typeof (TestObject)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterTypeWithEmptyAliasArg()
{
- TypeRegistry.RegisterType(string.Empty, typeof (TestObject));
+ Assert.Throws(() => TypeRegistry.RegisterType(string.Empty, typeof (TestObject)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterTypeWithWhitespacedAliasArg()
{
- TypeRegistry.RegisterType(" ", typeof (TestObject));
+ Assert.Throws(() => TypeRegistry.RegisterType(" ", typeof (TestObject)));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterTypeWithNullTypeArg()
{
- TypeRegistry.RegisterType("foo", (Type) null);
+ Assert.Throws(() => TypeRegistry.RegisterType("foo", (Type) null));
}
+ [Test]
public void RegisterTypeWithNullTypeStringArg()
{
- TypeRegistry.RegisterType("foo", (String) null);
+ Assert.Throws(() => TypeRegistry.RegisterType("foo", (string) null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterTypeWithEmptyTypeStringArg()
{
- TypeRegistry.RegisterType("foo", string.Empty);
+ Assert.Throws(() => TypeRegistry.RegisterType("foo", string.Empty));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterTypeWithWhitespacedTypeStringArg()
{
- TypeRegistry.RegisterType("foo", " ");
+ Assert.Throws(() => TypeRegistry.RegisterType("foo", " "));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs
index c5f6ff5b5..89f3d5764 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs
@@ -47,10 +47,9 @@ public void ResolveFromAssemblyQualifiedName()
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void ResolveFromBadAssemblyQualifiedName()
{
- TypeResolutionUtils.ResolveType("Spring.Objects.TestObject, Spring.Core.FooTests");
+ Assert.Throws(() => TypeResolutionUtils.ResolveType("Spring.Objects.TestObject, Spring.Core.FooTests"));
}
[Test]
@@ -62,15 +61,11 @@ public void ResolveFromShortName()
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void ResolveFromBadShortName()
{
- TypeResolutionUtils.ResolveType("Spring.Objects.FooBarTestObject");
+ Assert.Throws(() => TypeResolutionUtils.ResolveType("Spring.Objects.FooBarTestObject"));
}
-
-
-
[Test]
public void ResolveInterfaceArrayFromStringArray()
{
@@ -83,11 +78,10 @@ public void ResolveInterfaceArrayFromStringArray()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ResolveInterfaceArrayFromStringArrayWithNonInterfaceTypes()
{
string[] input = new string[] { GetType().AssemblyQualifiedName };
- TypeResolutionUtils.ResolveInterfaceArray(input);
+ Assert.Throws(() => TypeResolutionUtils.ResolveInterfaceArray(input));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolverTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolverTests.cs
index e7c7c4c55..12e3d0e83 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolverTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolverTests.cs
@@ -61,17 +61,15 @@ public void ResolveWithPartialAssemblyName()
/// when supplied a load of old rubbish as a type name.
///
[Test]
- [ExpectedException(typeof (TypeLoadException))]
public void ResolveWithNonExistentTypeName()
{
- GetTypeResolver().Resolve("RaskolnikovsDilemma, System.StPetersburg");
+ Assert.Throws(() => GetTypeResolver().Resolve("RaskolnikovsDilemma, System.StPetersburg"));
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void ResolveBadArgs()
{
- GetTypeResolver().Resolve(null);
+ Assert.Throws(() => GetTypeResolver().Resolve(null));
}
[Test]
@@ -82,12 +80,10 @@ public void ResolveLocalAssemblyTypeWithFullAssemblyQualifiedName()
}
[Test]
- [ExpectedException(typeof(TypeLoadException))]
public void LoadTypeFromSystemAssemblySpecifyingOnlyTheAssemblyDisplayName()
{
string stringType = typeof(string).FullName + ", System";
- Type t = GetTypeResolver().Resolve(stringType);
- Assert.AreEqual(typeof(string), t);
+ Assert.Throws(() => GetTypeResolver().Resolve(stringType));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/CoreCompilerOptionsTests.cs b/test/Spring/Spring.Core.Tests/CoreCompilerOptionsTests.cs
index fa5d47cbb..0ee9e334d 100644
--- a/test/Spring/Spring.Core.Tests/CoreCompilerOptionsTests.cs
+++ b/test/Spring/Spring.Core.Tests/CoreCompilerOptionsTests.cs
@@ -34,7 +34,7 @@ namespace Spring
[TestFixture]
public sealed class CoreCompilerOptionsTests : CompilerOptionsTests
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
AssemblyToCheck = Assembly.GetAssembly(typeof (ObjectsException));
diff --git a/test/Spring/Spring.Core.Tests/CoreExceptionTests.cs b/test/Spring/Spring.Core.Tests/CoreExceptionTests.cs
index 804812c57..3db7727a2 100644
--- a/test/Spring/Spring.Core.Tests/CoreExceptionTests.cs
+++ b/test/Spring/Spring.Core.Tests/CoreExceptionTests.cs
@@ -35,7 +35,7 @@ namespace Spring
[TestFixture]
public sealed class CoreExceptionTests : ExceptionsTest
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
AssemblyToCheck = Assembly.GetAssembly(typeof (ObjectsException));
diff --git a/test/Spring/Spring.Core.Tests/DataBinding/BaseBindingManagerTests.cs b/test/Spring/Spring.Core.Tests/DataBinding/BaseBindingManagerTests.cs
index 368405cdd..cb2a268fb 100644
--- a/test/Spring/Spring.Core.Tests/DataBinding/BaseBindingManagerTests.cs
+++ b/test/Spring/Spring.Core.Tests/DataBinding/BaseBindingManagerTests.cs
@@ -37,7 +37,7 @@ public class BaseBindingManagerTests
{
private BaseBindingManager mgr;
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void SetUp()
{
mgr = new BaseBindingManager();
diff --git a/test/Spring/Spring.Core.Tests/DataBinding/SimpleExpressionBindingTests.cs b/test/Spring/Spring.Core.Tests/DataBinding/SimpleExpressionBindingTests.cs
index 7d334760d..751cba9e6 100644
--- a/test/Spring/Spring.Core.Tests/DataBinding/SimpleExpressionBindingTests.cs
+++ b/test/Spring/Spring.Core.Tests/DataBinding/SimpleExpressionBindingTests.cs
@@ -47,38 +47,33 @@ public void BindToNullable()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void WithNullMessageId()
{
- new SimpleExpressionBinding("exp", "exp").SetErrorMessage(null, "errors");
+ Assert.Throws(() => new SimpleExpressionBinding("exp", "exp").SetErrorMessage(null, "errors"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void WithEmptyMessageId()
{
- new SimpleExpressionBinding("exp", "exp").SetErrorMessage("", "errors");
+ Assert.Throws(() => new SimpleExpressionBinding("exp", "exp").SetErrorMessage("", "errors"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void WithWhitespaceMessageId()
{
- new SimpleExpressionBinding("exp", "exp").SetErrorMessage("\t ", "errors");
+ Assert.Throws(() => new SimpleExpressionBinding("exp", "exp").SetErrorMessage("\t ", "errors"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithNullProviders()
{
- new SimpleExpressionBinding("exp", "exp").SetErrorMessage("error", null);
+ Assert.Throws(() => new SimpleExpressionBinding("exp", "exp").SetErrorMessage("error", null));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithEmptyProviders()
{
- new SimpleExpressionBinding("exp", "exp").SetErrorMessage("error", new string[0]);
+ Assert.Throws(() => new SimpleExpressionBinding("exp", "exp").SetErrorMessage("error", new string[0]));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs b/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs
index 59ec4c6cd..55ab3ee37 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/ConstructorNodeTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs b/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs
index 16ebe788f..8adfb6055 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs
@@ -41,7 +41,6 @@
using Spring.Context.Support;
using Spring.Core;
using Spring.Core.TypeResolution;
-using Spring.Expressions;
using Spring.Expressions.Parser.antlr;
using Spring.Expressions.Parser.antlr.collections;
using Spring.Expressions.Processors;
@@ -49,7 +48,6 @@
using Spring.Objects.Factory;
using Spring.Threading;
using Spring.Util;
-using Foo = Spring.Expressions.Foo;
#endregion
@@ -129,7 +127,7 @@ public void SetUp()
TypeRegistry.RegisterType("Society", typeof(Society));
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TearDown()
{
//DynamicCodeManager.SaveAssembly();
@@ -366,20 +364,18 @@ public void ThrowsSyntaxErrorException()
/// Should throw exception for null root object
///
[Test]
- [ExpectedException(typeof(NullValueInNestedPathException))]
public void NullRoot()
{
- ExpressionEvaluator.GetValue(null, "dummy.expression");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "dummy.expression"));
}
///
/// Should throw exception for null root object
///
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void TryingToSetTheValueOfNonSettableNode()
{
- ExpressionEvaluator.SetValue(null, "10", 5);
+ Assert.Throws(() => ExpressionEvaluator.SetValue(null, "10", 5));
}
///
@@ -397,10 +393,9 @@ public void GetNullOrEmptyExpression()
/// Should fail when setting value for the empty expression
///
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void SetNullOrEmptyExpression()
{
- ExpressionEvaluator.SetValue("xyz", null, "abc");
+ Assert.Throws(() => ExpressionEvaluator.SetValue("xyz", null, "abc"));
}
///
@@ -652,10 +647,9 @@ public void TestIndexedPropertyAccess()
/// Tests indexer access with invalid number of indices
///
[Test]
- [ExpectedException(typeof(InvalidPropertyException))]
public void TestIndexedPropertyAccessWithInvalidNumberOfIndices()
{
- ExpressionEvaluator.GetValue(tesla, "Inventions[3, 2]");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(tesla, "Inventions[3, 2]"));
}
///
@@ -699,10 +693,9 @@ public void TestMethodEvaluationOnDifferentArgumentTypes()
/// Tests missing method accessors
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestMissingMethodAccess()
{
- ExpressionEvaluator.GetValue("xyz", "ToStringilyLingily()");
+ Assert.Throws(() => ExpressionEvaluator.GetValue("xyz", "ToStringilyLingily()"));
}
///
@@ -863,10 +856,9 @@ public void TestConstructor()
/// Tests missing constructor
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestMissingConstructor()
{
- ExpressionEvaluator.GetValue(null, "new Decimal('xyz')");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "new Decimal('xyz')"));
}
///
@@ -949,20 +941,18 @@ public void TestVariableNode()
/// Try to set 'this' variable
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TryToSetThis()
{
- ExpressionEvaluator.SetValue(null, "#this", "xyz");
+ Assert.Throws(() => ExpressionEvaluator.SetValue(null, "#this", "xyz"));
}
///
/// Try to set 'root' variable
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TryToSetRoot()
{
- ExpressionEvaluator.SetValue(null, "#root", "xyz");
+ Assert.Throws(() => ExpressionEvaluator.SetValue(null, "#root", "xyz"));
}
///
@@ -1410,23 +1400,21 @@ public void TestMatchesOperator()
/// Type coercion failure.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestTypeCoercionForUncoercableTypes()
{
- ExpressionEvaluator.GetValue(null, "'xyz' > 123");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "'xyz' > 123"));
}
///
/// Type comparison failure.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestComparisonOfInstancesThatDoNotImplementIComparable()
{
Dictionary vars = new Dictionary();
vars["tesla"] = tesla;
vars["pupin"] = pupin;
- ExpressionEvaluator.GetValue(null, "#tesla > #pupin", vars);
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "#tesla > #pupin", vars));
}
///
@@ -1469,10 +1457,9 @@ public void TestAddOperator()
/// Tests addition operator with invalid arguments.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestAddOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "DateTime.Today + false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "DateTime.Today + false"));
}
///
@@ -1507,10 +1494,9 @@ public void TestSubtractOperator()
/// Tests subtraction operator with invalid arguments.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestSubtractOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "DateTime.Today - false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "DateTime.Today - false"));
}
///
@@ -1531,10 +1517,9 @@ public void TestMultiplyOperator()
/// Tests multiplication operator with invalid arguments.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestMultiplyOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "DateTime.Today * false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "DateTime.Today * false"));
}
///
@@ -1555,10 +1540,9 @@ public void TestDivideOperator()
/// Tests division operator with invalid arguments.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestDivideOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "DateTime.Today / false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "DateTime.Today / false"));
}
///
@@ -1579,10 +1563,9 @@ public void TestModulusOperator()
/// Tests modulus operator with invalid arguments.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestModulusOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "DateTime.Today % false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "DateTime.Today % false"));
}
///
@@ -1602,30 +1585,27 @@ public void TestPowerOperator()
/// Tests power operator with invalid arguments.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestPowerOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "DateTime.Today ^ false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "DateTime.Today ^ false"));
}
///
/// Tests unary minus operator with invalid argument.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestUnaryMinusOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "-false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "-false"));
}
///
/// Tests unary plus operator with invalid argument.
///
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestUnaryPlusOperatorWithInvalidArguments()
{
- ExpressionEvaluator.GetValue(null, "+false");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "+false"));
}
///
@@ -1644,12 +1624,10 @@ public void TestOperatorPrecedence()
/// Tests Spring reference when reference to a non-existant object is specified.
///
[Test]
- [ExpectedException(typeof(NoSuchObjectDefinitionException))]
public void TestReferenceForNonExistantObject()
{
- ContextRegistry.RegisterContext(
- new XmlApplicationContext(false, "assembly://Spring.Core.Tests/Spring.Context.Support/objects.xml"));
- ExpressionEvaluator.GetValue(null, "@(dummyRef)");
+ ContextRegistry.RegisterContext(new XmlApplicationContext(false, "assembly://Spring.Core.Tests/Spring.Context.Support/objects.xml"));
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "@(dummyRef)"));
}
///
@@ -1890,11 +1868,10 @@ public void TestSumAggregator()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestSumAggregatorWithNonNumber()
{
object[] arr = new object[] { 5, "ana", 12.2, 1 };
- ExpressionEvaluator.GetValue(arr, "sum()");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "sum()"));
}
[Test]
@@ -1912,11 +1889,10 @@ public void TestAverageAggregator()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestAverageAggregatorWithNonNumber()
{
object[] arr = new object[] { 5, "ana", 12.2, 1 };
- ExpressionEvaluator.GetValue(arr, "average()");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "average()"));
}
[Test]
@@ -1935,19 +1911,17 @@ public void TestMinAggregator()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestMinAggregatorWithNonComparable()
{
object[] arr = new object[] { new Object(), new Object() };
- ExpressionEvaluator.GetValue(arr, "min()");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "min()"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestMinAggregatorWithMixedTypes()
{
object[] arr = new object[] { 5, "ana", 12.2, 1 };
- ExpressionEvaluator.GetValue(arr, "min()");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "min()"));
}
[Test]
@@ -1966,19 +1940,17 @@ public void TestMaxAggregator()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestMaxAggregatorWithNonComparable()
{
object[] arr = new object[] { new Object(), new Object() };
- ExpressionEvaluator.GetValue(arr, "max()");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "max()"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestMaxAggregatorWithMixedTypes()
{
object[] arr = new object[] { 5, "ana", 12.2, 1 };
- ExpressionEvaluator.GetValue(arr, "max()");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "max()"));
}
[Test]
@@ -2037,19 +2009,17 @@ public void TestDistinctProcessor()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestDistinctProcessorWithInvalidArgumentType()
{
int[] arr = new int[] { 24, 8, 8, 6, 24, 6, 8, 6 };
- ExpressionEvaluator.GetValue(arr, "distinct(6)");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "distinct(6)"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestDistinctProcessorWithInvalidNumberOfArguments()
{
int[] arr = new int[] { 24, 8, 8, 6, 24, 6, 8, 6 };
- ExpressionEvaluator.GetValue(arr, "distinct(true, 4, 'xyz')");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(arr, "distinct(true, 4, 'xyz')"));
}
[Test]
@@ -2091,30 +2061,27 @@ public void TestSetValue()
/// Tests property access with null in the path.
///
[Test]
- [ExpectedException(typeof(NullValueInNestedPathException))]
public void TestPropertyGetWithNullInThePath()
{
- ExpressionEvaluator.GetValue(new Inventor(), "Name.Length");
+ Assert.Throws(() => ExpressionEvaluator.GetValue(new Inventor(), "Name.Length"));
}
///
/// Tests property set with null in the path.
///
[Test]
- [ExpectedException(typeof(NullValueInNestedPathException))]
public void TestPropertySetWithNullInThePath()
{
- ExpressionEvaluator.SetValue(new Inventor(), "Name.Length", 20);
+ Assert.Throws(() => ExpressionEvaluator.SetValue(new Inventor(), "Name.Length", 20));
}
///
/// Tries to set value of the PropertyOrFieldNode that represents type.
///
[Test]
- [ExpectedException(typeof(NotSupportedException))]
public void TestTypeSet()
{
- ExpressionEvaluator.SetValue(null, "DateTime", 20);
+ Assert.Throws(() => ExpressionEvaluator.SetValue(null, "DateTime", 20));
}
///
@@ -2702,11 +2669,9 @@ public void TestUnionOperator()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestUnionOperatorBad()
{
- object o = ExpressionEvaluator.GetValue(null, "#{1:'one', 2:'two', 3:'three'} + {1, 5}");
- Assert.IsInstanceOf(typeof(IDictionary), o);
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "#{1:'one', 2:'two', 3:'three'} + {1, 5}"));
}
[Test]
@@ -2748,11 +2713,9 @@ public void TestIntersectionOperator()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestIntersectionOperatorBad()
{
- object o = ExpressionEvaluator.GetValue(null, "#{1:'one', 2:'two', 3:'three'} * 'something'");
- Assert.IsInstanceOf(typeof(IDictionary), o);
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "#{1:'one', 2:'two', 3:'three'} * 'something'"));
}
[Test]
@@ -2791,11 +2754,9 @@ public void TestDifferenceOperator()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestDifferenceOperatorBad()
{
- object o = ExpressionEvaluator.GetValue(null, "#{1:'one', 2:'two', 3:'three'} - 'something'");
- Assert.IsInstanceOf(typeof(IDictionary), o);
+ Assert.Throws(() => ExpressionEvaluator.GetValue(null, "#{1:'one', 2:'two', 3:'three'} - 'something'"));
}
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Expressions/FunctionNodeTests.cs b/test/Spring/Spring.Core.Tests/Expressions/FunctionNodeTests.cs
index fa0712376..9b58bd309 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/FunctionNodeTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/FunctionNodeTests.cs
@@ -20,12 +20,9 @@
#region Imports
-using System;
-using System.Collections;
using System.Collections.Generic;
using System.Threading;
using NUnit.Framework;
-using Spring.Collections;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Expressions/OpADDTests.cs b/test/Spring/Spring.Core.Tests/Expressions/OpADDTests.cs
index 6a7521973..df967b3fb 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/OpADDTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/OpADDTests.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using NUnit.Framework;
namespace Spring.Expressions
diff --git a/test/Spring/Spring.Core.Tests/Expressions/OpORTests.cs b/test/Spring/Spring.Core.Tests/Expressions/OpORTests.cs
index 279e17977..9342644ff 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/OpORTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/OpORTests.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using NUnit.Framework;
namespace Spring.Expressions
diff --git a/test/Spring/Spring.Core.Tests/Expressions/Processors/ConversionProcessorTests.cs b/test/Spring/Spring.Core.Tests/Expressions/Processors/ConversionProcessorTests.cs
index 4eb2f6205..6d5957caf 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/Processors/ConversionProcessorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/Processors/ConversionProcessorTests.cs
@@ -23,7 +23,7 @@
using System;
using System.Collections;
using NUnit.Framework;
-using Spring.Core.TypeConversion;
+
using Spring.Globalization;
#endregion
@@ -37,13 +37,13 @@ namespace Spring.Expressions.Processors
[TestFixture]
public class ConversionProcessorTests
{
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
CultureTestScope.Set();
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void FixtureTearDown()
{
CultureTestScope.Reset();
diff --git a/test/Spring/Spring.Core.Tests/Expressions/Processors/OrderByProcessorTests.cs b/test/Spring/Spring.Core.Tests/Expressions/Processors/OrderByProcessorTests.cs
index b9331f18f..7eae803b5 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/Processors/OrderByProcessorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/Processors/OrderByProcessorTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Expressions/ReferenceNodeTests.cs b/test/Spring/Spring.Core.Tests/Expressions/ReferenceNodeTests.cs
index b4ec81d87..808447945 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/ReferenceNodeTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/ReferenceNodeTests.cs
@@ -20,11 +20,9 @@
#region Imports
-using System;
using System.Text;
using NUnit.Framework;
using Spring.Core.IO;
-using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Expressions/SelectionNodeTests.cs b/test/Spring/Spring.Core.Tests/Expressions/SelectionNodeTests.cs
index 67da0825e..4f6507df7 100644
--- a/test/Spring/Spring.Core.Tests/Expressions/SelectionNodeTests.cs
+++ b/test/Spring/Spring.Core.Tests/Expressions/SelectionNodeTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Globalization/AbstractLocalizerTests.cs b/test/Spring/Spring.Core.Tests/Globalization/AbstractLocalizerTests.cs
index 983caf3fe..d694cbb45 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/AbstractLocalizerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/AbstractLocalizerTests.cs
@@ -39,13 +39,13 @@ public abstract class AbstractLocalizerTests
{
private ILocalizer localizer;
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void TestFixtureSetUp()
{
CultureTestScope.Set("de-AT", "sr");
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TestFixtureTearDown()
{
CultureTestScope.Reset();
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/CurrencyFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/CurrencyFormatterTests.cs
index 2345fa5d6..4fe2d1cc1 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/CurrencyFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/CurrencyFormatterTests.cs
@@ -19,7 +19,7 @@
#endregion
using System;
-using System.Globalization;
+
using NUnit.Framework;
namespace Spring.Globalization.Formatters
@@ -32,11 +32,10 @@ namespace Spring.Globalization.Formatters
public class CurrencyFormatterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void FormatNullValue()
{
CurrencyFormatter fmt = new CurrencyFormatter();
- fmt.Format(null);
+ Assert.Throws(() => fmt.Format(null));
}
[Test]
@@ -48,11 +47,10 @@ public void ParseNullOrEmptyValue()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void FormatNonNumber()
{
CurrencyFormatter fmt = new CurrencyFormatter();
- fmt.Format("not a number");
+ Assert.Throws(() => fmt.Format("not a number"));
}
#if !MONO
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/DateTimeFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/DateTimeFormatterTests.cs
index 197812747..6851b2b3d 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/DateTimeFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/DateTimeFormatterTests.cs
@@ -32,11 +32,10 @@ namespace Spring.Globalization.Formatters
public class DateTimeFormatterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void FormatNullValue()
{
DateTimeFormatter fmt = new DateTimeFormatter("d");
- fmt.Format(null);
+ Assert.Throws(() => fmt.Format(null));
}
[Test]
@@ -48,11 +47,10 @@ public void ParseNullOrEmptyValue()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void FormatNonDate()
{
DateTimeFormatter fmt = new DateTimeFormatter("d");
- fmt.Format("not a date");
+ Assert.Throws(() => fmt.Format("not a date"));
}
#if !MONO
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/FilteringFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/FilteringFormatterTests.cs
index af89390bd..893f58d4c 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/FilteringFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/FilteringFormatterTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NUnit.Framework;
using Rhino.Mocks;
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/FloatFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/FloatFormatterTests.cs
index 1c26a6c6e..df391f2f1 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/FloatFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/FloatFormatterTests.cs
@@ -32,11 +32,10 @@ namespace Spring.Globalization.Formatters
public class FloatFormatterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void FormatNullValue()
{
FloatFormatter fmt = new FloatFormatter();
- fmt.Format(null);
+ Assert.Throws(() => fmt.Format(null));
}
[Test]
@@ -48,11 +47,10 @@ public void ParseNullOrEmptyValue()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void FormatNonNumber()
{
FloatFormatter fmt = new FloatFormatter();
- fmt.Format("not a number");
+ Assert.Throws(() => fmt.Format("not a number"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/HasTextFilteringFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/HasTextFilteringFormatterTests.cs
index 4e129659b..880ecbee3 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/HasTextFilteringFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/HasTextFilteringFormatterTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/IntegerFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/IntegerFormatterTests.cs
index 33497ae83..bb04bdb81 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/IntegerFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/IntegerFormatterTests.cs
@@ -32,11 +32,10 @@ namespace Spring.Globalization.Formatters
public class IntegerFormatterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void FormatNullValue()
{
IntegerFormatter fmt = new IntegerFormatter();
- fmt.Format(null);
+ Assert.Throws(() => fmt.Format(null));
}
[Test]
@@ -48,11 +47,10 @@ public void ParseNullOrEmptyValue()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void FormatNonNumber()
{
IntegerFormatter fmt = new IntegerFormatter();
- fmt.Format("not a number");
+ Assert.Throws(() => fmt.Format("not a number"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/NumberFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/NumberFormatterTests.cs
index 77f1c11d8..bd6d30df3 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/NumberFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/NumberFormatterTests.cs
@@ -32,11 +32,10 @@ namespace Spring.Globalization.Formatters
public class NumberFormatterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void FormatNullValue()
{
NumberFormatter fmt = new NumberFormatter();
- fmt.Format(null);
+ Assert.Throws(() => fmt.Format(null));
}
[Test]
@@ -48,11 +47,10 @@ public void ParseNullOrEmptyValue()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void FormatNonNumber()
{
NumberFormatter fmt = new NumberFormatter();
- fmt.Format("not a number");
+ Assert.Throws(() => fmt.Format("not a number"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Formatters/PercentFormatterTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Formatters/PercentFormatterTests.cs
index a6de21e1d..892d2488f 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Formatters/PercentFormatterTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Formatters/PercentFormatterTests.cs
@@ -32,11 +32,10 @@ namespace Spring.Globalization.Formatters
public class PercentFormatterTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void FormatNullValue()
{
PercentFormatter fmt = new PercentFormatter();
- fmt.Format(null);
+ Assert.Throws(() => fmt.Format(null));
}
[Test]
@@ -48,11 +47,10 @@ public void ParseNullOrEmptyValue()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void FormatNonNumber()
{
PercentFormatter fmt = new PercentFormatter();
- fmt.Format("not a number");
+ Assert.Throws(() => fmt.Format("not a number"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Globalization/Localizers/ResourceSetLocalizerTests.cs b/test/Spring/Spring.Core.Tests/Globalization/Localizers/ResourceSetLocalizerTests.cs
index df22f7205..00150e05e 100644
--- a/test/Spring/Spring.Core.Tests/Globalization/Localizers/ResourceSetLocalizerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Globalization/Localizers/ResourceSetLocalizerTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Globalization;
using System.Resources;
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs
index 61b69a018..9e09c482a 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs
@@ -22,15 +22,13 @@
using System;
using NUnit.Framework;
-using Spring.Context;
+
using Spring.Core.IO;
-using Spring.Expressions;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
using Spring.Threading;
using System.Threading;
-using System.Diagnostics;
using System.Collections;
#endregion
@@ -105,10 +103,9 @@ public void Inheritance()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public virtual void GetObjectWithNullName()
{
- ObjectFactory.GetObject(null);
+ Assert.Throws(() => ObjectFactory.GetObject(null));
}
///
@@ -236,11 +233,10 @@ public virtual void SharedInstancesAreEqual()
}
[Test]
- [ExpectedException(typeof(NoSuchObjectDefinitionException))]
public void NotThere()
{
Assert.IsFalse(ObjectFactory.ContainsObject("Mr Squiggle"));
- ObjectFactory.GetObject("Mr Squiggle");
+ Assert.Throws(() => ObjectFactory.GetObject("Mr Squiggle"));
}
[Test]
@@ -260,10 +256,9 @@ public void ValidEmpty()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void RegisterNullCustomTypeConverter()
{
- ObjectFactory.RegisterCustomConverter(null, null);
+ Assert.Throws(() => ObjectFactory.RegisterCustomConverter(null, null));
}
[Test]
@@ -381,14 +376,12 @@ public virtual void FactoryIsInitialized()
/// It should be illegal to dereference a normal object as a factory.
///
[Test]
- [ExpectedException(typeof(ObjectIsNotAFactoryException))]
public virtual void RejectsFactoryGetOnNormalObject()
{
- ObjectFactory.GetObject("&rod");
+ Assert.Throws(() => ObjectFactory.GetObject("&rod"));
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public virtual void Aliasing()
{
string alias = "rods alias";
@@ -407,23 +400,19 @@ public virtual void Aliasing()
object rod = ObjectFactory.GetObject("rod");
object aliasRod = ObjectFactory.GetObject(alias);
Assert.IsTrue(rod == aliasRod);
- ObjectFactory.RegisterAlias("father", alias);
+ Assert.Throws(() => ObjectFactory.RegisterAlias("father", alias));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void RegisterSingletonWithEmptyName()
{
- ((AbstractObjectFactory)ObjectFactory)
- .RegisterSingleton(Environment.NewLine, DBNull.Value);
+ Assert.Throws(() => ObjectFactory.RegisterSingleton(Environment.NewLine, DBNull.Value));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void RegisterSingletonWithNullName()
{
- ((AbstractObjectFactory)ObjectFactory)
- .RegisterSingleton(null, DBNull.Value);
+ Assert.Throws(() => ObjectFactory.RegisterSingleton(null, DBNull.Value));
}
[Test]
@@ -444,33 +433,27 @@ public void GetSingletonNamesReflectsOrderOfRegistration()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ContainsSingletonWithEmptyName()
{
- ((AbstractObjectFactory)ObjectFactory)
- .ContainsSingleton(Environment.NewLine);
+ Assert.Throws(() => ObjectFactory.ContainsSingleton(Environment.NewLine));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ContainsSingletonWithNullName()
{
- ((AbstractObjectFactory)ObjectFactory)
- .ContainsSingleton(null);
+ Assert.Throws(() => ObjectFactory.ContainsSingleton(null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void AliasWithEmptyName()
{
- ((AbstractObjectFactory)ObjectFactory).RegisterAlias(Environment.NewLine, "the whipping boy");
+ Assert.Throws(() => ObjectFactory.RegisterAlias(Environment.NewLine, "the whipping boy"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void AliasWithEmptyAlias()
{
- ((AbstractObjectFactory)ObjectFactory).RegisterAlias("rick", Environment.NewLine);
+ Assert.Throws(() => ObjectFactory.RegisterAlias("rick", Environment.NewLine));
}
// [Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeFailTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeFailTests.cs
index de6b92cee..8ae9356b6 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeFailTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeFailTests.cs
@@ -22,8 +22,6 @@
using NUnit.Framework;
using Spring.Context.Support;
using Spring.Objects.Factory.Attributes.ByType;
-using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Attributes
{
@@ -50,7 +48,7 @@ public void FailFieldInjectionTooManyObjects()
catch (Exception e) { ex = e; }
Assert.That(ex, Is.Not.Null, "Should throw an exception");
- Assert.That(ex.Message, Is.StringContaining("Injection of autowired dependencies failed"));
+ Assert.That(ex.Message, Does.Contain("Injection of autowired dependencies failed"));
}
[Test]
@@ -64,7 +62,7 @@ public void FailPropertyInjectionTooManyObjects()
catch (Exception e) { ex = e; }
Assert.That(ex, Is.Not.Null, "Should throw an exception");
- Assert.That(ex.Message, Is.StringContaining("Injection of autowired dependencies failed"));
+ Assert.That(ex.Message, Does.Contain("Injection of autowired dependencies failed"));
}
[Test]
@@ -78,21 +76,14 @@ public void FailMethodInjectionTooManyObjects()
catch (Exception e) { ex = e; }
Assert.That(ex, Is.Not.Null, "Should throw an exception");
- Assert.That(ex.Message, Is.StringContaining("Injection of autowired dependencies failed"));
+ Assert.That(ex.Message, Does.Contain("Injection of autowired dependencies failed"));
}
[Test]
public void FailConstructorInjectionTooManyObjects()
{
- Exception ex = null;
- try
- {
- var testObj = (AutowireTestConstructorNormal)_applicationContext.GetObject("AutowireTestConstructorNormal");
- }
- catch (Exception e) { ex = e; }
-
- Assert.That(ex, Is.Not.Null, "Should throw an exception");
- Assert.That(ex.Message, Is.StringContaining("Error creating object with name"));
+ var ex = Assert.Throws(() => _applicationContext.GetObject("AutowireTestConstructorNormal"));
+ Assert.That(ex.Message, Does.Contain("Error creating object with name"));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNormalTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNormalTests.cs
index d46d965c7..fcba09ff9 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNormalTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNormalTests.cs
@@ -18,12 +18,9 @@
#endregion
-using System;
using NUnit.Framework;
using Spring.Context.Support;
using Spring.Objects.Factory.Attributes.ByType;
-using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Attributes
{
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNotRequiredTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNotRequiredTests.cs
index 6a8498270..60860f2d4 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNotRequiredTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypeNotRequiredTests.cs
@@ -18,12 +18,9 @@
#endregion
-using System;
using NUnit.Framework;
using Spring.Context.Support;
using Spring.Objects.Factory.Attributes.ByType;
-using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Attributes
{
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypePrimaryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypePrimaryTests.cs
index c38993215..314e5f9ae 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypePrimaryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByTypePrimaryTests.cs
@@ -18,12 +18,9 @@
#endregion
-using System;
using NUnit.Framework;
using Spring.Context.Support;
using Spring.Objects.Factory.Attributes.ByType;
-using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Attributes
{
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByValueTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByValueTests.cs
index 24519012b..190295518 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByValueTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireByValueTests.cs
@@ -18,13 +18,10 @@
#endregion
-using System.Collections.Specialized;
using NUnit.Framework;
-using Spring.Context;
+
using Spring.Context.Support;
using Spring.Objects.Factory.Attributes.ByValue;
-using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
namespace Spring.Objects.Factory.Attributes
{
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireTestObjects.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireTestObjects.cs
index d5b099a75..b496f96ce 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireTestObjects.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/AutowireTestObjects.cs
@@ -1,7 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System.Collections.Generic;
+
using Spring.Objects.Factory.Attributes.ByType;
namespace Spring.Objects.Factory.Attributes.ByType
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigSectionVariableSourceTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigSectionVariableSourceTests.cs
index e2da86844..3e7ce3f93 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigSectionVariableSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigSectionVariableSourceTests.cs
@@ -21,7 +21,6 @@
#region Imports
using NUnit.Framework;
-using Spring.Core.IO;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurableVariableSourceTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurableVariableSourceTests.cs
index 0016edfc1..52c04f032 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurableVariableSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurableVariableSourceTests.cs
@@ -19,7 +19,6 @@
#endregion
using NUnit.Framework;
-using Spring.Core.IO;
namespace Spring.Objects.Factory.Config
{
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurationReaderTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurationReaderTests.cs
index aba45986b..2d8f1532c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurationReaderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConfigurationReaderTests.cs
@@ -221,13 +221,15 @@ NameValueCollection props
}
[Test]
- [ExpectedException(typeof(ConfigurationErrorsException), ExpectedMessage = "Cannot read config section 'ELNOMBRE' - section not found.")]
public void TryReadFromNonExistantConfigSection()
{
- using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(SunnyDayXml)))
+ Assert.Throws(() =>
{
- ConfigurationReader.Read(new InputStreamResource(stream, ""), "ELNOMBRE", null);
- }
+ using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(SunnyDayXml)))
+ {
+ ConfigurationReader.Read(new InputStreamResource(stream, ""), "ELNOMBRE", null);
+ }
+ }, "Cannot read config section 'ELNOMBRE' - section not found.");
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConstructorArgumentValuesTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConstructorArgumentValuesTests.cs
index 8b67c448d..2cd59e63c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConstructorArgumentValuesTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ConstructorArgumentValuesTests.cs
@@ -121,27 +121,24 @@ public void GetArgumentValueIgnoresAlreadyUsedValues()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddNamedArgumentWithNullName()
{
ConstructorArgumentValues values = new ConstructorArgumentValues();
- values.AddNamedArgumentValue(null, 1);
+ Assert.Throws(() => values.AddNamedArgumentValue(null, 1));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddNamedArgumentWithEmptyStringName()
{
ConstructorArgumentValues values = new ConstructorArgumentValues();
- values.AddNamedArgumentValue(string.Empty, 1);
+ Assert.Throws(() => values.AddNamedArgumentValue(string.Empty, 1));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddNamedArgumentWithWhitespaceStringName()
{
ConstructorArgumentValues values = new ConstructorArgumentValues();
- values.AddNamedArgumentValue(Environment.NewLine + " ", 1);
+ Assert.Throws(() => values.AddNamedArgumentValue(Environment.NewLine + " ", 1));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/CustomConverterConfigurerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/CustomConverterConfigurerTests.cs
index cb1b1d315..53cb8ceeb 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/CustomConverterConfigurerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/CustomConverterConfigurerTests.cs
@@ -50,7 +50,6 @@ public void SetUp()
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void UseInvalidKeyForConverterMapKey()
{
IDictionary converters = new Hashtable();
@@ -58,13 +57,10 @@ public void UseInvalidKeyForConverterMapKey()
CustomConverterConfigurer config = new CustomConverterConfigurer();
config.CustomConverters = converters;
- config.PostProcessObjectFactory(factory);
-
- mocks.VerifyAll();
+ Assert.Throws(() => config.PostProcessObjectFactory(factory));
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void UseNonTypeConverterForConverterMapValue()
{
IDictionary converters = new Hashtable();
@@ -72,13 +68,10 @@ public void UseNonTypeConverterForConverterMapValue()
CustomConverterConfigurer config = new CustomConverterConfigurer();
config.CustomConverters = converters;
- config.PostProcessObjectFactory(factory);
-
- mocks.VerifyAll();
- }
+ Assert.Throws(() => config.PostProcessObjectFactory(factory));
+ }
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void UseNonResolvableTypeForConverterMapKey()
{
IDictionary converters = new Hashtable();
@@ -87,9 +80,7 @@ public void UseNonResolvableTypeForConverterMapKey()
CustomConverterConfigurer config = new CustomConverterConfigurer();
config.CustomConverters = converters;
- config.PostProcessObjectFactory(factory);
-
- mocks.VerifyAll();
+ Assert.Throws(() => config.PostProcessObjectFactory(factory));
}
///
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DelegateFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DelegateFactoryObjectTests.cs
index 035021467..8ed4b3287 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DelegateFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DelegateFactoryObjectTests.cs
@@ -36,7 +36,6 @@ namespace Spring.Objects.Factory.Config
public sealed class DelegateFactoryObjectTests
{
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void StaticDelegateWithInstanceMethod()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
@@ -45,7 +44,7 @@ public void StaticDelegateWithInstanceMethod()
fob.MethodName = "HandlePop";
fob.IsSingleton = false;
fob.AfterPropertiesSet();
- fob.GetObject();
+ Assert.Throws(() => fob.GetObject());
}
[Test]
@@ -106,66 +105,59 @@ public void ObjectType()
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void MissingDelegateType()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
- fob.AfterPropertiesSet();
+ Assert.Throws(() => fob.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void BadDelegateType()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
fob.DelegateType = DBNull.Value.GetType();
- fob.AfterPropertiesSet();
+ Assert.Throws(() => fob.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void NullMethodName()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
fob.DelegateType = typeof (EventHandler);
fob.TargetType = typeof (OneThirstyDude);
- fob.AfterPropertiesSet();
+ Assert.Throws(() => fob.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void EmptyMethodName()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
fob.DelegateType = typeof (EventHandler);
fob.TargetType = typeof (OneThirstyDude);
fob.MethodName = string.Empty;
- fob.AfterPropertiesSet();
+ Assert.Throws(() => fob.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void WhitespacedMethodName()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
fob.DelegateType = typeof (EventHandler);
fob.TargetType = typeof (OneThirstyDude);
fob.MethodName = "\n";
- fob.AfterPropertiesSet();
+ Assert.Throws(() => fob.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void MissingATarget()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
fob.DelegateType = typeof (EventHandler);
fob.MethodName = "I Love You Laura Palmer, I Really Do";
- fob.AfterPropertiesSet();
+ Assert.Throws(() => fob.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void ChokesIfBothTargetTypeAndTargetObjectSupplied()
{
DelegateFactoryObject fob = new DelegateFactoryObject();
@@ -173,7 +165,7 @@ public void ChokesIfBothTargetTypeAndTargetObjectSupplied()
fob.TargetType = typeof (OneThirstyDude);
fob.TargetObject = new OneThirstyDude();
fob.MethodName = "I Love You Laura Palmer, I Really Do";
- fob.AfterPropertiesSet();
+ Assert.Throws(() => fob.AfterPropertiesSet());
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DictionaryFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DictionaryFactoryObjectTests.cs
index 87d488793..ce60a8c12 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DictionaryFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/DictionaryFactoryObjectTests.cs
@@ -36,27 +36,24 @@ namespace Spring.Objects.Factory.Config
public sealed class DictionaryFactoryObjectTests
{
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetDictionaryType property must implement the 'System.Collections.IDictionary' interface.")]
public void SetTargetDictionaryTypeToNonDictionaryType()
{
DictionaryFactoryObject dfo = new DictionaryFactoryObject();
- dfo.TargetDictionaryType = typeof (ICollection);
+ Assert.Throws(() => dfo.TargetDictionaryType = typeof (ICollection), "The Type passed to the TargetDictionaryType property must implement the 'System.Collections.IDictionary' interface.");
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetDictionaryType property cannot be an interface; it must be a concrete class that implements the 'System.Collections.IDictionary' interface.")]
public void SetTargetDictionaryTypeToDerivedIDictionaryInterfaceType()
{
DictionaryFactoryObject dfo = new DictionaryFactoryObject();
- dfo.TargetDictionaryType = typeof (IExtendedDictionary);
+ Assert.Throws(() => dfo.TargetDictionaryType = typeof (IExtendedDictionary), "The Type passed to the TargetDictionaryType property cannot be an interface; it must be a concrete class that implements the 'System.Collections.IDictionary' interface.");
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetDictionaryType property cannot be abstract (MustInherit in VisualBasic.NET); it must be a concrete class that implements the 'System.Collections.IDictionary' interface.")]
public void SetTargetDictionaryTypeToAbstractIDictionaryInterfaceType()
{
DictionaryFactoryObject dfo = new DictionaryFactoryObject();
- dfo.TargetDictionaryType = typeof (AbstractDictionary);
+ Assert.Throws(() => dfo.TargetDictionaryType = typeof (AbstractDictionary), "The Type passed to the TargetDictionaryType property cannot be abstract (MustInherit in VisualBasic.NET); it must be a concrete class that implements the 'System.Collections.IDictionary' interface.");
}
private interface IExtendedDictionary : IDictionary
@@ -68,20 +65,18 @@ private abstract class AbstractDictionary : Hashtable
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void SetTargetDictionaryTypeToNull()
{
DictionaryFactoryObject dfo = new DictionaryFactoryObject();
- dfo.TargetDictionaryType = null;
+ Assert.Throws(() => dfo.TargetDictionaryType = null);
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The 'SourceDictionary' property cannot be null (Nothing in Visual Basic.NET).")]
public void GetObjectWithoutSupplyingASourceDictionary()
{
DictionaryFactoryObject dfo = new DictionaryFactoryObject();
dfo.IsSingleton = false;
- dfo.GetObject();
+ Assert.Throws(() => dfo.GetObject(), "The 'SourceDictionary' property cannot be null (Nothing in Visual Basic.NET).");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/EnvironmentVariableSourceTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/EnvironmentVariableSourceTests.cs
index 5c4e50b6c..3e4f4dd0c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/EnvironmentVariableSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/EnvironmentVariableSourceTests.cs
@@ -21,7 +21,7 @@
#region Imports
using System;
-using Microsoft.Win32;
+
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/FieldRetrievingFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/FieldRetrievingFactoryObjectTests.cs
index 4ece8b561..727666613 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/FieldRetrievingFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/FieldRetrievingFactoryObjectTests.cs
@@ -140,52 +140,47 @@ public void InstanceField()
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void NothingSet()
{
FieldRetrievingFactoryObject fac = new FieldRetrievingFactoryObject();
fac.ObjectName = "foo";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void JustTargetField()
{
FieldRetrievingFactoryObject fac = new FieldRetrievingFactoryObject();
fac.TargetField = "Space";
fac.ObjectName = "foo";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void JustTargetType()
{
FieldRetrievingFactoryObject fac = new FieldRetrievingFactoryObject();
fac.TargetType = GetType();
fac.ObjectName = "foo";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void JustTargetObject()
{
FieldRetrievingFactoryObject fac = new FieldRetrievingFactoryObject();
fac.TargetObject = this;
fac.ObjectName = "foo";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void BailsWhenStaticFieldPassedGumpfh()
{
FieldRetrievingFactoryObject fac = new FieldRetrievingFactoryObject();
fac.StaticField = "Goob"; // no field specified
fac.ObjectName = "foo";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
@@ -202,23 +197,21 @@ public void StaticFieldIsCaseINsenSiTiVE()
}
[Test]
- [ExpectedException(typeof (ObjectDefinitionStoreException))]
public void BailsOnNonExistantField()
{
FieldRetrievingFactoryObject fac = new FieldRetrievingFactoryObject();
fac.StaticField = "Spring.Objects.Factory.Config.FinalFielder.Rubbish, Spring.Core.Tests";
fac.ObjectName = "foo";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void BailsWhenBothTargetTypeAndTargetObjectPropsAreSet()
{
FieldRetrievingFactoryObject fac = new FieldRetrievingFactoryObject();
fac.TargetObject = this;
fac.TargetType = GetType();
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ListFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ListFactoryObjectTests.cs
index 265e5640a..c7e660735 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ListFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ListFactoryObjectTests.cs
@@ -36,27 +36,24 @@ namespace Spring.Objects.Factory.Config
public sealed class ListFactoryObjectTests
{
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetListType property must implement the 'System.Collections.IList' interface.")]
public void SetTargetListTypeToNonListType()
{
ListFactoryObject lfo = new ListFactoryObject();
- lfo.TargetListType = typeof (ICollection);
+ Assert.Throws(() => lfo.TargetListType = typeof (ICollection), "The Type passed to the TargetListType property must implement the 'System.Collections.IList' interface.");
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetListType property cannot be an interface; it must be a concrete class that implements the 'System.Collections.IList' interface.")]
public void SetTargetListTypeToDerivedIListInterfaceType()
{
ListFactoryObject lfo = new ListFactoryObject();
- lfo.TargetListType = typeof (IExtendedList);
+ Assert.Throws(() => lfo.TargetListType = typeof (IExtendedList), "The Type passed to the TargetListType property cannot be an interface; it must be a concrete class that implements the 'System.Collections.IList' interface.");
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetListType property cannot be abstract (MustInherit in VisualBasic.NET); it must be a concrete class that implements the 'System.Collections.IList' interface.")]
public void SetTargetListTypeToAbstractIListInterfaceType()
{
ListFactoryObject lfo = new ListFactoryObject();
- lfo.TargetListType = typeof (AbstractList);
+ Assert.Throws(() => lfo.TargetListType = typeof (AbstractList), "The Type passed to the TargetListType property cannot be abstract (MustInherit in VisualBasic.NET); it must be a concrete class that implements the 'System.Collections.IList' interface.");
}
private interface IExtendedList : IList
@@ -68,20 +65,18 @@ private abstract class AbstractList : ArrayList
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void SetTargetListTypeToNull()
{
ListFactoryObject lfo = new ListFactoryObject();
- lfo.TargetListType = null;
+ Assert.Throws(() => lfo.TargetListType = null);
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The 'SourceList' property cannot be null (Nothing in Visual Basic.NET).")]
public void GetObjectWithoutSupplyingASourceList()
{
ListFactoryObject lfo = new ListFactoryObject();
lfo.IsSingleton = false;
- lfo.GetObject();
+ Assert.Throws(() => lfo.GetObject(), "The 'SourceList' property cannot be null (Nothing in Visual Basic.NET).");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/LogFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/LogFactoryObjectTests.cs
index 8ab93dd41..606b73a85 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/LogFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/LogFactoryObjectTests.cs
@@ -36,41 +36,36 @@ namespace Spring.Objects.Factory.Config
public sealed class LogFactoryObjectTests
{
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void CheckThatLogNamePropertyMustBeSet()
{
LogFactoryObject fac = new LogFactoryObject();
- fac.GetObject();
+ Assert.Throws(() => fac.GetObject());
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void CheckLogNamePropertyWithNullName()
{
LogFactoryObject fac = new LogFactoryObject();
- fac.LogName = null;
+ Assert.Throws(() => fac.LogName = null);
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void CheckLogNamePropertyWithEmptyName()
{
LogFactoryObject fac = new LogFactoryObject();
- fac.LogName = string.Empty;
+ Assert.Throws(() => fac.LogName = string.Empty);
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void CheckInstantiationWithNullName()
{
- new LogFactoryObject(null);
+ Assert.Throws(() => new LogFactoryObject(null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void CheckInstantiationWithEmptyName()
{
- new LogFactoryObject(string.Empty);
+ Assert.Throws(() => new LogFactoryObject(string.Empty));
}
[Test]
@@ -102,11 +97,10 @@ public void CheckGetObjectReturnsSharedInstance()
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The 'LogName' property has not been set.")]
public void CheckAfterPropertiesSetBlowsUpIfNotCorrectlyConfigured()
{
LogFactoryObject fac = new LogFactoryObject();
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet(), "The 'LogName' property has not been set.");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/MethodInvokingFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/MethodInvokingFactoryObjectTests.cs
index 51eeacfd0..0779e925a 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/MethodInvokingFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/MethodInvokingFactoryObjectTests.cs
@@ -137,26 +137,23 @@ public void GetSupertypesMatchNumArgs()
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="Unable to determine which exact method to call; found '2' matches.")]
public void GetSupertypesTooManyArgs()
{
MethodInvokingFactoryObject mcfo = new MethodInvokingFactoryObject();
mcfo.TargetType = typeof (TestClass1);
mcfo.TargetMethod = "Supertypes2";
mcfo.Arguments = new Object[] {new ArrayList(), new ArrayList(), "hello", "bogus"};
- mcfo.AfterPropertiesSet();
+ Assert.Throws(() => mcfo.AfterPropertiesSet(), "Unable to determine which exact method to call; found '2' matches.");
}
[Test]
- [ExpectedException(typeof (TypeMismatchException))]
public void GetMisMatchedArgumentTypes()
{
MethodInvokingFactoryObject mcfo = new MethodInvokingFactoryObject();
mcfo.TargetType = typeof (TestClass1);
mcfo.TargetMethod = "Supertypes";
mcfo.Arguments = new Object[] {"1", "2", "3"};
- mcfo.AfterPropertiesSet();
- mcfo.Invoke();
+ Assert.Throws(() => mcfo.AfterPropertiesSet());
}
[Test]
@@ -174,7 +171,7 @@ public void GetObjectType()
mcfo.TargetMethod = "VoidRetvalMethod";
mcfo.AfterPropertiesSet();
Type objType = mcfo.ObjectType;
- Assert.IsTrue(objType.Equals(MethodInvokingFactoryObject.Void.GetType()));
+ Assert.IsTrue(objType.Equals(MethodInvoker.Void.GetType()));
// verify that we can call a method with args that are subtypes of the
// target method arg types
@@ -199,50 +196,45 @@ public void ObjectTypeIsNullIfAfterPropertiesSetHasNotYetBeenInvoked()
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The 'TargetMethod' property is required.")]
public void BailsIfTheTargetMethodPropertyAintSet()
{
MethodInvokingFactoryObject mcfo = new MethodInvokingFactoryObject();
- mcfo.AfterPropertiesSet();
+ Assert.Throws(() => mcfo.AfterPropertiesSet(), "The 'TargetMethod' property is required.");
}
[Test]
- [ExpectedException(typeof (MissingMethodException))]
public void AfterPropertiesSetBogusMethod()
{
MethodInvokingFactoryObject mcfo = new MethodInvokingFactoryObject();
mcfo.TargetObject = this;
mcfo.TargetMethod = "whatever";
- mcfo.AfterPropertiesSet();
+ Assert.Throws(() => mcfo.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (MissingMethodException))]
public void AfterPropertiesSetBogusStaticMethod()
{
MethodInvokingFactoryObject mcfo = new MethodInvokingFactoryObject();
mcfo.TargetType = typeof (TestClass1);
mcfo.TargetMethod = "some.bogus.Method.name";
- mcfo.AfterPropertiesSet();
+ Assert.Throws(() => mcfo.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void AfterPropertiesSetStaticMethodMissingArgs()
{
MethodInvokingFactoryObject mcfo = new MethodInvokingFactoryObject();
mcfo.TargetType = typeof (TestClass1);
mcfo.TargetMethod = "Method1";
- mcfo.AfterPropertiesSet();
+ Assert.Throws(() => mcfo.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void AfterPropertiesSetMissingMethod()
{
MethodInvokingFactoryObject mcfo = new MethodInvokingFactoryObject();
mcfo.TargetObject = this;
- mcfo.AfterPropertiesSet();
+ Assert.Throws(() => mcfo.AfterPropertiesSet());
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectDefinitionVisitorTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectDefinitionVisitorTests.cs
index 94dda64c5..e5debad67 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectDefinitionVisitorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectDefinitionVisitorTests.cs
@@ -52,10 +52,9 @@ private string ParseAndResolveVariables(string rawText)
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void BadConstructorCall()
{
- ObjectDefinitionVisitor visitor = new ObjectDefinitionVisitor(null);
+ Assert.Throws(() => new ObjectDefinitionVisitor(null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectFactoryCreatingFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectFactoryCreatingFactoryObjectTests.cs
index ab5f09851..4747c1fe9 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectFactoryCreatingFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectFactoryCreatingFactoryObjectTests.cs
@@ -99,20 +99,17 @@ public void PrototypeModeWithSingletonTarget()
}
[Test]
- [ExpectedException(typeof (ArgumentException),
- ExpectedMessage = "The 'TargetObjectName' property must have a value.")]
public void WithMissingObjectName()
{
ObjectFactoryCreatingFactoryObject factory
= new ObjectFactoryCreatingFactoryObject();
- factory.AfterPropertiesSet();
+ Assert.Throws(() => factory.AfterPropertiesSet(), "The 'TargetObjectName' property must have a value.");
}
[Test]
public void ObjectTypeReallyIsIGenericObjectFactory()
{
- Assert.AreEqual(typeof (IGenericObjectFactory),
- new ObjectFactoryCreatingFactoryObject().ObjectType);
+ Assert.AreEqual(typeof (IGenericObjectFactory), new ObjectFactoryCreatingFactoryObject().ObjectType);
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectReferenceFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectReferenceFactoryObjectTests.cs
index 81de0ebe2..a5dc0d68c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectReferenceFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectReferenceFactoryObjectTests.cs
@@ -46,22 +46,20 @@ public void SetUp()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void NullTargetObjectName()
{
ObjectReferenceFactoryObject fac = new ObjectReferenceFactoryObject();
- // simulate IFactoryObjectAware interface...
- fac.ObjectFactory = null;
+ // simulate IFactoryObjectAware interface...
+ Assert.Throws(() => fac.ObjectFactory = null);
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WhitespaceTargetObjectName()
{
ObjectReferenceFactoryObject fac = new ObjectReferenceFactoryObject();
fac.TargetObjectName = string.Empty;
- // simulate IFactoryObjectAware interface...
- fac.ObjectFactory = null;
+ // simulate IFactoryObjectAware interface...
+ Assert.Throws(() => fac.ObjectFactory = null);
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyOverrideConfigurerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyOverrideConfigurerTests.cs
index d496f3f8b..80753be10 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyOverrideConfigurerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyOverrideConfigurerTests.cs
@@ -52,7 +52,7 @@ public void Setup()
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, just to ensure that the logging code is correct
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPathFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPathFactoryObjectTests.cs
index b9a25d695..5e35eeca9 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPathFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPathFactoryObjectTests.cs
@@ -96,7 +96,6 @@ public void GetObject_ViaObjectName()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void GetObject_ViaObjectNameThatStartsWithAPeriod()
{
Expect.Call(mockFactory.IsSingleton("foo")).Return(true);
@@ -105,7 +104,7 @@ public void GetObject_ViaObjectNameThatStartsWithAPeriod()
PropertyPathFactoryObject fac = new PropertyPathFactoryObject();
fac.ObjectName = ".foo.name";
- fac.ObjectFactory = mockFactory;
+ Assert.Throws(() => fac.ObjectFactory = mockFactory);
}
[Test]
@@ -141,7 +140,6 @@ public void GetObject_ViaObjectNameWithNestedPropertyPath()
}
[Test]
- [ExpectedException(typeof(NullValueInNestedPathException))]
public void GetObject_ViaObjectNameWithNullInNestedPropertyPath()
{
Expect.Call(mockFactory.IsSingleton("foo")).Return(true);
@@ -150,14 +148,10 @@ public void GetObject_ViaObjectNameWithNullInNestedPropertyPath()
PropertyPathFactoryObject fac = new PropertyPathFactoryObject();
fac.ObjectName = "foo.spouse.name";
- fac.ObjectFactory = mockFactory;
- string name = (string) fac.GetObject();
- Assert.AreEqual("Fiona Apple", name);
- mocks.VerifyAll();
+ Assert.Throws(() => fac.ObjectFactory = mockFactory);
}
[Test]
- [ExpectedException(typeof(FatalObjectException))]
public void GetObject_PropertyPathEvaluatesToNull()
{
Expect.Call(mockFactory.IsSingleton("foo")).Return(true);
@@ -167,7 +161,7 @@ public void GetObject_PropertyPathEvaluatesToNull()
PropertyPathFactoryObject fac = new PropertyPathFactoryObject();
fac.ObjectName = "foo.name";
fac.ObjectFactory = mockFactory;
- fac.GetObject();
+ Assert.Throws(() => fac.GetObject());
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs
index 205c23bf8..d15490a64 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyPlaceholderConfigurerTests.cs
@@ -55,17 +55,15 @@ public void SetUp()
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void MismatchBetweenNumberOfConfigNamesAndNumberOfLocations()
{
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
cfg.Locations = new IResource[] { mocks.StrictMock() }; // will never get to the point where we check the validity
cfg.ConfigSections = new string[] { "", "" };
- cfg.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)));
+ Assert.Throws(() => cfg.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory))));
}
[Test]
- [ExpectedException(typeof(ObjectsException))]
public void OneConfigNameIsOKForLotsOfLocations()
{
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
@@ -76,11 +74,10 @@ public void OneConfigNameIsOKForLotsOfLocations()
cfg.Locations = new IResource [] {mock};
cfg.ConfigSections = new string[] { "" };
- cfg.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)));
+ Assert.Throws(() => cfg.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory))));
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void ChokesOnBadResourceLocationIfIgnoreBadResourcesFlagNotSetToTrue()
{
PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
@@ -91,7 +88,7 @@ public void ChokesOnBadResourceLocationIfIgnoreBadResourcesFlagNotSetToTrue()
cfg.Locations = new IResource [] { mock};
cfg.ConfigSections = new string[] { "" };
- cfg.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)));
+ Assert.Throws(() => cfg.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory))));
}
[Test]
@@ -113,7 +110,6 @@ public void DoesNotChokeOnBadResourceLocationIfIgnoreBadResourcesFlagSetToTrue()
}
[Test]
- [ExpectedException(typeof (ObjectDefinitionStoreException))]
public void WithCircularReference()
{
StaticApplicationContext ac = new StaticApplicationContext();
@@ -133,7 +129,7 @@ public void WithCircularReference()
pvs.Add("Properties", "");
pvs.Add("order", "0");
ac.RegisterSingleton("configurer2", typeof (PropertyPlaceholderConfigurer), pvs);
- ac.Refresh();
+ Assert.Throws(() => ac.Refresh());
}
[Test]
@@ -268,8 +264,6 @@ public void WithOverridingEnvironmentProperty()
}
[Test]
- [ExpectedException(typeof (ObjectDefinitionStoreException),
- ExpectedMessage = "Error registering object with name 'to' defined in '' : Could not resolve placeholder 'PROCESSOR_ARCHITECTURE'.")]
public void WithUnresolvableEnvironmentProperty()
{
StaticApplicationContext ac = new StaticApplicationContext();
@@ -280,7 +274,7 @@ public void WithUnresolvableEnvironmentProperty()
pvs = new MutablePropertyValues();
pvs.Add("environmentVariableMode", EnvironmentVariableMode.Never);
ac.RegisterSingleton("configurer", typeof (PropertyPlaceholderConfigurer), pvs);
- ac.Refresh();
+ Assert.Throws(() => ac.Refresh(), "Error registering object with name 'to' defined in '' : Could not resolve placeholder 'PROCESSOR_ARCHITECTURE'.");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyRetrievingFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyRetrievingFactoryObjectTests.cs
index 26ce5ba02..fb3f8c01c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyRetrievingFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyRetrievingFactoryObjectTests.cs
@@ -44,11 +44,10 @@ public void Instantiation()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void BailsWhenStaticPropertyIsSetToNull()
{
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
- fac.StaticProperty = null;
+ Assert.Throws(() => fac.StaticProperty = null);
}
///
@@ -183,37 +182,33 @@ public void IndexedProperty()
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void BailsWhenReadingIndexedPropertyWithNoArguments()
{
PropertyObject expected = new PropertyObject();
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
fac.TargetObject = expected;
fac.TargetProperty = "Item";
- fac.AfterPropertiesSet();
- fac.GetObject();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (NotWritablePropertyException))]
public void BailsOnWriteOnlyProperty()
{
PropertyObject expected = new PropertyObject();
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
fac.TargetObject = expected;
fac.TargetProperty = "Greenness";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void BailsOnNonExistantProperty()
{
PropertyObject expected = new PropertyObject();
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
fac.TargetObject = expected;
fac.TargetProperty = "Blister";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
@@ -233,46 +228,41 @@ public void IsSingleton()
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="One of the TargetType or TargetObject properties must be set.")]
public void BailsWhenNotConfigured()
{
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet(), "One of the TargetType or TargetObject properties must be set.");
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void BailsWhenJustTargetPropertyIsSet()
{
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
fac.TargetProperty = "Funk";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void BailsWhenJustTargetTypeIsSet()
{
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
fac.TargetType = GetType();
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The TargetProperty property is required.")]
public void BailsWhenJustTargetObjectIsSet()
{
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
fac.TargetObject = this;
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet(), "The TargetProperty property is required.");
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void BailsWhenStaticPropertyPassedGumpfh()
{
PropertyRetrievingFactoryObject fac = new PropertyRetrievingFactoryObject();
- fac.StaticProperty = "Boog"; // no field specified
+ Assert.Throws(() => fac.StaticProperty = "Boog"); // no field specified
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceHandlerConfigurerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceHandlerConfigurerTests.cs
index d2d45914a..37c1357c4 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceHandlerConfigurerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceHandlerConfigurerTests.cs
@@ -60,7 +60,6 @@ public void Serialization()
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void UseInvalidTypeForDictionaryValue()
{
IDictionary resourceHandlers = new Hashtable();
@@ -69,13 +68,10 @@ public void UseInvalidTypeForDictionaryValue()
ResourceHandlerConfigurer resourceHandlerConfiguer = new ResourceHandlerConfigurer();
resourceHandlerConfiguer.ResourceHandlers = resourceHandlers;
-
- resourceHandlerConfiguer.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)));
-
+ Assert.Throws(() => resourceHandlerConfiguer.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory))));
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void UseNonResolvableTypeForDictionaryValue()
{
IDictionary resourceHandlers = new Hashtable();
@@ -85,8 +81,7 @@ public void UseNonResolvableTypeForDictionaryValue()
resourceHandlerConfiguer.ResourceHandlers = resourceHandlers;
- resourceHandlerConfiguer.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory)));
-
+ Assert.Throws(() => resourceHandlerConfiguer.PostProcessObjectFactory((IConfigurableListableObjectFactory) mocks.DynamicMock(typeof(IConfigurableListableObjectFactory))));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceManagerFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceManagerFactoryObjectTests.cs
index c63a98c7f..5ac68debb 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceManagerFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ResourceManagerFactoryObjectTests.cs
@@ -17,7 +17,6 @@
#endregion
using System;
-using System.IO;
using System.Resources;
using NUnit.Framework;
@@ -50,30 +49,27 @@ public void CreateResourceManager()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void MissingBaseName()
{
ResourceManagerFactoryObject fac = new ResourceManagerFactoryObject();
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void MissingAssemblyName()
{
ResourceManagerFactoryObject fac = new ResourceManagerFactoryObject();
fac.BaseName = "Spring.Resources.SampleResources";
- fac.AfterPropertiesSet();
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithRubbishAssemblyName()
{
ResourceManagerFactoryObject fac = new ResourceManagerFactoryObject();
fac.BaseName = "Spring.Resources.SampleResources";
- fac.AssemblyName = "I'mAJumpedUpPantryBoy";
- fac.AfterPropertiesSet();
+ fac.AssemblyName = "I'mAJumpedUpPantryBoy";
+ Assert.Throws(() => fac.AfterPropertiesSet());
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/RuntimeObjectReferenceTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/RuntimeObjectReferenceTests.cs
index 42f490f06..6e7fa4375 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/RuntimeObjectReferenceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/RuntimeObjectReferenceTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SetFactoryObjectTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SetFactoryObjectTests.cs
index 160edf73e..bcd32a865 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SetFactoryObjectTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SetFactoryObjectTests.cs
@@ -36,29 +36,25 @@ namespace Spring.Objects.Factory.Config
[TestFixture]
public sealed class SetFactoryObjectTests
{
-
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage = "The Type passed to the TargetSetType property must implement the 'Spring.Collections.ISet' interface.")]
public void SetTargetSetTypeToNonSetType()
{
SetFactoryObject lfo = new SetFactoryObject();
- lfo.TargetSetType = typeof (ICollection);
+ Assert.Throws(() => lfo.TargetSetType = typeof (ICollection), "The Type passed to the TargetSetType property must implement the 'Spring.Collections.ISet' interface.");
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetSetType property cannot be an interface; it must be a concrete class that implements the 'Spring.Collections.ISet' interface.")]
public void SetTargetSetTypeToDerivedISetInterfaceType()
{
SetFactoryObject lfo = new SetFactoryObject();
- lfo.TargetSetType = typeof (IExtendedSet);
+ Assert.Throws(() => lfo.TargetSetType = typeof (IExtendedSet), "The Type passed to the TargetSetType property cannot be an interface; it must be a concrete class that implements the 'Spring.Collections.ISet' interface.");
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The Type passed to the TargetSetType property cannot be abstract (MustInherit in VisualBasic.NET); it must be a concrete class that implements the 'Spring.Collections.ISet' interface.")]
public void SetTargetSetTypeToAbstractISetInterfaceType()
{
SetFactoryObject lfo = new SetFactoryObject();
- lfo.TargetSetType = typeof (AbstractSet);
+ Assert.Throws(() => lfo.TargetSetType = typeof (AbstractSet), "The Type passed to the TargetSetType property cannot be abstract (MustInherit in VisualBasic.NET); it must be a concrete class that implements the 'Spring.Collections.ISet' interface.");
}
private interface IExtendedSet : ISet
@@ -70,20 +66,18 @@ private abstract class AbstractSet : HybridSet
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void SetTargetSetTypeToNull()
{
SetFactoryObject lfo = new SetFactoryObject();
- lfo.TargetSetType = null;
+ Assert.Throws(() => lfo.TargetSetType = null);
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="The 'SourceSet' property cannot be null (Nothing in Visual Basic.NET).")]
public void GetObjectWithoutSupplyingASourceSet()
{
SetFactoryObject lfo = new SetFactoryObject();
lfo.IsSingleton = false;
- lfo.GetObject();
+ Assert.Throws(() => lfo.GetObject(), "The 'SourceSet' property cannot be null (Nothing in Visual Basic.NET).");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SpecialFolderVariableSourceTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SpecialFolderVariableSourceTests.cs
index ef3a58524..83e58ed27 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SpecialFolderVariableSourceTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/SpecialFolderVariableSourceTests.cs
@@ -21,7 +21,7 @@
#region Imports
using System;
-using Microsoft.Win32;
+
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypeAliasConfigurerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypeAliasConfigurerTests.cs
index f7c89d918..f1f71e943 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypeAliasConfigurerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypeAliasConfigurerTests.cs
@@ -62,7 +62,6 @@ public void Serialization()
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void UseInvalidTypeForDictionaryValue()
{
IDictionary typeAliases = new Hashtable();
@@ -71,11 +70,10 @@ public void UseInvalidTypeForDictionaryValue()
TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
typeAliasConfigurer.TypeAliases = typeAliases;
- typeAliasConfigurer.PostProcessObjectFactory(factory);
+ Assert.Throws(() => typeAliasConfigurer.PostProcessObjectFactory(factory));
}
[Test]
- [ExpectedException(typeof(ObjectInitializationException))]
public void UseNonResolvableTypeForDictionaryValue()
{
IDictionary typeAliases = new Hashtable();
@@ -84,7 +82,7 @@ public void UseNonResolvableTypeForDictionaryValue()
TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
typeAliasConfigurer.TypeAliases = typeAliases;
- typeAliasConfigurer.PostProcessObjectFactory(factory);
+ Assert.Throws(() => typeAliasConfigurer.PostProcessObjectFactory(factory));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypedStringValueTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypedStringValueTests.cs
index 658607903..5a195ea2b 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypedStringValueTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/TypedStringValueTests.cs
@@ -54,41 +54,36 @@ public void Instantiation()
}
- [Test]
- [ExpectedException(typeof (ArgumentNullException))]
- public void InstantiationWithNullType()
- {
- new TypedStringValue(string.Empty, (Type)null);
- }
-
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void InstantiationWithNullTypeName()
- {
- new TypedStringValue(string.Empty, (string)null);
- }
-
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void InstantiationWithEmptyTypeName()
- {
- new TypedStringValue(string.Empty, " ");
- }
-
- [Test]
- [ExpectedException(typeof (ArgumentNullException))]
- public void SetTargetTypePropertyToNullType()
- {
- TypedStringValue tsv = new TypedStringValue(string.Empty, typeof (DateTime));
- tsv.TargetType = null;
- }
+ [Test]
+ public void InstantiationWithNullType()
+ {
+ Assert.Throws(() => new TypedStringValue(string.Empty, (Type) null));
+ }
+
+ [Test]
+ public void InstantiationWithNullTypeName()
+ {
+ Assert.Throws(() => new TypedStringValue(string.Empty, (string) null));
+ }
+
+ [Test]
+ public void InstantiationWithEmptyTypeName()
+ {
+ Assert.Throws(() => new TypedStringValue(string.Empty, " "));
+ }
+
+ [Test]
+ public void SetTargetTypePropertyToNullType()
+ {
+ TypedStringValue tsv = new TypedStringValue(string.Empty, typeof(DateTime));
+ Assert.Throws(() => tsv.TargetType = null);
+ }
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void SetTargetTypeNamePropertyToEmptyString()
{
TypedStringValue tsv = new TypedStringValue(string.Empty, typeof(DateTime));
- tsv.TargetTypeName = " ";
+ Assert.Throws(() => tsv.TargetTypeName = " ");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariableAccessorTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariableAccessorTests.cs
index 322ee6b98..8d3d25b52 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariableAccessorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariableAccessorTests.cs
@@ -21,7 +21,8 @@
#region Imports
using System;
-using System.Collections.Specialized;
+using System.Globalization;
+
using NUnit.Framework;
#endregion
@@ -64,7 +65,7 @@ public class VariableAccessorTests
.Add("InvalidDecimal", "")
.Add("ValidGuid", TESTGUID.ToString())
.Add("InvalidGuid", "")
- .Add("ValidDateTime", TESTDATETIME.ToString())
+ .Add("ValidDateTime", TESTDATETIME.ToString(CultureInfo.InvariantCulture))
.Add("InvalidDateTime", "blabla")
.Add("ValidDateTimeUtcRoundtripFormatted", TESTDATETIME.ToUniversalTime().ToString("u"))
;
@@ -237,12 +238,7 @@ public void GetDateTime()
Assert.AreEqual(TESTDATETIME, va.GetDateTime("ValidDateTime", null, TESTDATETIME_DEFAULT));
Assert.AreEqual(TESTDATETIME.ToUniversalTime(), va.GetDateTime("ValidDateTimeUtcRoundtripFormatted", "u", TESTDATETIME_DEFAULT));
Assert.AreEqual(TESTDATETIME_DEFAULT, va.GetDateTime("InvalidDateTime", null, TESTDATETIME_DEFAULT, false));
- try
- {
- va.GetDateTime("InvalidDateTime", null, TESTDATETIME_DEFAULT, true);
- Assert.Fail();
- }
- catch { }
+ Assert.Throws(() => va.GetDateTime("InvalidDateTime", null, TESTDATETIME_DEFAULT, true));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariablePlaceholderConfigurerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariablePlaceholderConfigurerTests.cs
index b9d2baca7..825f49ee2 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariablePlaceholderConfigurerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Config/VariablePlaceholderConfigurerTests.cs
@@ -20,7 +20,6 @@
using System;
using System.Collections;
-using System.Collections.Specialized;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryPerfTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryPerfTests.cs
index 2c46b23ef..b158b684e 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryPerfTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryPerfTests.cs
@@ -48,7 +48,7 @@ public void Setup()
}
[Test]
- [Ignore]
+ [Ignore("just a test")]
public void Test()
{
int numIterations = 10000;
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs
index 7d55312b0..8a0829bc6 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs
@@ -56,7 +56,7 @@ public void Setup()
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, just to ensure that the logging code is correct :D
@@ -551,13 +551,12 @@ public void ObjectDefinitionOverriding()
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ObjectDefinitionOverridingNotAllowed()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
lof.AllowObjectDefinitionOverriding = false;
lof.RegisterObjectDefinition("test", new RootObjectDefinition(typeof(TestObject), null));
- lof.RegisterObjectDefinition("test", new RootObjectDefinition(typeof(NestedTestObject), null));
+ Assert.Throws(() => lof.RegisterObjectDefinition("test", new RootObjectDefinition(typeof(NestedTestObject), null)));
}
[Test]
@@ -645,13 +644,12 @@ public void RegisterExistingSingletonWithAutowire()
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void RegisterExistingSingletonWithAlreadyBound()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
object singletonObject = new TestObject();
lof.RegisterSingleton("singletonObject", singletonObject);
- lof.RegisterSingleton("singletonObject", singletonObject);
+ Assert.Throws(() => lof.RegisterSingleton("singletonObject", singletonObject));
}
[Test]
@@ -700,13 +698,12 @@ public void AutowireObjectByNameIsNotCaseInsensitive()
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void AutowireObjectByNameWithDependencyCheck()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
RootObjectDefinition rod = new RootObjectDefinition(typeof(TestObject));
lof.RegisterObjectDefinition("Spous", rod);
- lof.Autowire(typeof(DependenciesObject), AutoWiringMode.ByName, true);
+ Assert.Throws(() => lof.Autowire(typeof(DependenciesObject), AutoWiringMode.ByName, true));
}
[Test]
@@ -731,12 +728,10 @@ public void AutowireObjectByType()
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void AutowireObjectByTypeWithDependencyCheck()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
- lof.Autowire(typeof(DependenciesObject), AutoWiringMode.ByType, true);
- Assert.Fail("Should have thrown UnsatisfiedDependencyException");
+ Assert.Throws(() => lof.Autowire(typeof(DependenciesObject), AutoWiringMode.ByType, true));
}
[Test]
@@ -761,15 +756,13 @@ public void AutowireExistingObjectByName()
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void AutowireExistingObjectByNameWithDependencyCheck()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
RootObjectDefinition rod = new RootObjectDefinition(typeof(TestObject));
lof.RegisterObjectDefinition("Spous", rod);
DependenciesObject existingObj = new DependenciesObject();
- lof.AutowireObjectProperties(existingObj, AutoWiringMode.ByName, true);
- Assert.Fail("Should have thrown UnsatisfiedDependencyException");
+ Assert.Throws(() => lof.AutowireObjectProperties(existingObj, AutoWiringMode.ByName, true));
}
[Test]
@@ -796,21 +789,19 @@ public void AutowireExistingObjectByType()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void AutowireByTypeWithInvalidAutowireMode()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
DependenciesObject obj = new DependenciesObject();
- lof.AutowireObjectProperties(obj, AutoWiringMode.Constructor, true);
+ Assert.Throws(() => lof.AutowireObjectProperties(obj, AutoWiringMode.Constructor, true));
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void AutowireExistingObjectByTypeWithDependencyCheck()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
DependenciesObject existingObj = new DependenciesObject();
- lof.AutowireObjectProperties(existingObj, AutoWiringMode.ByType, true);
+ Assert.Throws(() => lof.AutowireObjectProperties(existingObj, AutoWiringMode.ByType, true));
}
[Test]
@@ -868,7 +859,6 @@ public void AutowireWithSatisfiedConstructorDependency()
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void AutowireWithUnsatisfiedConstructorDependency()
{
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
@@ -877,8 +867,7 @@ public void AutowireWithUnsatisfiedConstructorDependency()
RootObjectDefinition rod = new RootObjectDefinition(typeof(TestObject), pvs);
lof.RegisterObjectDefinition("rod", rod);
Assert.AreEqual(1, lof.ObjectDefinitionCount);
- lof.Autowire(typeof(UnsatisfiedConstructorDependency), AutoWiringMode.AutoDetect, true);
- Assert.Fail("Should have unsatisfied constructor dependency on SideEffectObject");
+ Assert.Throws(() => lof.Autowire(typeof(UnsatisfiedConstructorDependency), AutoWiringMode.AutoDetect, true));
}
[Test]
@@ -1465,30 +1454,27 @@ public void ConfigureObjectViaExplicitName()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConfigureObjectViaNullName()
{
TestObject instance = new TestObject();
DefaultListableObjectFactory fac = new DefaultListableObjectFactory();
- fac.ConfigureObject(instance, null);
+ Assert.Throws(() => fac.ConfigureObject(instance, null));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConfigureObjectViaLoadOfOldWhitespaceName()
{
TestObject instance = new TestObject();
DefaultListableObjectFactory fac = new DefaultListableObjectFactory();
- fac.ConfigureObject(instance, " \t");
+ Assert.Throws(() => fac.ConfigureObject(instance, " \t"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ConfigureObjectViaEmptyName()
{
TestObject instance = new TestObject();
DefaultListableObjectFactory fac = new DefaultListableObjectFactory();
- fac.ConfigureObject(instance, string.Empty);
+ Assert.Throws(() => fac.ConfigureObject(instance, string.Empty));
}
[Test]
@@ -1537,9 +1523,6 @@ public void StaticInitializationViaDependsOnSingletonMethodInvokingFactoryObject
/// to the ctor, it should (must) choke.
///
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException), ExpectedMessage="Error creating object with name 'foo' : Unsatisfied dependency " +
- "expressed through constructor argument with index 1 of type [System.Boolean] : " +
- "No unique object of type [System.Boolean] is defined : Unsatisfied dependency of type [System.Boolean]: expected at least 1 matching object to wire the [b2] parameter on the constructor of object [foo]")]
public void DoubleBooleanAutowire()
{
RootObjectDefinition def = new RootObjectDefinition(typeof(DoubleBooleanConstructorObject));
@@ -1552,7 +1535,10 @@ public void DoubleBooleanAutowire()
DefaultListableObjectFactory fac = new DefaultListableObjectFactory();
fac.RegisterObjectDefinition("foo", def);
- fac.GetObject("foo");
+ Assert.Throws(() => fac.GetObject("foo"),
+ "Error creating object with name 'foo' : Unsatisfied dependency " +
+ "expressed through constructor argument with index 1 of type [System.Boolean] : " +
+ "No unique object of type [System.Boolean] is defined : Unsatisfied dependency of type [System.Boolean]: expected at least 1 matching object to wire the [b2] parameter on the constructor of object [foo]");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/MethodReplacerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/MethodReplacerTests.cs
index ce7dde7e8..3115ed98c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/MethodReplacerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/MethodReplacerTests.cs
@@ -149,7 +149,6 @@ public void SunnyDayReplaceMethod_WithReplacerThatReturnsVoid()
/// We don't specify any type fragments, so the method overload check will never pass.
///
[Test]
- [ExpectedException(typeof(NotImplementedException))]
public void SunnyDayReplaceMethod_WithArgumentAcceptingReplacerWithNoTypeFragmentsSpecified()
{
RootObjectDefinition replacerDef = new RootObjectDefinition(typeof (NewsFeedFactory));
@@ -161,7 +160,7 @@ public void SunnyDayReplaceMethod_WithArgumentAcceptingReplacerWithNoTypeFragmen
factory.RegisterObjectDefinition("manager", managerDef);
factory.RegisterObjectDefinition("replacer", replacerDef);
NewsFeedManagerWith_Replace_MethodThatTakesArguments manager = (NewsFeedManagerWith_Replace_MethodThatTakesArguments) factory["manager"];
- manager.CreateNewsFeed("So sad... to be all alone in the world");
+ Assert.Throws(() => manager.CreateNewsFeed("So sad... to be all alone in the world"));
}
///
@@ -352,7 +351,6 @@ public void LookupMethodWithVirtualProtectedMethod()
#region Rainy Day Scenarios
[Test]
- [ExpectedException(typeof (ObjectCreationException))]
public void FailWithLookupMethodOnSealedClass()
{
RootObjectDefinition feedDef = new RootObjectDefinition(typeof (NewsFeed));
@@ -365,11 +363,10 @@ public void FailWithLookupMethodOnSealedClass()
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
factory.RegisterObjectDefinition("manager", managerDef);
factory.RegisterObjectDefinition("feed", feedDef);
- factory.GetObject("manager");
+ Assert.Throws(() => factory.GetObject("manager"));
}
[Test]
- [ExpectedException(typeof (ObjectCreationException))]
public void FailWithReplaceMethodOnSealedClass()
{
RootObjectDefinition replacerDef = new RootObjectDefinition(typeof (NewsFeedFactory));
@@ -380,7 +377,7 @@ public void FailWithReplaceMethodOnSealedClass()
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
factory.RegisterObjectDefinition("manager", managerDef);
factory.RegisterObjectDefinition("replacer", replacerDef);
- factory.GetObject("manager");
+ Assert.Throws(() => factory.GetObject("manager"));
}
///
@@ -388,7 +385,6 @@ public void FailWithReplaceMethodOnSealedClass()
/// not been explicitly declared virtual on the original class declaration.
///
[Test]
- [ExpectedException(typeof (ObjectCreationException))]
public void FailOnNonVirtualProtectedMethod()
{
RootObjectDefinition feedDef = new RootObjectDefinition(typeof (NewsFeed));
@@ -401,7 +397,7 @@ public void FailOnNonVirtualProtectedMethod()
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
factory.RegisterObjectDefinition("manager", managerDef);
factory.RegisterObjectDefinition("feed", feedDef);
- factory.GetObject("manager");
+ Assert.Throws(() => factory.GetObject("manager"));
}
///
@@ -409,7 +405,6 @@ public void FailOnNonVirtualProtectedMethod()
/// return type.
///
[Test]
- [ExpectedException(typeof (ObjectCreationException))]
public void FailOnMethodWithVoidReturnType()
{
RootObjectDefinition feedDef = new RootObjectDefinition(typeof (NewsFeed));
@@ -422,14 +417,13 @@ public void FailOnMethodWithVoidReturnType()
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
factory.RegisterObjectDefinition("manager", managerDef);
factory.RegisterObjectDefinition("feed", feedDef);
- factory.GetObject("manager");
+ Assert.Throws(() => factory.GetObject("manager"));
}
///
/// Lookup methods cannot accept any arguments (replace methods can though).
///
[Test]
- [ExpectedException(typeof (ObjectCreationException))]
public void FailOnLookupMethodThatHasArguments()
{
RootObjectDefinition feedDef = new RootObjectDefinition(typeof (NewsFeed));
@@ -442,7 +436,7 @@ public void FailOnLookupMethodThatHasArguments()
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
factory.RegisterObjectDefinition("manager", managerDef);
factory.RegisterObjectDefinition("feed", feedDef);
- factory.GetObject("manager");
+ Assert.Throws(() => factory.GetObject("manager"));
}
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs
index 6328c212c..88ebb509c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs
@@ -23,7 +23,7 @@
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
-using Rhino.Mocks;
+
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
@@ -147,11 +147,11 @@ public void HierarchicalResolutionWithOverride()
}
[Test]
- [ExpectedException(typeof(NoSuchObjectDefinitionException),
- ExpectedMessage = "No unique object of type [Spring.Objects.ITestObject] is defined : Expected single object but found 4")]
public void ObjectOfTypeIncludingAncestorsWithMoreThanOneObjectOfType()
{
- ObjectFactoryUtils.ObjectOfTypeIncludingAncestors(_factory, typeof(ITestObject), true, true);
+ Assert.Throws(
+ () => ObjectFactoryUtils.ObjectOfTypeIncludingAncestors(_factory, typeof(ITestObject), true, true),
+ "No unique object of type [Spring.Objects.ITestObject] is defined : Expected single object but found 4");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/AutowireUtilsTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/AutowireUtilsTests.cs
index dec4a216a..32b631548 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/AutowireUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/AutowireUtilsTests.cs
@@ -131,34 +131,29 @@ private static ConstructorInfo AssertTypeWeightingPicksCorrectCtor(object[] argu
return pickedCtor;
}
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="Cannot calculate the type difference weight for argument types and arguments with differing lengths.")]
[Test]
[Ignore("Investigate details of new type weight algorithm")]
public void GetTypeDifferenceWeightWithMismatchedLengths()
{
- AutowireUtils.GetTypeDifferenceWeight(new Type[] {}, new object[] {1});
+ Assert.Throws(() => AutowireUtils.GetTypeDifferenceWeight(new Type[] {}, new object[] {1}), "Cannot calculate the type difference weight for argument types and arguments with differing lengths.");
}
[Test]
- [ExpectedException(typeof (NullReferenceException))]
public void GetTypeDifferenceWeightWithNullParameterTypes()
{
- AutowireUtils.GetTypeDifferenceWeight(null, new object[] {});
+ Assert.Throws(() => AutowireUtils.GetTypeDifferenceWeight(null, new object[] {}));
}
[Test]
- [ExpectedException(typeof (NullReferenceException))]
public void GetTypeDifferenceWeightWithNullArgumentTypes()
{
- AutowireUtils.GetTypeDifferenceWeight(
- ReflectionUtils.GetParameterTypes(typeof(Fable).GetConstructor(new Type[] { typeof(FableCharacter) }).GetParameters()), null);
+ Assert.Throws(() => AutowireUtils.GetTypeDifferenceWeight(ReflectionUtils.GetParameterTypes(typeof(Fable).GetConstructor(new Type[] { typeof(FableCharacter) }).GetParameters()), null));
}
[Test]
- [ExpectedException(typeof (NullReferenceException))]
public void GetTypeDifferenceWeightWithAllNulls()
{
- AutowireUtils.GetTypeDifferenceWeight(null, null);
+ Assert.Throws(() => AutowireUtils.GetTypeDifferenceWeight(null, null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs
index 5cd5d4576..599f93d82 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs
@@ -36,24 +36,21 @@ namespace Spring.Objects.Factory.Support
public sealed class ChildObjectDefinitionTests
{
[Test]
- [ExpectedException(typeof(ObjectDefinitionValidationException))]
public void ChokesIfParentNamePropertyIsNullAtValidationTime()
{
- new ChildObjectDefinition(null, null).Validate();
+ Assert.Throws(() => new ChildObjectDefinition(null, null).Validate());
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionValidationException))]
public void ChokesIfParentNamePropertyIsEmptyAtValidationTime()
{
- new ChildObjectDefinition(String.Empty, null).Validate();
+ Assert.Throws(() => new ChildObjectDefinition(String.Empty, null).Validate());
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionValidationException))]
public void ChokesIfParentNamePropertyIsJustWhitespaceAtValidationTime()
{
- new ChildObjectDefinition(" ", null).Validate();
+ Assert.Throws(() => new ChildObjectDefinition(" ", null).Validate());
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs
index 7666373d8..28e14ae45 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs
@@ -22,7 +22,6 @@
using System;
using NUnit.Framework;
-using Spring.Objects.Factory.Config;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DelegatingMethodReplacerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DelegatingMethodReplacerTests.cs
index 6c42ae37c..32d346675 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DelegatingMethodReplacerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DelegatingMethodReplacerTests.cs
@@ -45,19 +45,17 @@ public void SetUp()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullDefinition()
{
IObjectFactory factory = mocks.StrictMock();
- new DelegatingMethodReplacer(null, factory);
+ Assert.Throws(() => new DelegatingMethodReplacer(null, factory));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullFactory()
{
IConfigurableObjectDefinition mock = mocks.StrictMock();
- new DelegatingMethodReplacer(mock, null);
+ Assert.Throws(() => new DelegatingMethodReplacer(mock, null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodOverrideTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodOverrideTests.cs
index 57df58522..289428e07 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodOverrideTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodOverrideTests.cs
@@ -35,45 +35,39 @@ namespace Spring.Objects.Factory.Support
public sealed class LookupMethodOverrideTests
{
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullMethodName()
{
- new LookupMethodOverride(null, null);
+ Assert.Throws(() => new LookupMethodOverride(null, null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithEmptyMethodName()
{
- new LookupMethodOverride(string.Empty, null);
+ Assert.Throws(() => new LookupMethodOverride(string.Empty, null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithWhitespacedMethodName()
{
- new LookupMethodOverride(" ", null);
+ Assert.Throws(() => new LookupMethodOverride(" ", null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullMethodReplacerObjectName()
{
- new LookupMethodOverride("foo", null);
+ Assert.Throws(() => new LookupMethodOverride("foo", null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithEmptyMethodReplacerObjectName()
{
- new LookupMethodOverride("foo", string.Empty);
+ Assert.Throws(() => new LookupMethodOverride("foo", string.Empty));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithWhitespacedMethodReplacerObjectName()
{
- new LookupMethodOverride("foo", " ");
+ Assert.Throws(() => new LookupMethodOverride("foo", " "));
}
[Test]
@@ -91,11 +85,10 @@ public void Matches_MatchingMethodName()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void MatchesWithNullMethod()
{
LookupMethodOverride methodOverride = new LookupMethodOverride("Execute", "foo");
- methodOverride.Matches(null);
+ Assert.Throws(() => methodOverride.Matches(null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodReplacerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodReplacerTests.cs
index ddcbdc71e..d569e093d 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodReplacerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/LookupMethodReplacerTests.cs
@@ -45,19 +45,17 @@ public void Setup()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullDefinition()
{
IObjectFactory objectFactory = mocks.StrictMock();
- new LookupMethodReplacer(null, objectFactory);
+ Assert.Throws(() => new LookupMethodReplacer(null, objectFactory));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullFactory()
{
var configurableObjectDefinition = mocks.StrictMock();
- new LookupMethodReplacer(configurableObjectDefinition, null);
+ Assert.Throws(() => new LookupMethodReplacer(configurableObjectDefinition, null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedDictionaryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedDictionaryTests.cs
index 570d41557..f2ae5ecbf 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedDictionaryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedDictionaryTests.cs
@@ -57,20 +57,18 @@ public void MergeWithNullParent()
}
[Test]
- [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = @"Not allowed to merge when the 'MergeEnabled' property is set to 'false'")]
public void MergeNotAllowedWhenMergeNotEnabled()
{
ManagedDictionary child = new ManagedDictionary();
- child.Merge(null);
+ Assert.Throws(() => child.Merge(null), "Not allowed to merge when the 'MergeEnabled' property is set to 'false'");
}
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void MergeWithNonCompatibleParentType()
{
ManagedDictionary child = new ManagedDictionary();
child.MergeEnabled = true;
- child.Merge("hello");
+ Assert.Throws(() => child.Merge("hello"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedListTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedListTests.cs
index 29e8c26ce..713ffd279 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedListTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedListTests.cs
@@ -51,21 +51,19 @@ public void MergeWithNullParent()
}
[Test]
- [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = @"Not allowed to merge when the 'MergeEnabled' property is set to 'false'")]
public void MergeNotAllowedWhenMergeNotEnabled()
{
ManagedList child = new ManagedList();
- child.Merge(null);
+ Assert.Throws(() => child.Merge(null), "Not allowed to merge when the 'MergeEnabled' property is set to 'false'");
}
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void MergeWithNonCompatibleParentType()
{
ManagedList child = new ManagedList();
child.Add("one");
child.MergeEnabled = true;
- child.Merge("hello");
+ Assert.Throws(() => child.Merge("hello"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedNameValueCollectionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedNameValueCollectionTests.cs
index 7a0b263ea..ec6c515a4 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedNameValueCollectionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedNameValueCollectionTests.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Specialized;
using NUnit.Framework;
using Spring.Objects.Factory.Config;
@@ -55,20 +54,18 @@ public void MergeWithNullParent()
}
[Test]
- [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = @"Not allowed to merge when the 'MergeEnabled' property is set to 'false'")]
public void MergeNotAllowedWhenMergeNotEnabled()
{
ManagedNameValueCollection child = new ManagedNameValueCollection();
- child.Merge(null);
+ Assert.Throws(() => child.Merge(null), "Not allowed to merge when the 'MergeEnabled' property is set to 'false'");
}
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void MergeWithNonCompatibleParentType()
{
ManagedNameValueCollection child = new ManagedNameValueCollection();
child.MergeEnabled = true;
- child.Merge("hello");
+ Assert.Throws(() => child.Merge("hello"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedSetTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedSetTests.cs
index 14240ab17..49bece3e3 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedSetTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ManagedSetTests.cs
@@ -19,7 +19,7 @@
#endregion
using System;
-using System.Collections;
+
using NUnit.Framework;
using Spring.Collections;
using Spring.Objects.Factory.Config;
@@ -52,21 +52,19 @@ public void MergeWithNullParent()
}
[Test]
- [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = @"Not allowed to merge when the 'MergeEnabled' property is set to 'false'")]
public void MergeNotAllowedWhenMergeNotEnabled()
{
ManagedSet child = new ManagedSet();
- child.Merge(null);
+ Assert.Throws(() => child.Merge(null), "Not allowed to merge when the 'MergeEnabled' property is set to 'false'");
}
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void MergeWithNonCompatibleParentType()
{
ManagedSet child = new ManagedSet();
child.Add("one");
child.MergeEnabled = true;
- child.Merge("hello");
+ Assert.Throws(() => child.Merge("hello"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionBuilderTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionBuilderTests.cs
index d6db09d1f..4dae97e34 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionBuilderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionBuilderTests.cs
@@ -20,11 +20,9 @@
#region Imports
-using System;
using System.Collections;
using NUnit.Framework;
using Spring.Context.Support;
-using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Xml;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionReaderUtilsTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionReaderUtilsTests.cs
index dd43aa207..661ee74ef 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionReaderUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ObjectDefinitionReaderUtilsTests.cs
@@ -77,25 +77,22 @@ public void RegisterObjectDefinitionSunnyDayWithAliases()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterObjectDefinitionWithNullDefinition()
{
- ObjectDefinitionReaderUtils.RegisterObjectDefinition(null, registry);
+ Assert.Throws(() => ObjectDefinitionReaderUtils.RegisterObjectDefinition(null, registry));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterObjectDefinitionWithNullRegistry()
{
ObjectDefinitionHolder holder = new ObjectDefinitionHolder(definition, "foo");
- ObjectDefinitionReaderUtils.RegisterObjectDefinition(holder, null);
+ Assert.Throws(() => ObjectDefinitionReaderUtils.RegisterObjectDefinition(holder, null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterObjectDefinitionWithAllArgumentsNull()
{
- ObjectDefinitionReaderUtils.RegisterObjectDefinition(null, null);
+ Assert.Throws(() => ObjectDefinitionReaderUtils.RegisterObjectDefinition(null, null));
}
[Test]
@@ -125,17 +122,15 @@ ObjectDefinitionHolder holder
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void GenerateObjectNameWithNullDefinition()
{
- ObjectDefinitionReaderUtils.GenerateObjectName(null, registry);
+ Assert.Throws(() => ObjectDefinitionReaderUtils.GenerateObjectName(null, registry));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void GenerateObjectNameWithNullRegistry()
{
- ObjectDefinitionReaderUtils.GenerateObjectName(mocks.StrictMock(), null);
+ Assert.Throws(() => ObjectDefinitionReaderUtils.GenerateObjectName(mocks.StrictMock(), null));
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ReplacedMethodOverrideTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ReplacedMethodOverrideTests.cs
index 1d5663709..31fb0cc97 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ReplacedMethodOverrideTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ReplacedMethodOverrideTests.cs
@@ -35,66 +35,57 @@ namespace Spring.Objects.Factory.Support
public sealed class ReplacedMethodOverrideTests
{
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullMethodName()
{
- new ReplacedMethodOverride(null, null);
+ Assert.Throws(() => new ReplacedMethodOverride(null, null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithEmptyMethodName()
{
- new ReplacedMethodOverride(string.Empty, null);
+ Assert.Throws(() => new ReplacedMethodOverride(string.Empty, null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithWhitespacedMethodName()
{
- new ReplacedMethodOverride(" ", null);
+ Assert.Throws(() => new ReplacedMethodOverride(" ", null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNullMethodReplacerObjectName()
{
- new ReplacedMethodOverride("foo", null);
+ Assert.Throws(() => new ReplacedMethodOverride("foo", null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithEmptyMethodReplacerObjectName()
{
- new ReplacedMethodOverride("foo", string.Empty);
+ Assert.Throws(() => new ReplacedMethodOverride("foo", string.Empty));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithWhitespacedMethodReplacerObjectName()
{
- new ReplacedMethodOverride("foo", " ");
+ Assert.Throws(() => new ReplacedMethodOverride("foo", " "));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddNullTypeIdentifier()
{
- new ReplacedMethodOverride("foo", "foo").AddTypeIdentifier(null);
+ Assert.Throws(() => new ReplacedMethodOverride("foo", "foo").AddTypeIdentifier(null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddEmptyTypeIdentifier()
{
- new ReplacedMethodOverride("foo", "foo").AddTypeIdentifier(string.Empty);
+ Assert.Throws(() => new ReplacedMethodOverride("foo", "foo").AddTypeIdentifier(string.Empty));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddWhitespacedTypeIdentifier()
{
- new ReplacedMethodOverride("foo", "foo").AddTypeIdentifier("\n ");
+ Assert.Throws(() => new ReplacedMethodOverride("foo", "foo").AddTypeIdentifier("\n "));
}
[Test]
@@ -155,11 +146,10 @@ public void Matches_AllTypeIdentifiers()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void MatchesWithNullMethod()
{
ReplacedMethodOverride methodOverride = new ReplacedMethodOverride("Execute", "replacer");
- methodOverride.Matches(null);
+ Assert.Throws(() => methodOverride.Matches(null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs
index a84d9f4e9..af3f8ef5e 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs
@@ -39,20 +39,17 @@ namespace Spring.Objects.Factory.Support
public sealed class RootObjectDefinitionTests
{
[Test]
- [ExpectedException( typeof( ApplicationException ) )]
public void InstantiationWithClassName()
{
- RootObjectDefinition def
- = new RootObjectDefinition( typeof( TestObject ).AssemblyQualifiedName, new ConstructorArgumentValues(), new MutablePropertyValues() );
- Assert.IsFalse( def.HasObjectType );
- Assert.IsNull( def.ObjectType ); // must bail...
+ RootObjectDefinition def = new RootObjectDefinition(typeof(TestObject).AssemblyQualifiedName, new ConstructorArgumentValues(), new MutablePropertyValues());
+ Assert.IsFalse(def.HasObjectType);
+ Assert.Throws(() => Assert.IsNull(def.ObjectType)); // must bail...
}
[Test]
public void InstantiationFromOther()
{
- RootObjectDefinition other
- = new RootObjectDefinition( typeof( TestObject ), AutoWiringMode.Constructor );
+ RootObjectDefinition other = new RootObjectDefinition( typeof( TestObject ), AutoWiringMode.Constructor );
other.IsSingleton = false;
other.InitMethodName = "Umberto Eco";
other.DestroyMethodName = "Pedulismus";
@@ -162,14 +159,13 @@ public void OverrideFromOther()
}
[Test]
- [ExpectedException( typeof( ObjectDefinitionValidationException ) )]
public void ValidateLazyAndPrototypeCausesBail()
{
RootObjectDefinition def
= new RootObjectDefinition( typeof( TestObject ), AutoWiringMode.No );
def.IsLazyInit = true;
def.IsSingleton = false;
- def.Validate();
+ Assert.Throws(() => def.Validate());
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/SimpleInstantiationStrategyTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/SimpleInstantiationStrategyTests.cs
index 00fcd4d48..182ca0495 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/SimpleInstantiationStrategyTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/SimpleInstantiationStrategyTests.cs
@@ -58,11 +58,10 @@ public void SetUp()
#endregion
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiateWithNulls()
{
SimpleInstantiationStrategy strategy = new SimpleInstantiationStrategy();
- strategy.Instantiate(null, null, null);
+ Assert.Throws(() => strategy.Instantiate(null, null, null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/CollectionMergingTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/CollectionMergingTests.cs
index 74b5d0ba1..5358d70c8 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/CollectionMergingTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/CollectionMergingTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using System.Collections.Specialized;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ConstructorDependenciesObject.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ConstructorDependenciesObject.cs
index dd83ad09f..6e70a9698 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ConstructorDependenciesObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ConstructorDependenciesObject.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DependenciesObject.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DependenciesObject.cs
index 42bb3d4d6..d0a8e9b69 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DependenciesObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DependenciesObject.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DerivedConstructorDependenciesObject.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DerivedConstructorDependenciesObject.cs
index cece1863d..795ff07aa 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DerivedConstructorDependenciesObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DerivedConstructorDependenciesObject.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyBo.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyBo.cs
index b67d48c47..4641e9eb5 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyBo.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyBo.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyDao.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyDao.cs
index ed1d9291b..6c66630e1 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyDao.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyDao.cs
@@ -20,8 +20,7 @@
#region Imports
-using System;
-using System.Data;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyReferencer.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyReferencer.cs
index 79689b904..98cba1657 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyReferencer.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/DummyReferencer.cs
@@ -20,9 +20,7 @@
#region Imports
-using System;
-using Spring.Objects;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/EventWiringTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/EventWiringTests.cs
index f9939e491..17bf2be83 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/EventWiringTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/EventWiringTests.cs
@@ -93,7 +93,7 @@ public virtual void StaticEventWiring()
"The instance handler did not get notified when the static event was raised (and was probably not wired up in the first place).");
}
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, to ensure that the logging code is exercised
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/FactoryMethods.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/FactoryMethods.cs
index 52fa9d96b..36d909eaf 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/FactoryMethods.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/FactoryMethods.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/IDummyBo.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/IDummyBo.cs
index ba77f0e0d..475411842 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/IDummyBo.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/IDummyBo.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/InstanceFactory.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/InstanceFactory.cs
index 2dad2d06f..28aa8435d 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/InstanceFactory.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/InstanceFactory.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Data;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/MixedCollectionObject.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/MixedCollectionObject.cs
index 1e90e76b3..bb67c7731 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/MixedCollectionObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/MixedCollectionObject.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/NullAppender.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/NullAppender.cs
index a03f0f356..b949dc27b 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/NullAppender.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/NullAppender.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ObjectFactorySectionHandlerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ObjectFactorySectionHandlerTests.cs
index 5afe5e536..98a560164 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ObjectFactorySectionHandlerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/ObjectFactorySectionHandlerTests.cs
@@ -50,11 +50,10 @@ public void CreateXmlElement()
/// Test calling the section handler with null values.
///
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void CreateFactoryUnSuccessful()
{
- ObjectFactorySectionHandler objHandler = new ObjectFactorySectionHandler();
- objHandler.Create( null, null, null );
+ ObjectFactorySectionHandler objHandler = new ObjectFactorySectionHandler();
+ Assert.Throws(() => objHandler.Create(null, null, null));
}
///
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/SingleSimpleTypeConstructorObject.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/SingleSimpleTypeConstructorObject.cs
index 3f32d95ce..468d44cb9 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/SingleSimpleTypeConstructorObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/SingleSimpleTypeConstructorObject.cs
@@ -1,4 +1,4 @@
-using System;
+
#region License
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/TestObjectCreator.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/TestObjectCreator.cs
index 4be870ccc..dc53edbf7 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/TestObjectCreator.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/TestObjectCreator.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs
index 41a6b7180..455a603a0 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs
index fa683b024..33e3a603d 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs
@@ -49,7 +49,7 @@ public sealed class XmlObjectCollectionTests
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, to ensure that the logging code is exercised...
@@ -530,10 +530,9 @@ public void GetDictionaryThatUsesStringKeysSpecifiedAsElements()
}
[Test]
- [ExpectedException(typeof (ObjectDefinitionStoreException))]
public void GetDictionaryThatDoesntSpecifyAnyKeyForAnEntry()
{
- new StreamHelperDecorator(new StreamHelperCallback(_GetDictionaryThatDoesntSpecifyAnyKeyForAnEntry)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_GetDictionaryThatDoesntSpecifyAnyKeyForAnEntry)).Run());
}
private void _GetDictionaryThatDoesntSpecifyAnyKeyForAnEntry(out Stream stream)
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs
index 5fe77be8c..ab4c97f3f 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs
@@ -49,23 +49,17 @@ XmlObjectDefinitionReader reader
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void LoadObjectDefinitionsWithNullResource()
{
- XmlObjectDefinitionReader reader
- = new XmlObjectDefinitionReader(
- new DefaultListableObjectFactory());
- reader.LoadObjectDefinitions((string)null);
+ XmlObjectDefinitionReader reader = new XmlObjectDefinitionReader(new DefaultListableObjectFactory());
+ Assert.Throws(() => reader.LoadObjectDefinitions((string) null));
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void LoadObjectDefinitionsWithNonExistentResource()
{
- XmlObjectDefinitionReader reader
- = new XmlObjectDefinitionReader(
- new DefaultListableObjectFactory());
- reader.LoadObjectDefinitions(new ReadOnlyXmlTestResource("/dev/null"));
+ XmlObjectDefinitionReader reader = new XmlObjectDefinitionReader(new DefaultListableObjectFactory());
+ Assert.Throws(() => reader.LoadObjectDefinitions(new ReadOnlyXmlTestResource("/dev/null")));
}
[Test]
@@ -101,7 +95,7 @@ public void AutoRegistersAllWellknownNamespaceParsers_3_0()
}
[Test]
- [Ignore] //this test cannot co-exist with AutoRegistersAllWellknownNamespaceParsers b/c that test will have already loaded the Spring.Data ass'y
+ [Ignore("this test cannot co-exist with AutoRegistersAllWellknownNamespaceParsers b/c that test will have already loaded the Spring.Data ass'y")]
public void AutoRegistersWellknownNamespaceParser()
{
try
@@ -136,21 +130,19 @@ public void AutoRegistersWellknownNamespaceParser()
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ThrowsOnUnknownNamespaceUri()
{
NamespaceParserRegistry.Reset();
DefaultListableObjectFactory of = new DefaultListableObjectFactory();
XmlObjectDefinitionReader reader = new XmlObjectDefinitionReader(of);
- reader.LoadObjectDefinitions(new StringResource(
+ Assert.Throws(() => reader.LoadObjectDefinitions(new StringResource(
@"
-"));
- Assert.Fail();
+")));
}
@@ -279,17 +271,16 @@ protected override IObjectDefinitionDocumentReader CreateObjectDefinitionDocumen
#endregion
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ThrowsObjectDefinitionStoreExceptionOnErrorDuringObjectDefinitionRegistration()
{
DefaultListableObjectFactory of = new DefaultListableObjectFactory();
XmlObjectDefinitionReader reader = new TestXmlObjectDefinitionReader(of);
- reader.LoadObjectDefinitions(new StringResource(
+ Assert.Throws(() => reader.LoadObjectDefinitions(new StringResource(
@"
-"));
+")));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs
index 55a4efa0f..93099970c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs
@@ -24,7 +24,6 @@
using System.Collections;
using System.Collections.Generic;
using System.Data;
-using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
@@ -36,8 +35,6 @@
using Rhino.Mocks;
-using Spring.Context;
-using Spring.Context.Support;
using Spring.Core.IO;
using Spring.Core.TypeResolution;
using Spring.Expressions;
@@ -67,7 +64,7 @@ public sealed class XmlObjectFactoryTests
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable (null appender) logging, to ensure that the logging code is exercised...
@@ -82,10 +79,9 @@ public void SetUp()
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ReplacedMethodWithNoReplacerObjectNameSpecified()
{
- new StreamHelperDecorator(new StreamHelperCallback(_ReplacedMethodWithNoReplacerObjectNameSpecified)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_ReplacedMethodWithNoReplacerObjectNameSpecified)).Run());
}
private void _ReplacedMethodWithNoReplacerObjectNameSpecified(out Stream stream)
@@ -104,10 +100,9 @@ private void _ReplacedMethodWithNoReplacerObjectNameSpecified(out Stream stream)
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ReplacedMethodWithNoMethodNameSpecified()
{
- new StreamHelperDecorator(new StreamHelperCallback(_ReplacedMethodWithNoMethodNameSpecified)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_ReplacedMethodWithNoMethodNameSpecified)).Run());
}
private void _ReplacedMethodWithNoMethodNameSpecified(out Stream stream)
@@ -126,10 +121,9 @@ private void _ReplacedMethodWithNoMethodNameSpecified(out Stream stream)
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ValidatesReplacedMethodCorrectly()
{
- new StreamHelperDecorator(new StreamHelperCallback(_ValidatesReplacedMethodCorrectly)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_ValidatesReplacedMethodCorrectly)).Run());
}
private void _ValidatesReplacedMethodCorrectly(out Stream stream)
@@ -182,10 +176,9 @@ private void _LookupMethodIsParsedAndOperatesCorrectly_SunnyDay(out Stream strea
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ValidatesLookupMethodCorrectly()
{
- new StreamHelperDecorator(new StreamHelperCallback(_ValidatesLookupMethodCorrectly)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_ValidatesLookupMethodCorrectly)).Run());
}
private void _ValidatesLookupMethodCorrectly(out Stream stream)
@@ -204,10 +197,9 @@ private void _ValidatesLookupMethodCorrectly(out Stream stream)
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void LookupMethodWithNoMethodNameSpecified()
{
- new StreamHelperDecorator(new StreamHelperCallback(_LookupMethodWithNoMethodNameSpecified)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_LookupMethodWithNoMethodNameSpecified)).Run());
}
private void _LookupMethodWithNoMethodNameSpecified(out Stream stream)
@@ -227,10 +219,9 @@ private void _LookupMethodWithNoMethodNameSpecified(out Stream stream)
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void LookupMethodWithNoTargetObjectNameSpecified()
{
- new StreamHelperDecorator(new StreamHelperCallback(_LookupMethodWithNoTargetObjectNameSpecified)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_LookupMethodWithNoTargetObjectNameSpecified)).Run());
}
private void _LookupMethodWithNoTargetObjectNameSpecified(out Stream stream)
@@ -314,10 +305,9 @@ private void _RegisterAliasViaAliasElementOrderingIsUnimportant(out Stream strea
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void IfTypeAttributeIsPresentItMustNotBeTheEmptyStringValue()
{
- new StreamHelperDecorator(new StreamHelperCallback(_IfTypeAttributeIsPresentItMustNotBeTheEmptyStringValue)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_IfTypeAttributeIsPresentItMustNotBeTheEmptyStringValue)).Run());
}
private void _IfTypeAttributeIsPresentItMustNotBeTheEmptyStringValue(out Stream stream)
@@ -334,10 +324,9 @@ private void _IfTypeAttributeIsPresentItMustNotBeTheEmptyStringValue(out Stream
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void IfTypeAttributeIsPresentItMustNotBeAnOnlyWhitespaceStringValue()
{
- new StreamHelperDecorator(new StreamHelperCallback(_IfTypeAttributeIsPresentItMustNotBeAnOnlyWhitespaceStringValue)).Run();
+ Assert.Throws(() => new StreamHelperDecorator(new StreamHelperCallback(_IfTypeAttributeIsPresentItMustNotBeAnOnlyWhitespaceStringValue)).Run());
}
private void _IfTypeAttributeIsPresentItMustNotBeAnOnlyWhitespaceStringValue(out Stream stream)
@@ -408,13 +397,11 @@ private void _MethodInvokingFactoryObjectRefsObject(out Stream stream)
}
[Test]
- [ExpectedException(typeof(ObjectCreationException))]
public void BadParentReference()
{
IResource resource = new ReadOnlyXmlTestResource("wellformed-but-bad.xml", GetType());
XmlObjectFactory xof = new XmlObjectFactory(resource);
-
- xof.GetObject("no.parent.factory");
+ Assert.Throws(() => xof.GetObject("no.parent.factory"));
}
[Test]
@@ -493,11 +480,10 @@ public void ImportsExternalResourcesCorrectly()
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void ImportsExternalResourcesBailsOnNonExistentResource()
{
IResource resource = new ReadOnlyXmlTestResource("bad-external-resources.xml", GetType());
- new XmlObjectFactory(resource);
+ Assert.Throws(() => new XmlObjectFactory(resource));
}
[Test]
@@ -751,12 +737,11 @@ public void ChildOverridesParentObject()
/// If a singleton does this the factory will fail to load.
///
[Test]
- [ExpectedException(typeof(NoSuchObjectDefinitionException))]
public void BogusParentageFromParentFactory()
{
XmlObjectFactory parent = new XmlObjectFactory(new ReadOnlyXmlTestResource("parent.xml", GetType()));
XmlObjectFactory child = new XmlObjectFactory(new ReadOnlyXmlTestResource("child.xml", GetType()), parent);
- child.GetObject("bogusParent");
+ Assert.Throws(() => child.GetObject("bogusParent"));
}
///
@@ -924,13 +909,11 @@ public void InitMethodThrowsException()
}
[Test]
- [ExpectedException(typeof(ObjectCreationException))]
public void NoSuchInitMethod()
{
IResource resource = new ReadOnlyXmlTestResource("initializers.xml", GetType());
XmlObjectFactory xof = new XmlObjectFactory(resource);
- xof.GetObject("init-method3");
- Assert.Fail();
+ Assert.Throws(() => xof.GetObject("init-method3"));
}
///
@@ -1046,11 +1029,9 @@ public void DefaultLazyInitNoInObjectDef()
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void NoSuchXmlFile()
{
- new XmlObjectFactory(
- new ReadOnlyXmlTestResource("missing.xml", GetType()));
+ Assert.Throws(() => new XmlObjectFactory(new ReadOnlyXmlTestResource("missing.xml", GetType())));
}
[Test]
@@ -1086,23 +1067,17 @@ public void DefaultXmlResolverIsUsedIfNullSuppliedOrSet()
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void UnsatisfiedObjectDependencyCheck()
{
- XmlObjectFactory xof
- = new XmlObjectFactory(
- new ReadOnlyXmlTestResource(
- "unsatisfiedObjectDependencyCheck.xml", GetType()));
- xof.GetObject("a", typeof(DependenciesObject));
+ XmlObjectFactory xof = new XmlObjectFactory(new ReadOnlyXmlTestResource("unsatisfiedObjectDependencyCheck.xml", GetType()));
+ Assert.Throws(() => xof.GetObject("a", typeof(DependenciesObject)));
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void UnsatisfiedSimpleDependencyCheck()
{
- XmlObjectFactory xof =
- new XmlObjectFactory(new ReadOnlyXmlTestResource("unsatisfiedSimpleDependencyCheck.xml", GetType()));
- xof.GetObject("a", typeof(DependenciesObject));
+ XmlObjectFactory xof = new XmlObjectFactory(new ReadOnlyXmlTestResource("unsatisfiedSimpleDependencyCheck.xml", GetType()));
+ Assert.Throws(() => xof.GetObject("a", typeof(DependenciesObject)));
}
[Test]
@@ -1127,14 +1102,10 @@ public void SatisfiedSimpleDependencyCheck()
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void UnsatisfiedAllDependencyCheck()
{
- XmlObjectFactory xof
- = new XmlObjectFactory(
- new ReadOnlyXmlTestResource(
- "unsatisfiedAllDependencyCheckMissingObjects.xml", GetType()));
- xof.GetObject("a", typeof(DependenciesObject));
+ XmlObjectFactory xof= new XmlObjectFactory(new ReadOnlyXmlTestResource("unsatisfiedAllDependencyCheckMissingObjects.xml", GetType()));
+ Assert.Throws(() => xof.GetObject("a", typeof(DependenciesObject)));
}
[Test]
@@ -1338,28 +1309,23 @@ public void ConstructorArgResolution()
}
[Test]
- [ExpectedException(typeof(ObjectCreationException))]
public void ThrowsExceptionOnTooManyArguments()
{
- XmlObjectFactory xof = new XmlObjectFactory(
- new ReadOnlyXmlTestResource("constructor-arg.xml", GetType()));
- xof.GetObject("rod7", typeof(ConstructorDependenciesObject));
+ XmlObjectFactory xof = new XmlObjectFactory(new ReadOnlyXmlTestResource("constructor-arg.xml", GetType()));
+ Assert.Throws(() => xof.GetObject("rod7", typeof(ConstructorDependenciesObject)));
}
[Test]
- [ExpectedException(typeof(UnsatisfiedDependencyException))]
public void ThrowsExceptionOnAmbiguousResolution()
{
XmlObjectFactory xof = new XmlObjectFactory(new ReadOnlyXmlTestResource("constructor-arg.xml", GetType()));
- xof.GetObject("rod8", typeof(ConstructorDependenciesObject));
+ Assert.Throws(() => xof.GetObject("rod8", typeof(ConstructorDependenciesObject)));
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void FactoryObjectDefinedAsPrototype()
{
- new XmlObjectFactory(
- new ReadOnlyXmlTestResource("invalid-factory.xml", GetType()));
+ Assert.Throws(() => new XmlObjectFactory(new ReadOnlyXmlTestResource("invalid-factory.xml", GetType())));
}
[Test]
@@ -1605,13 +1571,12 @@ private DataTable MakeNamesTable()
#endregion
[Test]
- [ExpectedException(typeof(ObjectCreationException))]
public void FactoryMethodNoMatchingStaticMethod()
{
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
XmlObjectDefinitionReader reader = new XmlObjectDefinitionReader(factory);
reader.LoadObjectDefinitions(new ReadOnlyXmlTestResource("factory-methods.xml", GetType()));
- factory.GetObject("noMatchPrototype");
+ Assert.Throws(() => factory.GetObject("noMatchPrototype"));
}
[Test]
@@ -1705,23 +1670,21 @@ public void InstanceFieldRetrievingFactoryMethod()
}
[Test]
- [ExpectedException(typeof(ObjectCreationException))]
public void BailsOnRubbishFieldRetrievingFactoryMethod()
{
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
XmlObjectDefinitionReader reader = new XmlObjectDefinitionReader(factory);
reader.LoadObjectDefinitions(new ReadOnlyXmlTestResource("field-props-factory.xml", GetType()));
- factory.GetObject("rubbishField", typeof(MyTestObject));
+ Assert.Throws(() => factory.GetObject("rubbishField", typeof(MyTestObject)));
}
[Test]
- [ExpectedException(typeof(ObjectCreationException))]
public void BailsOnRubbishPropertyRetrievingFactoryMethod()
{
DefaultListableObjectFactory factory = new DefaultListableObjectFactory();
XmlObjectDefinitionReader reader = new XmlObjectDefinitionReader(factory);
reader.LoadObjectDefinitions(new ReadOnlyXmlTestResource("field-props-factory.xml", GetType()));
- factory.GetObject("rubbishProperty", typeof(MyTestObject));
+ Assert.Throws(() => factory.GetObject("rubbishProperty", typeof(MyTestObject)));
}
///
@@ -1796,11 +1759,9 @@ public void InstantiateObjectViaNamedArgsToInnerMethodInvokingFactoryObject()
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void BailsWhenBothNameAndIndexAttributesAreAppliedToASingleCtorArg()
{
- new XmlObjectFactory(
- new ReadOnlyXmlTestResource("bad-named-constructor-arg.xml", GetType()));
+ Assert.Throws(() => new XmlObjectFactory(new ReadOnlyXmlTestResource("bad-named-constructor-arg.xml", GetType())));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlParserResolverTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlParserResolverTests.cs
index 065fd89db..dda479937 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlParserResolverTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlParserResolverTests.cs
@@ -24,7 +24,6 @@
using System.Xml;
using NUnit.Framework;
using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
#endregion
@@ -39,32 +38,27 @@ namespace Spring.Objects.Factory.Xml
public sealed class XmlParserResolverTests
{
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterParserWithNullType()
{
- NamespaceParserRegistry.RegisterParser((Type) null);
+ Assert.Throws(() => NamespaceParserRegistry.RegisterParser((Type) null));
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void RegisterParserWithBadParserType()
{
- NamespaceParserRegistry.RegisterParser(GetType());
+ Assert.Throws(() => NamespaceParserRegistry.RegisterParser(GetType()));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterParserWithNullNamespaceWithoutDefaultValues()
{
- NamespaceParserRegistry.RegisterParser(typeof(NotImplementedXmlObjectDefinitionParser), null, null);
+ Assert.Throws(() => NamespaceParserRegistry.RegisterParser(typeof(NotImplementedXmlObjectDefinitionParser), null, null));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void RegisterParserWithEmptyNamespaceWithoutDefaultValues()
{
- NamespaceParserRegistry.RegisterParser(
- typeof(NotImplementedXmlObjectDefinitionParser), string.Empty, null);
+ Assert.Throws(() => NamespaceParserRegistry.RegisterParser(typeof(NotImplementedXmlObjectDefinitionParser), string.Empty, null));
}
#region Inner Class : NotImplementedXmlObjectDefinitionParser
diff --git a/test/Spring/Spring.Core.Tests/Objects/IndexedTestObject.cs b/test/Spring/Spring.Core.Tests/Objects/IndexedTestObject.cs
index 1139d0720..9dda72eb1 100644
--- a/test/Spring/Spring.Core.Tests/Objects/IndexedTestObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/IndexedTestObject.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using Spring.Collections;
diff --git a/test/Spring/Spring.Core.Tests/Objects/MutablePropertyValuesTests.cs b/test/Spring/Spring.Core.Tests/Objects/MutablePropertyValuesTests.cs
index 4fa0b8480..8d09dc190 100644
--- a/test/Spring/Spring.Core.Tests/Objects/MutablePropertyValuesTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/MutablePropertyValuesTests.cs
@@ -39,7 +39,7 @@ public sealed class MutablePropertyValuesTests
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp () {}
///
@@ -59,7 +59,7 @@ public void TearDown () {}
///
/// The tear down logic executed after the entire test fixture has executed.
///
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void FixtureTearDown () {}
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/NotWritablePropertyExceptionTests.cs b/test/Spring/Spring.Core.Tests/Objects/NotWritablePropertyExceptionTests.cs
index 3444fe2a3..79462eecf 100644
--- a/test/Spring/Spring.Core.Tests/Objects/NotWritablePropertyExceptionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/NotWritablePropertyExceptionTests.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using NUnit.Framework;
using Spring.Core;
diff --git a/test/Spring/Spring.Core.Tests/Objects/NumberTestObject.cs b/test/Spring/Spring.Core.Tests/Objects/NumberTestObject.cs
index 276798953..50df57e2c 100644
--- a/test/Spring/Spring.Core.Tests/Objects/NumberTestObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/NumberTestObject.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
namespace Spring.Objects
{
///
diff --git a/test/Spring/Spring.Core.Tests/Objects/ObjectWrapperTests.cs b/test/Spring/Spring.Core.Tests/Objects/ObjectWrapperTests.cs
index a6eb65914..6dec2b65f 100644
--- a/test/Spring/Spring.Core.Tests/Objects/ObjectWrapperTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/ObjectWrapperTests.cs
@@ -55,7 +55,7 @@ public sealed class ObjectWrapperTests
///
/// The setup logic executed before the execution of this test fixture.
///
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
// enable logging (to nowhere), just to exercisee the logging code...
@@ -449,16 +449,15 @@ private ObjectWrapper GetWrapper(object objectToBeWrapped)
#endregion
[Test]
- [ExpectedException(typeof (TypeMismatchException))]
public void SetPropertyUsingValueThatNeedsConversionWithNoCustomConverterRegistered()
{
ObjectWrapper wrapper = GetWrapper(new TestObject("Rick", 30));
- // needs conversion to NestedTestObject...
- wrapper.SetPropertyValue("doctor", "Pollack, Pinch, & Pounce");
+ // needs conversion to NestedTestObject...
+ Assert.Throws(() => wrapper.SetPropertyValue("doctor", "Pollack, Pinch, & Pounce"));
}
[Test]
- [Ignore()]
+ [Ignore("not used")]
public void GetValueOfCustomIndexerProperty()
{
ObjectWrapper wrapper = GetWrapper();
@@ -476,7 +475,7 @@ public void GetValueOfCustomIndexerProperty()
}
[Test]
- [Ignore()]
+ [Ignore("not used")]
public void GetSetIndexerProperties()
{
IList favNames = new ArrayList();
@@ -509,34 +508,30 @@ public void GetSetIndexerProperties()
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetValueOfCustomIndexerPropertyWithMalformedIndexer()
{
ObjectWrapper wrapper = GetWrapper();
Honey darwin = new Honey(new string[] {"dickens", "of gaunt"});
wrapper.WrappedInstance = darwin;
- wrapper.GetPropertyValue("AlsoKnownAs[1");
+ Assert.Throws(() => wrapper.GetPropertyValue("AlsoKnownAs[1"));
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void GetPropertyTypeWithNullPropertyPath()
{
- GetWrapper().GetPropertyType(null);
+ Assert.Throws(() => GetWrapper().GetPropertyType(null));
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void GetPropertyTypeWithEmptyPropertyPath()
{
- GetWrapper().GetPropertyType(string.Empty);
+ Assert.Throws(() => GetWrapper().GetPropertyType(string.Empty));
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void GetPropertyTypeWithWhitespacedPropertyPath()
{
- GetWrapper().GetPropertyType(" ");
+ Assert.Throws(() => GetWrapper().GetPropertyType(" "));
}
[Test]
@@ -566,37 +561,33 @@ public void GetPropertyTypeWithNestedLookup()
}
[Test]
- [ExpectedException(typeof (NotWritablePropertyException))]
public void SetValueOfCustomIndexerPropertyWithNonReadablePropertyInIndexedPath()
{
ObjectWrapper wrapper = GetWrapper();
Honey[] honeys = new NonReadableHoney[] {new NonReadableHoney(new string[] {"hsu", "feng"})};
wrapper.WrappedInstance = new Milk(honeys);
- wrapper.SetPropertyValue("Honeys[0][0]", "mei");
+ Assert.Throws(() => wrapper.SetPropertyValue("Honeys[0][0]", "mei"));
}
[Test]
- [ExpectedException(typeof (TypeMismatchException))]
public void SetPropertyThatRequiresTypeConversionWithNonConvertibleType()
{
ObjectWrapper wrapper = GetWrapper();
TestObject to = new TestObject();
wrapper.WrappedInstance = to;
- wrapper.SetPropertyValue("RealLawyer", "Noob");
- Console.Out.WriteLine(to.RealLawyer);
+ Assert.Throws(() => wrapper.SetPropertyValue("RealLawyer", "Noob"));
}
///
/// This test blows up because index is out of range.
///
[Test]
- [ExpectedException(typeof(InvalidPropertyException))]
public void SetIndexedPropertyOnListThatsOutOfRange()
{
TestObject to = new TestObject();
ObjectWrapper wrapper = GetWrapper(to);
to.Friends = new NoNullsList();
- wrapper.SetPropertyValue("Friends[5]", "Inheritance Tax");
+ Assert.Throws(() => wrapper.SetPropertyValue("Friends[5]", "Inheritance Tax"));
}
///
@@ -616,24 +607,21 @@ public void GetChainedIndexers()
/// will throw a FatalPropertyException with the correct exception message.
///
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void NullObject()
{
- new ObjectWrapper((object) null);
+ Assert.Throws(() => new ObjectWrapper((object) null));
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void InstantiateWithInterfaceType()
{
- new ObjectWrapper(typeof (IList));
+ Assert.Throws(() => new ObjectWrapper(typeof (IList)));
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void InstantiateWithAbstractType()
{
- new ObjectWrapper(typeof (AbstractObjectFactoryTests));
+ Assert.Throws(() => new ObjectWrapper(typeof (AbstractObjectFactoryTests)));
}
[Test]
@@ -666,22 +654,20 @@ public void GetterThrowsException()
}
[Test]
- [ExpectedException(typeof (NotReadablePropertyException))]
public void TryToReadTheValueOfAWriteOnlyProperty()
{
NoRead nr = new NoRead();
ObjectWrapper wrapper = GetWrapper(nr);
- wrapper.GetPropertyValue("Age");
+ Assert.Throws(() => wrapper.GetPropertyValue("Age"));
}
[Test]
- [ExpectedException(typeof(NullValueInNestedPathException))]
public void TryToReadAnIndexedValueFromANullProperty()
{
TestObject o = new TestObject();
o.Friends = null;
ObjectWrapper wrapper = GetWrapper(o);
- wrapper.GetPropertyValue("Friends[2]");
+ Assert.Throws(() => wrapper.GetPropertyValue("Friends[2]"));
}
///
@@ -852,21 +838,19 @@ public void SetWrappedInstanceOfDifferentClass()
}
[Test]
- [ExpectedException(typeof (TypeMismatchException))]
public void TypeMismatch()
{
TestObject to = new TestObject();
IObjectWrapper wrapper = GetWrapper(to);
- wrapper.SetPropertyValue("Age", "foobar");
+ Assert.Throws(() => wrapper.SetPropertyValue("Age", "foobar"));
}
[Test]
- [ExpectedException(typeof (TypeMismatchException))]
public void EmptyValueForPrimitiveProperty()
{
TestObject to = new TestObject();
ObjectWrapper wrapper = GetWrapper(to);
- wrapper.SetPropertyValue("Age", "");
+ Assert.Throws(() => wrapper.SetPropertyValue("Age", ""));
}
[Test]
@@ -932,12 +916,11 @@ public void GetNestedProperty()
}
[Test]
- [ExpectedException(typeof (NullValueInNestedPathException))]
public void GetNestedPropertyValueNullValue()
{
TestObject rod = new TestObject("rod", 31);
rod.Doctor = new NestedTestObject(null);
- GetWrapper(rod).GetPropertyValue("Doctor.Company.Length");
+ Assert.Throws(() => GetWrapper(rod).GetPropertyValue("Doctor.Company.Length"));
}
[Test]
@@ -966,30 +949,27 @@ public void SetPropertyValue()
}
[Test]
- [ExpectedException(typeof (NullValueInNestedPathException))]
public void SetIndexedPropertyValueOnUninitializedPath()
{
TestObject obj = new TestObject("Bill", 4500);
IObjectWrapper wrapper = GetWrapper(obj);
- wrapper.SetPropertyValue("hats [0]", "Hicks & Co");
+ Assert.Throws(() => wrapper.SetPropertyValue("hats [0]", "Hicks & Co"));
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void SetIndexedPropertyValueOnNonIndexableType()
{
TestObject obj = new TestObject("Bill", 4500);
IObjectWrapper wrapper = GetWrapper(obj);
- wrapper.SetPropertyValue("doctor [0]", "Hicks & Co");
+ Assert.Throws(() => wrapper.SetPropertyValue("doctor [0]", "Hicks & Co"));
}
[Test]
- [ExpectedException(typeof (TypeMismatchException))]
public void SetPrimitivePropertyToNullReference()
{
TestObject obj = new TestObject("Bill", 4500);
IObjectWrapper wrapper = GetWrapper(obj);
- wrapper.SetPropertyValue("Age", null);
+ Assert.Throws(() => wrapper.SetPropertyValue("Age", null));
}
[Test]
@@ -1158,13 +1138,12 @@ public void GetIndexedFromArrayProperty()
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexOutofRangeFromArrayProperty()
{
PrimitiveArrayObject to = new PrimitiveArrayObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Array = new int[] {1, 2, 3, 4, 5};
- wrapper.GetPropertyValue("Array[5]");
+ Assert.Throws(() => wrapper.GetPropertyValue("Array[5]"));
}
[Test]
@@ -1178,39 +1157,36 @@ public void SetIndexedFromArrayProperty()
}
[Test]
- [ExpectedException(typeof(InvalidPropertyException))]
public void SetIndexOutOfRangeFromArrayProperty()
{
PrimitiveArrayObject to = new PrimitiveArrayObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Array = new int[] {1, 2, 3, 4, 5};
- wrapper.SetPropertyValue("Array[5]", 6);
+ Assert.Throws(() => wrapper.SetPropertyValue("Array[5]", 6));
}
///
/// Test that we bail when attempting to get an indexed property with some guff for the index
///
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexedPropertyValueWithGuffIndexFromArrayProperty()
{
PrimitiveArrayObject to = new PrimitiveArrayObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Array = new int[] {1, 2, 3, 4, 5};
- Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Array[HungerHurtsButStarvingWorks]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("Array[HungerHurtsButStarvingWorks]"));
}
///
/// Test that we bail when attempting to get an indexed property with some guff for the index
///
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexedPropertyValueWithMissingIndexFromArrayProperty()
{
PrimitiveArrayObject to = new PrimitiveArrayObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Array = new int[] {1, 2, 3, 4, 5};
- Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Array[]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("Array[]"));
}
#endregion
@@ -1254,13 +1230,12 @@ public void GetIndexedFromArrayListProperty()
}
[Test]
- [ExpectedException(typeof(InvalidPropertyException))]
public void GetIndexOutofRangeFromListProperty()
{
ListTestObject to = new ListTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.List = new ArrayList(new int[] {1, 2, 3, 4, 5});
- wrapper.GetPropertyValue("List[5]");
+ Assert.Throws(() => wrapper.GetPropertyValue("List[5]"));
}
[Test]
@@ -1274,34 +1249,30 @@ public void SetIndexedFromListProperty()
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void SetIndexedFromListPropertyUsingMixOfSingleAndDoubleQuotedDelimeters()
{
ListTestObject to = new ListTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.List = new ArrayList(new int[] {1, 2, 3, 4, 5});
- wrapper.SetPropertyValue("List['0\"]", 6);
- Assert.AreEqual(6, to.List[0]);
+ Assert.Throws(() => wrapper.SetPropertyValue("List['0\"]", 6));
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void SetIndexedFromListPropertyUsingNonNumericValueForTheIndex()
{
ListTestObject to = new ListTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.List = new ArrayList(new int[] {1, 2, 3, 4, 5});
- wrapper.SetPropertyValue("List[bingo]", 6);
+ Assert.Throws(() => wrapper.SetPropertyValue("List[bingo]", 6));
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void SetIndexedFromListPropertyUsingEmptyValueForTheIndex()
{
ListTestObject to = new ListTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.List = new ArrayList(new int[] {1, 2, 3, 4, 5});
- wrapper.SetPropertyValue("List[]", 6);
+ Assert.Throws(() => wrapper.SetPropertyValue("List[]", 6));
}
[Test]
@@ -1322,23 +1293,21 @@ public void SetIndexOutOfRangeFromListProperty()
/// Test that we bail when attempting to get an indexed property with some guff for the index
///
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexedPropertyValueWithGuffIndexFromListProperty()
{
ListTestObject to = new ListTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.List = new ArrayList(new int[] {1, 2, 3, 4, 5});
- Assert.AreEqual(1, (int) wrapper.GetPropertyValue("List[HungerHurtsButStarvingWorks]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("List[HungerHurtsButStarvingWorks]"));
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexedPropertyValueWithMissingIndexFromListProperty()
{
ListTestObject to = new ListTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.List = new ArrayList(new int[] {1, 2, 3, 4, 5});
- Assert.AreEqual(1, (int) wrapper.GetPropertyValue("List[]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("List[]"));
}
#endregion
@@ -1432,47 +1401,42 @@ public void SettingASetPropertyJustAddsTheValuesToTheExistingSet()
}
[Test]
- [ExpectedException(typeof(InvalidPropertyException))]
public void GetIndexFromSetProperty()
{
SetTestObject to = new SetTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Set = new ListSet(new int[] { 1, 2, 3, 4, 5 });
- Assert.AreEqual(1, (int)wrapper.GetPropertyValue("Set[1]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("Set[1]"));
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexOutofRangeFromSetProperty()
{
SetTestObject to = new SetTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Set = new ListSet(new int[] {1, 2, 3, 4, 5});
- Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Set[23]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("Set[23]"));
}
///
/// Test that we bail when attempting to get an indexed property with some guff for the index
///
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexedPropertyValueWithGuffIndexFromSetProperty()
{
SetTestObject to = new SetTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Set = new ListSet(new int[] {1, 2, 3, 4, 5});
- Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Set[HungerHurtsButStarvingWorks]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("Set[HungerHurtsButStarvingWorks]"));
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexedPropertyValueWithMissingIndexFromSetProperty()
{
SetTestObject to = new SetTestObject();
IObjectWrapper wrapper = GetWrapper(to);
to.Set = new ListSet(new int[] {1, 2, 3, 4, 5});
- object o = wrapper.GetPropertyValue("Set[]");
- Assert.AreEqual(1, (int) wrapper.GetPropertyValue("Set[]"));
+ Assert.Throws(() => wrapper.GetPropertyValue("Set[]"));
}
#endregion
@@ -1511,26 +1475,23 @@ public void SetTypePropertyWithString()
}
[Test]
- [ExpectedException(typeof (InvalidPropertyException))]
public void GetIndexedPropertyValueWithNonIndexedType()
{
TestObject to = new TestObject();
IObjectWrapper wrapper = GetWrapper(to);
- wrapper.GetPropertyValue("FileMode[0]");
+ Assert.Throws(() => wrapper.GetPropertyValue("FileMode[0]"));
}
[Test]
- [ExpectedException(typeof (NullValueInNestedPathException))]
public void SetPropertyValuesWithUnknownProperty()
{
TestObject to = new TestObject();
to.Doctor = null;
ObjectWrapper wrapper = GetWrapper(to);
- wrapper.SetPropertyValue("Doctor.Company", "Bingo");
+ Assert.Throws(() => wrapper.SetPropertyValue("Doctor.Company", "Bingo"));
}
[Test]
- [ExpectedException(typeof(InvalidPropertyException))]
public void SetPropertyValuesFailsWhenSettingNonExistantProperty()
{
TestObject to = new TestObject();
@@ -1539,7 +1500,7 @@ public void SetPropertyValuesFailsWhenSettingNonExistantProperty()
values.Add("JeepersCreepersWhereDidYaGetThosePeepers", "OhThisWeirdBatGuySoldEmToMe...");
values.Add("Age", 19);
// the unknown and ridiculously named property should fail
- wrapper.SetPropertyValues(values, false);
+ Assert.Throws(() => wrapper.SetPropertyValues(values, false));
}
[Test]
@@ -1556,14 +1517,13 @@ public void SetPropertyValuesDoesNotFailWhenSettingNonExistantPropertyWithIgnorU
}
[Test]
- [ExpectedException(typeof(NotWritablePropertyException))]
public void SetPropertyValuesFailsWhenSettingReadOnlyProperty()
{
TestObject to = new TestObject();
ObjectWrapper wrapper = GetWrapper(to);
MutablePropertyValues values = new MutablePropertyValues();
values.Add("ReadOnlyObjectNumber", 123);
- wrapper.SetPropertyValues(values, false);
+ Assert.Throws(() => wrapper.SetPropertyValues(values, false));
}
[Test]
@@ -1606,27 +1566,24 @@ public void TestToString()
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void GetPropertyInfoWithNullArgument()
{
ObjectWrapper wrapper = GetWrapper(new TestObject());
- wrapper.GetPropertyInfo(null);
+ Assert.Throws(() => wrapper.GetPropertyInfo(null));
}
[Test]
- [ExpectedException(typeof (FatalReflectionException))]
public void GetPropertyInfoWithNonPropertyExpression()
{
ObjectWrapper wrapper = GetWrapper(new TestObject());
- wrapper.GetPropertyInfo("2 + 2");
+ Assert.Throws(() => wrapper.GetPropertyInfo("2 + 2"));
}
[Test]
- [ExpectedException(typeof (FatalObjectException))]
public void GetPropertyInfoWithNonParsableExpression()
{
ObjectWrapper wrapper = GetWrapper(new TestObject());
- wrapper.GetPropertyInfo("[");
+ Assert.Throws(() => wrapper.GetPropertyInfo("["));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/PropertyValueTests.cs b/test/Spring/Spring.Core.Tests/Objects/PropertyValueTests.cs
index 757e2c01b..f99c7fb16 100644
--- a/test/Spring/Spring.Core.Tests/Objects/PropertyValueTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/PropertyValueTests.cs
@@ -35,10 +35,9 @@ namespace Spring.Objects
public sealed class PropertyValueTests
{
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithNulls()
{
- new PropertyValue(null, null);
+ Assert.Throws(() => new PropertyValue(null, null));
}
[Test]
@@ -50,17 +49,15 @@ public void Instantiation()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithEmptyStringPropertyName()
{
- new PropertyValue(string.Empty, 12);
+ Assert.Throws(() => new PropertyValue(string.Empty, 12));
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiationWithWhitespacePropertyName()
{
- new PropertyValue(" ", 12);
+ Assert.Throws(() => new PropertyValue(" ", 12));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/ResourceTestObject.cs b/test/Spring/Spring.Core.Tests/Objects/ResourceTestObject.cs
index 41edf210c..805e19c34 100644
--- a/test/Spring/Spring.Core.Tests/Objects/ResourceTestObject.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/ResourceTestObject.cs
@@ -16,7 +16,7 @@
*/
#endregion
#region Imports
-using System;
+
using System.IO;
using Spring.Core.IO;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Support/AbstractSharedStateFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Support/AbstractSharedStateFactoryTests.cs
index cab12dbec..703b4ab58 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Support/AbstractSharedStateFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Support/AbstractSharedStateFactoryTests.cs
@@ -75,7 +75,6 @@ public void StateDictionaryBehavesAccordingToCaseSensitiveState()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ThrowsOnNullInstance()
{
TestSharedStateFactory p = new TestSharedStateFactory();
@@ -83,7 +82,7 @@ public void ThrowsOnNullInstance()
IDictionary state = p.GetSharedStateFor(new object(), null);
Assert.IsNotNull(state);
// throws on null for instance
- p.GetSharedStateFor(null, "no name");
+ Assert.Throws(() => p.GetSharedStateFor(null, "no name"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Support/ByTypeSharedStateProviderTests.cs b/test/Spring/Spring.Core.Tests/Objects/Support/ByTypeSharedStateProviderTests.cs
index 1560acd40..435bd29f9 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Support/ByTypeSharedStateProviderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Support/ByTypeSharedStateProviderTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Support/InstanceEventHandlerValueTests.cs b/test/Spring/Spring.Core.Tests/Objects/Support/InstanceEventHandlerValueTests.cs
index 6500e05ff..79c48d3c4 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Support/InstanceEventHandlerValueTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Support/InstanceEventHandlerValueTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
@@ -70,14 +68,13 @@ InstanceEventHandlerValue wirer
}
[Test]
- [ExpectedException (typeof (FatalObjectException))]
public void BailsIfMethodDoesntExist ()
{
PingSource source = new PingSource ();
InstanceEventHandlerValue wirer
= new InstanceEventHandlerValue (source, "Roo");
wirer.EventName = "Ping";
- wirer.Wire (source, typeof (StaticPingListener));
+ Assert.Throws(() => wirer.Wire (source, typeof (StaticPingListener)));
}
}
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Support/MethodInvokerTests.cs b/test/Spring/Spring.Core.Tests/Objects/Support/MethodInvokerTests.cs
index 713fc64f2..7c6c54386 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Support/MethodInvokerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Support/MethodInvokerTests.cs
@@ -54,12 +54,11 @@ public void SettingNamedArgumentsToNullJustClearsOutAnyNamedArguments()
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="One of either the 'TargetType' or 'TargetObject' properties is required.")]
public void PrepareWithOnlyTargetMethodSet()
{
MethodInvoker vkr = new MethodInvoker();
vkr.TargetMethod = "Foo";
- vkr.Prepare();
+ Assert.Throws(() => vkr.Prepare(), "One of either the 'TargetType' or 'TargetObject' properties is required.");
}
[Test]
@@ -177,9 +176,6 @@ public void InvokeWithMixOfNamedAndPlainVanillaArgumentsOfDifferingTypes()
}
[Test]
- [ExpectedException(
- typeof (ArgumentException),
- ExpectedMessage = "The named argument 'southpaw' could not be found on the 'GrowOlder' method of class [Spring.Objects.Support.MethodInvokerTests+Foo].")]
public void InvokeWithNamedArgumentThatDoesNotExist()
{
Foo foo = new Foo();
@@ -188,9 +184,7 @@ public void InvokeWithNamedArgumentThatDoesNotExist()
vkr.TargetObject = foo;
vkr.TargetMethod = "growolder";
vkr.AddNamedArgument("southpaw", 10);
- vkr.Prepare();
- object actual = vkr.Invoke();
- Assert.AreEqual(98, actual);
+ Assert.Throws(() => vkr.Prepare(), "The named argument 'southpaw' could not be found on the 'GrowOlder' method of class [Spring.Objects.Support.MethodInvokerTests+Foo].");
}
///
@@ -211,7 +205,6 @@ public void InvokeWithWeIRdLyCasedNamedArgument()
}
[Test]
- [ExpectedException(typeof (MethodInvocationException), ExpectedMessage="At least one of the arguments passed to this MethodInvoker was incompatible with the signature of the invoked method.")]
public void InvokeWithArgumentOfWrongType()
{
Foo foo = new Foo();
@@ -221,7 +214,7 @@ public void InvokeWithArgumentOfWrongType()
vkr.TargetMethod = "growolder";
vkr.AddNamedArgument("years", "Bingo");
vkr.Prepare();
- vkr.Invoke();
+ Assert.Throws(() => vkr.Invoke(), "At least one of the arguments passed to this MethodInvoker was incompatible with the signature of the invoked method.");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Support/MutableSortDefinitionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Support/MutableSortDefinitionTests.cs
index 31e054ee8..17666c791 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Support/MutableSortDefinitionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Support/MutableSortDefinitionTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Objects/Support/PropertyComparatorTests.cs b/test/Spring/Spring.Core.Tests/Objects/Support/PropertyComparatorTests.cs
index f680eaa7b..02e980769 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Support/PropertyComparatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Support/PropertyComparatorTests.cs
@@ -45,10 +45,9 @@ namespace Spring.Objects.Support
public sealed class PropertyComparatorTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void InstantiationWithNullArgument()
{
- new PropertyComparator(null);
+ Assert.Throws(() => new PropertyComparator(null));
}
[Test]
@@ -92,7 +91,6 @@ public void CompareWithNullProperty()
}
[Test]
- [ExpectedException(typeof(InvalidPropertyException))]
public void CompareWithNonExistantProperty()
{
ISortDefinition definition = new MutableSortDefinition("Deborahs.Banjo", true, true);
@@ -100,8 +98,7 @@ public void CompareWithNonExistantProperty()
PropertyComparator cmp = new PropertyComparator(definition);
TestObject one = new TestObject("Rick", 19);
TestObject two = new TestObject("Balzac", 205);
- int actual = cmp.Compare(one, two);
- Assert.IsTrue(actual == 0);
+ Assert.Throws(() => cmp.Compare(one, two));
}
[Test]
@@ -158,10 +155,9 @@ public void OrderingIsUnperturbedWithEqualProps()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void SortWithNullDefinition()
{
- PropertyComparator.Sort(Type.EmptyTypes, null);
+ Assert.Throws(() => PropertyComparator.Sort(Type.EmptyTypes, null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Objects/Support/StaticEventHandlerValueTests.cs b/test/Spring/Spring.Core.Tests/Objects/Support/StaticEventHandlerValueTests.cs
index 436206ab3..fd53ecccb 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Support/StaticEventHandlerValueTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Support/StaticEventHandlerValueTests.cs
@@ -61,14 +61,13 @@ StaticEventHandlerValue wirer
}
[Test]
- [ExpectedException (typeof (FatalObjectException))]
public void WireWithInstanceHandler ()
{
StaticEventHandlerValue wirer = new StaticEventHandlerValue ();
wirer.EventName = "Ping";
wirer.MethodName = "OnPing";
PingSource source = new PingSource ();
- wirer.Wire (source, new PingListener ());
+ Assert.Throws(() => wirer.Wire (source, new PingListener ()));
}
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/TypeMismatchExceptionTests.cs b/test/Spring/Spring.Core.Tests/Objects/TypeMismatchExceptionTests.cs
index 8bba3c37a..36b8fa1c0 100644
--- a/test/Spring/Spring.Core.Tests/Objects/TypeMismatchExceptionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/TypeMismatchExceptionTests.cs
@@ -18,8 +18,6 @@
#endregion
-using System;
-
using NUnit.Framework;
using Spring.Core;
diff --git a/test/Spring/Spring.Core.Tests/Pool/Support/SimplePoolTest.cs b/test/Spring/Spring.Core.Tests/Pool/Support/SimplePoolTest.cs
index b0fa49fbd..d2ac76bca 100644
--- a/test/Spring/Spring.Core.Tests/Pool/Support/SimplePoolTest.cs
+++ b/test/Spring/Spring.Core.Tests/Pool/Support/SimplePoolTest.cs
@@ -132,24 +132,21 @@ public void SetUp()
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void InstantiateWithNullPoolableObjectFactory()
{
- new SimplePool(null, 10);
+ Assert.Throws(() => new SimplePool(null, 10));
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void InstantiateSpecifyingZeroPooledItems()
{
- new SimplePool(factory, 0);
+ Assert.Throws(() => new SimplePool(factory, 0));
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void InstantiateSpecifyingNegativePooledItems()
{
- new SimplePool(factory, -10000);
+ Assert.Throws(() => new SimplePool(factory, -10000));
}
[Test]
@@ -182,7 +179,7 @@ public void PassivateBusyObjectsBeforeClose()
mocks.VerifyAll();
}
- [Test, ExpectedException(typeof (PoolException))]
+ [Test]
[Ignore("No longer expected behavior per SPRNET-1582 being resolved.")]
public void NoMoreUsableAfterClose()
{
@@ -191,11 +188,11 @@ public void NoMoreUsableAfterClose()
mocks.ReplayAll();
pool.Close();
- pool.BorrowObject();
+ Assert.Throws(() => pool.BorrowObject());
mocks.VerifyAll();
}
- [Test, ExpectedException(typeof (PoolException))]
+ [Test]
[Ignore("No longer expected behavior per SPRNET-1582 being resolved.")]
public void ThrowsExceptionWhenOutOfItemsBecauseFailedValidation()
{
@@ -205,7 +202,7 @@ public void ThrowsExceptionWhenOutOfItemsBecauseFailedValidation()
mocks.ReplayAll();
pool = new SimplePool(factory, 1);
- pool.BorrowObject();
+ Assert.Throws(() => pool.BorrowObject());
mocks.VerifyAll();
}
diff --git a/test/Spring/Spring.Core.Tests/Proxy/AbstractProxyTypeBuilderTests.cs b/test/Spring/Spring.Core.Tests/Proxy/AbstractProxyTypeBuilderTests.cs
index e83b94e74..6867b11d8 100644
--- a/test/Spring/Spring.Core.Tests/Proxy/AbstractProxyTypeBuilderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Proxy/AbstractProxyTypeBuilderTests.cs
@@ -26,7 +26,6 @@
using System.Reflection;
using System.Reflection.Emit;
using System.Collections;
-using System.Diagnostics;
using System.Web.Services;
using System.Runtime.InteropServices;
diff --git a/test/Spring/Spring.Core.Tests/Proxy/CompositionProxyTypeBuilderTests.cs b/test/Spring/Spring.Core.Tests/Proxy/CompositionProxyTypeBuilderTests.cs
index 92751b34a..a571ed6e9 100644
--- a/test/Spring/Spring.Core.Tests/Proxy/CompositionProxyTypeBuilderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Proxy/CompositionProxyTypeBuilderTests.cs
@@ -38,20 +38,18 @@ namespace Spring.Proxy
public class CompositionProxyTypeBuilderTests : AbstractProxyTypeBuilderTests
{
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="Composition proxy target must implement at least one interface.")]
public void OnClassThatDoesntImplementAnyInterfaces()
{
IProxyTypeBuilder builder = GetProxyBuilder();
builder.TargetType = typeof (DoesntImplementAnyInterfaces);
- builder.BuildProxyType();
+ Assert.Throws(() => builder.BuildProxyType(), "Composition proxy target must implement at least one interface.");
}
[Test]
- [ExpectedException(typeof (NullReferenceException))]
public void BuildProxyWithNothingSet()
{
IProxyTypeBuilder builder = GetProxyBuilder();
- builder.BuildProxyType();
+ Assert.Throws(() => builder.BuildProxyType());
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Proxy/DynamicProxyManagerTests.cs b/test/Spring/Spring.Core.Tests/Proxy/DynamicProxyManagerTests.cs
index 2f44864fa..fc107ef19 100644
--- a/test/Spring/Spring.Core.Tests/Proxy/DynamicProxyManagerTests.cs
+++ b/test/Spring/Spring.Core.Tests/Proxy/DynamicProxyManagerTests.cs
@@ -24,7 +24,6 @@
using System.Reflection.Emit;
using System.Threading;
using NUnit.Framework;
-using System.Reflection;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Proxy/InheritanceProxyTypeBuilderTests.cs b/test/Spring/Spring.Core.Tests/Proxy/InheritanceProxyTypeBuilderTests.cs
index 464a343ec..c5c215f4e 100644
--- a/test/Spring/Spring.Core.Tests/Proxy/InheritanceProxyTypeBuilderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Proxy/InheritanceProxyTypeBuilderTests.cs
@@ -48,12 +48,11 @@ public void OnClassThatDoesntImplementAnyInterfaces()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithSealedClass()
{
InheritanceProxyTypeBuilder builder = (InheritanceProxyTypeBuilder) GetProxyBuilder();
builder.TargetType = typeof(SealedClass);
- builder.BuildProxyType();
+ Assert.Throws(() => builder.BuildProxyType());
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/BasePropertyTests.cs b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/BasePropertyTests.cs
index 0c0ad558b..2faad09ff 100644
--- a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/BasePropertyTests.cs
+++ b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/BasePropertyTests.cs
@@ -1,10 +1,7 @@
using System;
-using System.CodeDom.Compiler;
using System.Diagnostics;
-using System.IO;
using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Text;
+
using NUnit.Framework;
using Spring.Context.Support;
@@ -52,7 +49,7 @@ public void SetUp()
ieee.Officers["advisors"] = new Inventor[] { tesla, pupin }; // not historically accurate, but I need an array in the map ;-)
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TearDown()
{
//DynamicReflectionManager.SaveAssembly();
@@ -128,7 +125,6 @@ public void TestStaticProperties()
}
[Test, Ignore("test N/A anymore due to System.Reflection.Emit.DynamicMethod")]
- [ExpectedException(typeof(MethodAccessException))]
public void TestForRestrictiveGetter()
{
Something something = new Something();
@@ -141,11 +137,10 @@ public void TestForRestrictiveGetter()
IDynamicProperty first = Create(typeof(Something).GetProperty("First"));
first.SetValue(something, 123);
//this should cause MethodAccessException, because get is private
- Assert.AreEqual(123, first.GetValue(something));
+ Assert.Throws(() => first.GetValue(something));
}
[Test, Ignore("test N/A anymore due to System.Reflection.Emit.DynamicMethod")]
- [ExpectedException(typeof(MethodAccessException))]
public void TestForRestrictiveSetter()
{
Something something = new Something();
@@ -161,7 +156,7 @@ public void TestForRestrictiveSetter()
second.SetValue(something, 123);
//this should never execute
- Assert.AreEqual(123, second.GetValue(something));
+ Assert.Throws(() => second.GetValue(something));
}
#region Performance tests
diff --git a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicConstructorTests.cs b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicConstructorTests.cs
index 061883f40..eae90d8f9 100644
--- a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicConstructorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicConstructorTests.cs
@@ -72,7 +72,7 @@ public void SetUp()
ieee.Officers["advisors"] = new Inventor[] { tesla, pupin }; // not historically accurate, but I need an array in the map ;-)
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TearDown()
{
//DynamicReflectionManager.SaveAssembly();
diff --git a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicFieldTests.cs b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicFieldTests.cs
index 30bb0226e..43302a2a0 100644
--- a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicFieldTests.cs
+++ b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicFieldTests.cs
@@ -24,7 +24,7 @@
using System.Diagnostics;
using System.Reflection;
using System.Security;
-using System.Security.Permissions;
+
using NUnit.Framework;
using Spring.Context.Support;
@@ -75,7 +75,7 @@ public void SetUp()
ieee.Officers["advisors"] = new Inventor[] { tesla, pupin }; // not historically accurate, but I need an array in the map ;-)
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TearDown()
{
//DynamicReflectionManager.SaveAssembly();
@@ -104,12 +104,11 @@ public void TestInstanceFields()
}
[Test]
- [ExpectedException( typeof( InvalidOperationException ) )]
public void TestAttemptingToSetFieldOfValueTypeInstance()
{
MyStruct myYearHolder = new MyStruct();
IDynamicField year = Create( typeof( MyStruct ).GetField( "year" ) );
- year.SetValue( myYearHolder, 2004 );
+ Assert.Throws(() => year.SetValue( myYearHolder, 2004 ));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicMethodTests.cs b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicMethodTests.cs
index 2bd73cd95..c19955350 100644
--- a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicMethodTests.cs
+++ b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicMethodTests.cs
@@ -75,7 +75,7 @@ public void SetUp()
ieee.Officers["advisors"] = new Inventor[] { tesla, pupin }; // not historically accurate, but I need an array in the map ;-)
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void TearDown()
{
//DynamicReflectionManager.SaveAssembly();
diff --git a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicPropertyTests.cs b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicPropertyTests.cs
index f7be0b70d..0d6e8d9ff 100644
--- a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicPropertyTests.cs
+++ b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/DynamicPropertyTests.cs
@@ -21,13 +21,9 @@
#region Imports
using System;
-using System.CodeDom.Compiler;
-using System.Diagnostics;
-using System.IO;
using System.Reflection;
-using System.Text;
+
using NUnit.Framework;
-using Spring.Context.Support;
#endregion
@@ -42,61 +38,78 @@ public class DynamicPropertyTests : BasePropertyTests
{
private const BindingFlags BINDANY = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static;
- protected override IDynamicProperty Create( PropertyInfo property )
+ protected override IDynamicProperty Create(PropertyInfo property)
{
- return DynamicProperty.Create( property );
+ return DynamicProperty.Create(property);
}
[Test]
- [ExpectedException( typeof( InvalidOperationException ) )]
public void TestNonReadableProperties()
{
- IDynamicProperty nonReadableProperty =
- Create( typeof( ClassWithNonReadableProperty ).GetProperty( "MyProperty" ) );
- nonReadableProperty.GetValue( null );
+ IDynamicProperty nonReadableProperty = Create(typeof(ClassWithNonReadableProperty).GetProperty("MyProperty"));
+ Assert.Throws(() => nonReadableProperty.GetValue(null));
}
[Test]
- [ExpectedException( typeof( InvalidOperationException ) )]
public void TestNonWritableInstanceProperty()
{
- IDynamicProperty nonWritableProperty =
- Create( typeof( Inventor ).GetProperty( "PlaceOfBirth" ) );
- nonWritableProperty.SetValue( null, null );
+ IDynamicProperty nonWritableProperty = Create(typeof(Inventor).GetProperty("PlaceOfBirth"));
+ Assert.Throws(() => nonWritableProperty.SetValue(null, null));
}
[Test]
- [ExpectedException( typeof( InvalidOperationException ) )]
public void TestAttemptingToSetPropertyOfValueTypeInstance()
{
MyStruct myYearHolder = new MyStruct();
- IDynamicProperty year = Create( typeof( MyStruct ).GetProperty( "Year" ) );
- year.SetValue( myYearHolder, 2004 );
+ IDynamicProperty year = Create(typeof(MyStruct).GetProperty("Year"));
+ Assert.Throws(() => year.SetValue(myYearHolder, 2004));
}
[Test]
- [ExpectedException( typeof( InvalidOperationException ) )]
public void TestNonWritableStaticProperty()
{
- IDynamicProperty nonWritableProperty =
- Create( typeof( DateTime ).GetProperty( "Today" ) );
- nonWritableProperty.SetValue( null, null );
+ IDynamicProperty nonWritableProperty = Create(typeof(DateTime).GetProperty("Today"));
+ Assert.Throws(() => nonWritableProperty.SetValue(null, null));
}
[Test]
public void TestSetIncompatibleType()
{
- IDynamicProperty inventorPlace = Create( typeof( Inventor ).GetProperty("POB") );
- try { inventorPlace.SetValue( new Inventor(), new object() ); Assert.Fail(); }
- catch (InvalidCastException) { }
- try { inventorPlace.SetValue( new Inventor(), new DateTime() ); Assert.Fail(); }
- catch (InvalidCastException) { }
+ IDynamicProperty inventorPlace = Create(typeof(Inventor).GetProperty("POB"));
+ try
+ {
+ inventorPlace.SetValue(new Inventor(), new object());
+ Assert.Fail();
+ }
+ catch (InvalidCastException)
+ {
+ }
+ try
+ {
+ inventorPlace.SetValue(new Inventor(), new DateTime());
+ Assert.Fail();
+ }
+ catch (InvalidCastException)
+ {
+ }
- IDynamicProperty inventorDOB = Create( typeof( Inventor ).GetProperty("DOB") );
- try { inventorDOB.SetValue( new Inventor(), 2 ); Assert.Fail(); }
- catch (InvalidCastException) { }
- try { inventorDOB.SetValue( new Inventor(), new Place() ); Assert.Fail(); }
- catch (InvalidCastException) { }
+ IDynamicProperty inventorDOB = Create(typeof(Inventor).GetProperty("DOB"));
+ try
+ {
+ inventorDOB.SetValue(new Inventor(), 2);
+ Assert.Fail();
+ }
+ catch (InvalidCastException)
+ {
+ }
+ try
+ {
+ inventorDOB.SetValue(new Inventor(), new Place());
+ Assert.Fail();
+ }
+ catch (InvalidCastException)
+ {
+ }
}
}
-}
+}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/SafeFieldTests.cs b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/SafeFieldTests.cs
index 2b7364fe4..d5e95784d 100644
--- a/test/Spring/Spring.Core.Tests/Reflection/Dynamic/SafeFieldTests.cs
+++ b/test/Spring/Spring.Core.Tests/Reflection/Dynamic/SafeFieldTests.cs
@@ -52,10 +52,9 @@ private static FieldInfo SField(Type t, string fieldName)
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ThrowsOnNullField()
{
- SafeField field = new SafeField(null);
+ Assert.Throws(() => new SafeField(null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj
index 7876b999d..b775623be 100644
--- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj
+++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2010.csproj
@@ -30,7 +30,6 @@
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Core.Tests\Debug\
@@ -88,10 +87,14 @@
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
+
+ ..\..\..\packages\FakeItEasy.2.3.0-coreclr-beta57\lib\net40\FakeItEasy.dll
+ True
+
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
False
@@ -726,6 +729,7 @@
Code
+
@@ -1043,5 +1047,4 @@
xcopy "$(ProjectDir)Data" ..\..\..\..\build\VS.Net.2010\Spring.Core.Tests\$(ConfigurationName)\ /y /s /q /d
xcopy "$(ProjectDir)$(TargetFileName).config" ..\..\..\..\build\VS.Net.2010\Spring.Core.Tests\$(ConfigurationName)\ /y /s /q
-
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.build b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.build
index 9c9bb7d74..a22cc6704 100644
--- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.build
+++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.build
@@ -78,7 +78,7 @@
-
+
diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config
index 28dfb4850..7871fc890 100644
--- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config
+++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config
@@ -235,8 +235,8 @@ limitations under the License.
-
-
+
+
diff --git a/test/Spring/Spring.Core.Tests/StreamHelperDecorator.cs b/test/Spring/Spring.Core.Tests/StreamHelperDecorator.cs
index 0633b8dfb..6c4c3fda4 100644
--- a/test/Spring/Spring.Core.Tests/StreamHelperDecorator.cs
+++ b/test/Spring/Spring.Core.Tests/StreamHelperDecorator.cs
@@ -18,7 +18,6 @@
#endregion
-using System;
using System.IO;
namespace Spring
diff --git a/test/Spring/Spring.Core.Tests/TestAssemblySetup.cs b/test/Spring/Spring.Core.Tests/TestAssemblySetup.cs
new file mode 100644
index 000000000..67e6fc259
--- /dev/null
+++ b/test/Spring/Spring.Core.Tests/TestAssemblySetup.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Globalization;
+using System.IO;
+using System.Reflection;
+using System.Threading;
+
+using NUnit.Framework;
+
+namespace Spring
+{
+ [SetUpFixture]
+ public class TestAssemblySetup
+ {
+ [OneTimeSetUp]
+ public void SetUp()
+ {
+ // while R# is broken (https://youtrack.jetbrains.com/issue/RSRP-451142)
+ string codeBase = Assembly.GetExecutingAssembly().CodeBase;
+ UriBuilder uri = new UriBuilder(codeBase);
+ string path = Uri.UnescapeDataString(uri.Path);
+ var pathToUse = Path.GetDirectoryName(path);
+ Directory.SetCurrentDirectory(pathToUse);
+
+ CultureInfo enUs = new CultureInfo("en-US");
+ Thread.CurrentThread.CurrentCulture = enUs;
+ Thread.CurrentThread.CurrentUICulture = enUs;
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Threading/AsyncTestMethod.cs b/test/Spring/Spring.Core.Tests/Threading/AsyncTestMethod.cs
index 062d9c667..93720ac0c 100644
--- a/test/Spring/Spring.Core.Tests/Threading/AsyncTestMethod.cs
+++ b/test/Spring/Spring.Core.Tests/Threading/AsyncTestMethod.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Threading;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Threading/CommonThreadStorageTests.cs b/test/Spring/Spring.Core.Tests/Threading/CommonThreadStorageTests.cs
index 4223e13f0..02c884a55 100644
--- a/test/Spring/Spring.Core.Tests/Threading/CommonThreadStorageTests.cs
+++ b/test/Spring/Spring.Core.Tests/Threading/CommonThreadStorageTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Threading;
using NUnit.Framework;
@@ -42,13 +41,13 @@ protected virtual void ThreadSetup()
protected virtual void ThreadCleanup()
{}
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void FixtureSetUp()
{
ThreadSetup();
}
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void FixtureTearDown()
{
ThreadCleanup();
diff --git a/test/Spring/Spring.Core.Tests/Threading/LatchTest.cs b/test/Spring/Spring.Core.Tests/Threading/LatchTest.cs
index 7fe10d72d..fe1a0509b 100644
--- a/test/Spring/Spring.Core.Tests/Threading/LatchTest.cs
+++ b/test/Spring/Spring.Core.Tests/Threading/LatchTest.cs
@@ -1,6 +1,5 @@
-using System;
using System.Threading;
-using Spring.Threading;
+
using NUnit.Framework;
#region Licence
diff --git a/test/Spring/Spring.Core.Tests/Threading/LogicalThreadContextTest.cs b/test/Spring/Spring.Core.Tests/Threading/LogicalThreadContextTest.cs
index 8dba38ab0..c615247ad 100644
--- a/test/Spring/Spring.Core.Tests/Threading/LogicalThreadContextTest.cs
+++ b/test/Spring/Spring.Core.Tests/Threading/LogicalThreadContextTest.cs
@@ -56,10 +56,9 @@ public void FreeNamedDataSlot(string name)
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void StorageMustNotBeNull()
{
- LogicalThreadContext.SetStorage(null);
+ Assert.Throws(() => LogicalThreadContext.SetStorage(null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Threading/SemaphoreTest.cs b/test/Spring/Spring.Core.Tests/Threading/SemaphoreTest.cs
index 3b96bb7fb..48453b95d 100644
--- a/test/Spring/Spring.Core.Tests/Threading/SemaphoreTest.cs
+++ b/test/Spring/Spring.Core.Tests/Threading/SemaphoreTest.cs
@@ -20,7 +20,6 @@
using System;
using System.Threading;
using Spring.Pool;
-using Spring.Threading;
using NUnit.Framework;
@@ -81,15 +80,13 @@ public void AttemptWithNegativeMillisInSameThread()
}
[Test]
- [ExpectedException(typeof(ArgumentOutOfRangeException))]
public void ReleaseMultipleBadArgument()
{
Semaphore s = new Semaphore(2);
Assert.AreEqual(2, s.Permits);
s.Acquire();
s.Acquire();
- s.Release(-2);
- Assert.AreEqual(2, s.Permits);
+ Assert.Throws(() => s.Release(-2));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Threading/SyncHolderTest.cs b/test/Spring/Spring.Core.Tests/Threading/SyncHolderTest.cs
index b126e3884..d9026f8d1 100644
--- a/test/Spring/Spring.Core.Tests/Threading/SyncHolderTest.cs
+++ b/test/Spring/Spring.Core.Tests/Threading/SyncHolderTest.cs
@@ -57,17 +57,20 @@ public void CanBeUsedWithTheUsingCSharpIdiomToAttemptOnAnISync ()
}
[Test]
- [ExpectedException(typeof(ThreadStateException))]
public void CanBeUsedWithTheUsingCSharpIdiomToAcquireAnIsync()
{
sync.Acquire();
sync.Release();
mocks.ReplayAll();
- using (new SyncHolder(sync))
- {
- throw new ThreadStateException();
- }
- }
+ Assert.Throws(() =>
+ {
+ using (new SyncHolder(sync))
+ {
+ throw new ThreadStateException();
+ }
+
+ });
+ }
}
}
diff --git a/test/Spring/Spring.Core.Tests/Util/ArrayUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/ArrayUtilsTests.cs
index 7f3bc68f3..9ba630a1a 100644
--- a/test/Spring/Spring.Core.Tests/Util/ArrayUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/ArrayUtilsTests.cs
@@ -20,9 +20,6 @@
#region Imports
-using System;
-using System.Collections;
-
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Util/AssertUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/AssertUtilsTests.cs
index 2d4e952a7..c6bc20836 100644
--- a/test/Spring/Spring.Core.Tests/Util/AssertUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/AssertUtilsTests.cs
@@ -40,10 +40,9 @@ namespace Spring.Util
public sealed class AssertUtilsTests
{
[Test]
- [ExpectedException(typeof(ArgumentException), ExpectedMessage = "foo")]
public void IsTrueWithMesssage()
{
- AssertUtils.IsTrue(false, "foo");
+ Assert.Throws(() => AssertUtils.IsTrue(false, "foo"), "foo");
}
[Test]
@@ -53,10 +52,9 @@ public void IsTrueWithMessageValidExpression()
}
[Test]
- [ExpectedException(typeof(ArgumentException), ExpectedMessage = "[Assertion failed] - this expression must be true")]
public void IsTrue()
{
- AssertUtils.IsTrue(false);
+ Assert.Throws(() => AssertUtils.IsTrue(false), "[Assertion failed] - this expression must be true");
}
[Test]
@@ -66,24 +64,21 @@ public void IsTrueValidExpression()
}
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void StateTrue()
{
- AssertUtils.State(false, "foo");
+ Assert.Throws(() => AssertUtils.State(false, "foo"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentNotNull()
{
- AssertUtils.ArgumentNotNull(null, "foo");
+ Assert.Throws(() => AssertUtils.ArgumentNotNull(null, "foo"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentNotNullWithMessage()
{
- AssertUtils.ArgumentNotNull(null, "foo", "Bang!");
+ Assert.Throws(() => AssertUtils.ArgumentNotNull(null, "foo", "Bang!"));
}
[Test]
@@ -99,45 +94,39 @@ public void ArgumentHasTextWithValidTextAndMessage()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentHasText()
{
- AssertUtils.ArgumentHasText(null, "foo");
+ Assert.Throws(() => AssertUtils.ArgumentHasText(null, "foo"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentHasTextWithMessage()
{
- AssertUtils.ArgumentHasText(null, "foo", "Bang!");
+ Assert.Throws(() => AssertUtils.ArgumentHasText(null, "foo", "Bang!"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentHasLengthArgumentIsNull()
{
- AssertUtils.ArgumentHasLength(null, "foo");
+ Assert.Throws(() => AssertUtils.ArgumentHasLength(null, "foo"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentHasLengthArgumentIsNullWithMessage()
{
- AssertUtils.ArgumentHasLength(null, "foo", "Bang!");
+ Assert.Throws(() => AssertUtils.ArgumentHasLength(null, "foo", "Bang!"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentHasLengthArgumentIsEmpty()
{
- AssertUtils.ArgumentHasLength(new byte[0], "foo");
+ Assert.Throws(() => AssertUtils.ArgumentHasLength(new byte[0], "foo"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ArgumentHasLengthArgumentIsEmptyWithMessage()
{
- AssertUtils.ArgumentHasLength(new byte[0], "foo", "Bang!");
+ Assert.Throws(() => AssertUtils.ArgumentHasLength(new byte[0], "foo", "Bang!"));
}
[Test]
@@ -153,24 +142,21 @@ public void ArgumentHasLengthArgumentHasElementsWithMessage()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ArgumentHasElementsArgumentIsNull()
{
- AssertUtils.ArgumentHasElements(null, "foo");
+ Assert.Throws(() => AssertUtils.ArgumentHasElements(null, "foo"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ArgumentHasElementsArgumentIsEmpty()
{
- AssertUtils.ArgumentHasElements(new object[0], "foo");
+ Assert.Throws(() => AssertUtils.ArgumentHasElements(new object[0], "foo"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ArgumentHasElementsArgumentContainsNull()
{
- AssertUtils.ArgumentHasElements(new object[] { new object(), null, new object() }, "foo");
+ Assert.Throws(() => AssertUtils.ArgumentHasElements(new object[] { new object(), null, new object() }, "foo"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/CollectionUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/CollectionUtilsTests.cs
index c166af36a..2607722cc 100644
--- a/test/Spring/Spring.Core.Tests/Util/CollectionUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/CollectionUtilsTests.cs
@@ -93,6 +93,7 @@ public void ContainsValidElement()
Assert.IsTrue(CollectionUtils.Contains(list, 3));
}
+
[Test]
public void ContainsDoesNotContainElement()
{
@@ -104,12 +105,13 @@ public void ContainsDoesNotContainElement()
Assert.IsFalse(CollectionUtils.Contains(list, 5));
}
+
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void AddNullCollection()
{
- CollectionUtils.Add(null, null);
+ Assert.Throws(() => CollectionUtils.Add(null, null));
}
+
[Test]
public void AddNullObject()
{
@@ -117,13 +119,14 @@ public void AddNullObject()
CollectionUtils.Add(list, null);
Assert.IsTrue(list.Count == 1);
}
+
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void AddCollectionDoesNotImplementAdd()
{
NoContainsNoAddCollection noAddCollection = new NoContainsNoAddCollection();
- CollectionUtils.Add(noAddCollection, null);
+ Assert.Throws(() => CollectionUtils.Add(noAddCollection, null));
}
+
[Test]
public void AddValidElement()
{
@@ -132,25 +135,25 @@ public void AddValidElement()
CollectionUtils.Add(list, obj1);
Assert.IsTrue(list.Count == 1);
}
+
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ContainsAllNullTargetCollection()
{
- CollectionUtils.ContainsAll(null, new ArrayList());
+ Assert.Throws(() => CollectionUtils.ContainsAll(null, new ArrayList()));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ContainsAllSourceNullCollection()
{
- CollectionUtils.ContainsAll(new ArrayList(), null);
+ Assert.Throws(() => CollectionUtils.ContainsAll(new ArrayList(), null));
}
+
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void ContainsAllDoesNotImplementContains()
{
- CollectionUtils.ContainsAll(new NoContainsNoAddCollection(), new ArrayList());
+ Assert.Throws(() => CollectionUtils.ContainsAll(new NoContainsNoAddCollection(), new ArrayList()));
}
+
[Test]
public void DoesNotContainAllElements()
{
@@ -164,6 +167,7 @@ public void DoesNotContainAllElements()
Assert.IsTrue(CollectionUtils.ContainsAll(target, source));
}
+
[Test]
public void ContainsAllElements()
{
@@ -190,6 +194,7 @@ public void ContainsAllElementsWithNoElementsInSourceCollection()
ArrayList source = new ArrayList();
Assert.IsTrue(CollectionUtils.ContainsAll(target, source));
}
+
[Test]
public void ContainsAllElementsWithNoElementsEitherCollection()
{
@@ -197,12 +202,13 @@ public void ContainsAllElementsWithNoElementsEitherCollection()
ArrayList source = new ArrayList();
Assert.IsFalse(CollectionUtils.ContainsAll(target, source));
}
+
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ToArrayNullTargetCollection()
{
- CollectionUtils.ToArrayList(null);
+ Assert.Throws(() => CollectionUtils.ToArrayList(null));
}
+
[Test]
public void ToArrayAllElements()
{
@@ -215,6 +221,7 @@ public void ToArrayAllElements()
Assert.AreEqual(target.Count, source.Count);
}
+
[Test]
public void EmptyArrayElements()
{
@@ -223,29 +230,29 @@ public void EmptyArrayElements()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void RemoveAllTargetNullCollection()
{
- CollectionUtils.RemoveAll(null, new ArrayList());
+ Assert.Throws(() => CollectionUtils.RemoveAll(null, new ArrayList()));
}
+
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void RemoveAllSourceNullCollection()
{
- CollectionUtils.RemoveAll(new ArrayList(), null);
+ Assert.Throws(() => CollectionUtils.RemoveAll(new ArrayList(), null));
}
+
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void RemoveAllTargetCollectionDoesNotImplementContains()
{
- CollectionUtils.RemoveAll(new NoContainsNoAddCollection(), new ArrayList());
+ Assert.Throws(() => CollectionUtils.RemoveAll(new NoContainsNoAddCollection(), new ArrayList()));
}
+
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void RemoveAllTargetCollectionDoesNotImplementRemove()
{
- CollectionUtils.RemoveAll(new NoContainsNoAddCollection(), new ArrayList());
+ Assert.Throws(() => CollectionUtils.RemoveAll(new NoContainsNoAddCollection(), new ArrayList()));
}
+
[Test]
public void RemoveAllNoElements()
{
@@ -262,6 +269,7 @@ public void RemoveAllNoElements()
CollectionUtils.RemoveAll(target, source);
Assert.IsTrue(3 == target.Count);
}
+
[Test]
public void RemoveAllSomeElements()
{
@@ -280,6 +288,7 @@ public void RemoveAllSomeElements()
CollectionUtils.RemoveAll(target, source);
Assert.IsTrue(3 == target.Count);
}
+
[Test]
public void RemoveAllAllElements()
{
@@ -353,7 +362,6 @@ public void FindValueOfType()
{
//ok
}
-
}
[Test]
@@ -361,7 +369,7 @@ public void ToArray()
{
ArrayList list = new ArrayList();
list.Add("mystring");
- string[] strList = (string[])CollectionUtils.ToArray(list, typeof(string));
+ string[] strList = (string[]) CollectionUtils.ToArray(list, typeof(string));
Assert.AreEqual(1, strList.Length);
try
@@ -369,21 +377,23 @@ public void ToArray()
CollectionUtils.ToArray(list, typeof(Type));
Assert.Fail("should fail");
}
- catch (InvalidCastException) { }
+ catch (InvalidCastException)
+ {
+ }
}
[Test]
public void StableSorting()
{
DictionaryEntry[] entries = new DictionaryEntry[]
- {
- new DictionaryEntry(5, 4),
- new DictionaryEntry(5, 5),
- new DictionaryEntry(3, 2),
- new DictionaryEntry(3, 3),
- new DictionaryEntry(1, 0),
- new DictionaryEntry(1, 1),
- };
+ {
+ new DictionaryEntry(5, 4),
+ new DictionaryEntry(5, 5),
+ new DictionaryEntry(3, 2),
+ new DictionaryEntry(3, 3),
+ new DictionaryEntry(1, 0),
+ new DictionaryEntry(1, 1),
+ };
ICollection resultList = CollectionUtils.StableSort(entries, new CollectionUtils.CompareCallback(CompareEntries));
DictionaryEntry[] resultEntries = (DictionaryEntry[]) CollectionUtils.ToArray(resultList, typeof(DictionaryEntry));
@@ -398,19 +408,19 @@ public void StableSorting()
private int CompareEntries(object x, object y)
{
- DictionaryEntry dex = (DictionaryEntry)x;
- DictionaryEntry dey = (DictionaryEntry)y;
+ DictionaryEntry dex = (DictionaryEntry) x;
+ DictionaryEntry dey = (DictionaryEntry) y;
- return ((int)dex.Key).CompareTo(dey.Key);
+ return ((int) dex.Key).CompareTo(dey.Key);
}
[Test]
public void FindFirstMatchReturnsNullIfAnyInputIsEmpty()
{
- Assert.IsNull( CollectionUtils.FindFirstMatch(null, null) );
- Assert.IsNull( CollectionUtils.FindFirstMatch(new string[0], new string[0]));
- Assert.IsNull( CollectionUtils.FindFirstMatch(null, new string[] { "x" }));
- Assert.IsNull( CollectionUtils.FindFirstMatch(new string[] { "x" }, null));
+ Assert.IsNull(CollectionUtils.FindFirstMatch(null, null));
+ Assert.IsNull(CollectionUtils.FindFirstMatch(new string[0], new string[0]));
+ Assert.IsNull(CollectionUtils.FindFirstMatch(null, new string[] {"x"}));
+ Assert.IsNull(CollectionUtils.FindFirstMatch(new string[] {"x"}, null));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/ConfigXmlDocumentTests.cs b/test/Spring/Spring.Core.Tests/Util/ConfigXmlDocumentTests.cs
index 68bd6378d..07afba548 100644
--- a/test/Spring/Spring.Core.Tests/Util/ConfigXmlDocumentTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/ConfigXmlDocumentTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.IO;
using System.Xml;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Util/DefensiveEventRaiserTests.cs b/test/Spring/Spring.Core.Tests/Util/DefensiveEventRaiserTests.cs
index 9f35e2f27..605e4488d 100644
--- a/test/Spring/Spring.Core.Tests/Util/DefensiveEventRaiserTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/DefensiveEventRaiserTests.cs
@@ -21,7 +21,7 @@
#region Imports
using System;
-using System.Collections;
+
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Util/DelegateInfoTests.cs b/test/Spring/Spring.Core.Tests/Util/DelegateInfoTests.cs
index 41b61c87b..bc833c73f 100644
--- a/test/Spring/Spring.Core.Tests/Util/DelegateInfoTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/DelegateInfoTests.cs
@@ -42,10 +42,9 @@ public void Instantiation()
}
[Test]
- [ExpectedException(typeof (ArgumentException))]
public void InstantiationWithBadType()
{
- new DelegateInfo(typeof (string));
+ Assert.Throws(() => new DelegateInfo(typeof (string)));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/EventRaiserTests.cs b/test/Spring/Spring.Core.Tests/Util/EventRaiserTests.cs
index a2cacfac9..7b9f21d59 100644
--- a/test/Spring/Spring.Core.Tests/Util/EventRaiserTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/EventRaiserTests.cs
@@ -21,7 +21,7 @@
#region Imports
using System;
-using System.Collections;
+using System.Reflection;
using NUnit.Framework;
#endregion
@@ -46,13 +46,12 @@ public void Raise ()
}
[Test]
- [ExpectedException (typeof (System.Reflection.TargetParameterCountException))]
public void RaiseWithBadNumberOfArguments ()
{
OneThirstyDude dude = new OneThirstyDude ();
Soda bru = new Soda ();
bru.Pop += new PopHandler (dude.HandlePop);
- bru.OnPopWithBadNumberOfArguments ("Iron Brew", new EventRaiser ());
+ Assert.Throws(() => bru.OnPopWithBadNumberOfArguments ("Iron Brew", new EventRaiser ()));
}
[Test]
@@ -65,13 +64,12 @@ public void RaiseWithNullEvent ()
Assert.AreEqual (string.Empty, dude.Soda);
}
- [Test][ExpectedException (typeof (FormatException), ExpectedMessage="Iron Brew")]
public void RaiseWithAnEventHandlerThatThrowsAnException ()
{
OneThirstyDude dude = new OneThirstyDude ();
Soda bru = new Soda ();
bru.Pop += new PopHandler (dude.HandlePopWithException);
- bru.OnPop ("Iron Brew", new EventRaiser ());
+ Assert.Throws(() => bru.OnPop ("Iron Brew", new EventRaiser ()), "Iron Brew");
}
}
diff --git a/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs
index 553a82201..056f9d68c 100644
--- a/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/NumberUtilsTests.cs
@@ -111,17 +111,15 @@ public void IsZero()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void NegateNull()
{
- NumberUtils.Negate(null);
+ Assert.Throws(() => NumberUtils.Negate(null));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void NegateString()
{
- NumberUtils.Negate(string.Empty);
+ Assert.Throws(() => NumberUtils.Negate(string.Empty));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/ObjectUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/ObjectUtilsTests.cs
index 863b312fc..48f332f2a 100644
--- a/test/Spring/Spring.Core.Tests/Util/ObjectUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/ObjectUtilsTests.cs
@@ -101,10 +101,9 @@ public void IsAssignableAndNotTransparentProxyWithProxy()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void InstantiateTypeWithNullType()
{
- ObjectUtils.InstantiateType(null);
+ Assert.Throws(() => ObjectUtils.InstantiateType(null));
}
[Test]
@@ -131,10 +130,9 @@ public void InstantiateTypeThrowingWithinPublicConstructor()
}
[Test]
- [ExpectedException(typeof(FatalReflectionException))]
public void InstantiateTypeWithOpenGenericType()
{
- ObjectUtils.InstantiateType(typeof(Dictionary<,>));
+ Assert.Throws(() => ObjectUtils.InstantiateType(typeof(Dictionary<,>)));
}
[Test]
@@ -144,24 +142,21 @@ public void InstantiateGenericTypeWithArguments()
}
[Test]
- [ExpectedException(typeof(FatalReflectionException))]
public void InstantiateTypeWithAbstractType()
{
- ObjectUtils.InstantiateType(typeof (AbstractType));
+ Assert.Throws(() => ObjectUtils.InstantiateType(typeof (AbstractType)));
}
[Test]
- [ExpectedException(typeof(FatalReflectionException))]
public void InstantiateTypeWithInterfaceType()
{
- ObjectUtils.InstantiateType(typeof (IList));
+ Assert.Throws(() => ObjectUtils.InstantiateType(typeof (IList)));
}
[Test]
- [ExpectedException(typeof(FatalReflectionException))]
public void InstantiateTypeWithTypeExposingNoZeroArgCtor()
{
- ObjectUtils.InstantiateType(typeof(NoZeroArgConstructorType));
+ Assert.Throws(() => ObjectUtils.InstantiateType(typeof(NoZeroArgConstructorType)));
}
[Test]
@@ -177,10 +172,9 @@ public void InstantiateTypeWithPrivateCtor()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void InstantiateTypeWithNullCtor()
{
- ObjectUtils.InstantiateType(typeof(IList).GetConstructor(Type.EmptyTypes), new object[] { });
+ Assert.Throws(() => ObjectUtils.InstantiateType(typeof(IList).GetConstructor(Type.EmptyTypes), new object[] { }));
}
[Test]
@@ -272,45 +266,37 @@ public void EnumerateElementAtIndexViaIEnumerable()
}
[Test]
- [ExpectedException(typeof (ArgumentOutOfRangeException))]
public void EnumerateElementAtOutOfRangeIndex()
{
string expected = "Mmm...";
IList list = new string[] {"Aw!", "Man!", expected};
IEnumerator enumerator = list.GetEnumerator();
- object actual = ObjectUtils.EnumerateElementAtIndex(enumerator, 12);
- Assert.AreEqual(expected, actual);
+ Assert.Throws(() => ObjectUtils.EnumerateElementAtIndex(enumerator, 12));
}
[Test]
- [ExpectedException(typeof (ArgumentOutOfRangeException))]
public void EnumerateElementAtOutOfRangeIndexViaIEnumerable()
{
string expected = "Mmm...";
IList list = new string[] {"Aw!", "Man!", expected};
- object actual = ObjectUtils.EnumerateElementAtIndex(list, 12);
- Assert.AreEqual(expected, actual);
+ Assert.Throws(() => ObjectUtils.EnumerateElementAtIndex(list, 12));
}
[Test]
- [ExpectedException(typeof (ArgumentOutOfRangeException))]
public void EnumerateElementAtNegativeIndex()
{
string expected = "Mmm...";
IList list = new string[] {"Aw!", "Man!", expected};
IEnumerator enumerator = list.GetEnumerator();
- object actual = ObjectUtils.EnumerateElementAtIndex(enumerator, -10);
- Assert.AreEqual(expected, actual);
+ Assert.Throws(() => ObjectUtils.EnumerateElementAtIndex(enumerator, -10));
}
[Test]
- [ExpectedException(typeof (ArgumentOutOfRangeException))]
public void EnumerateElementAtNegativeIndexViaIEnumerable()
{
string expected = "Mmm...";
IList list = new string[] {"Aw!", "Man!", expected};
- object actual = ObjectUtils.EnumerateElementAtIndex(list, -10);
- Assert.AreEqual(expected, actual);
+ Assert.Throws(() => ObjectUtils.EnumerateElementAtIndex(list, -10));
}
#region Helper Classes
diff --git a/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsMemberwiseCopyTests.cs b/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsMemberwiseCopyTests.cs
index bc8d12185..000cbc67a 100644
--- a/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsMemberwiseCopyTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsMemberwiseCopyTests.cs
@@ -1,6 +1,4 @@
using System;
-using System.Security;
-using System.Security.Permissions;
using System.Threading;
using System.Web;
using NUnit.Framework;
@@ -25,10 +23,9 @@ public void TestSameType()
}
[Test]
- [ExpectedException(typeof (ArgumentException), ExpectedMessage="object types are not related")]
public void DifferentTypesForbidden()
{
- ReflectionUtils.MemberwiseCopy("test", 2);
+ Assert.Throws(() => ReflectionUtils.MemberwiseCopy("test", 2), "object types are not related");
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsTests.cs
index e8b35cc2c..b0ee62ced 100644
--- a/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsTests.cs
@@ -25,7 +25,6 @@
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
-using System.Runtime.InteropServices;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
@@ -279,31 +278,27 @@ public void GetParameterTypes()
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void GetParameterTypesWithNullMethodInfo()
{
- ReflectionUtils.GetParameterTypes((MethodInfo)null);
+ Assert.Throws(() => ReflectionUtils.GetParameterTypes((MethodInfo) null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void GetParameterTypesWithNullParametersArgs()
{
- ReflectionUtils.GetParameterTypes((ParameterInfo[])null);
+ Assert.Throws(() => ReflectionUtils.GetParameterTypes((ParameterInfo[]) null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void GetMatchingMethodsWithNullTypeToFindOn()
{
- ReflectionUtils.GetMatchingMethods(null, new MethodInfo[] { }, true);
+ Assert.Throws(() => ReflectionUtils.GetMatchingMethods(null, new MethodInfo[] { }, true));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void GetMatchingMethodsWithNullMethodsToFind()
{
- ReflectionUtils.GetMatchingMethods(GetType(), null, true);
+ Assert.Throws(() => ReflectionUtils.GetMatchingMethods(GetType(), null, true));
}
[Test]
@@ -315,12 +310,11 @@ public void GetMatchingMethodsWithPerfectMatch()
}
[Test]
- [ExpectedException(typeof(Exception))]
public void GetMatchingMethodsWithBadMatchStrict()
{
// lets include a protected method that ain't declared on the ReflectionUtilsObject class...
MethodInfo[] clonesMethods = typeof(ReflectionUtilsObjectClone).GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly | BindingFlags.Instance);
- ReflectionUtils.GetMatchingMethods(typeof(ReflectionUtilsObject), clonesMethods, true);
+ Assert.Throws(() => ReflectionUtils.GetMatchingMethods(typeof(ReflectionUtilsObject), clonesMethods, true));
}
[Test]
@@ -334,12 +328,11 @@ public void GetMatchingMethodsWithBadMatchNotStrict()
}
[Test]
- [ExpectedException(typeof(Exception))]
public void GetMatchingMethodsWithBadReturnTypeMatchStrict()
{
// lets include a method that return type is different...
MethodInfo[] clonesMethods = typeof(ReflectionUtilsObjectBadClone).GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);
- ReflectionUtils.GetMatchingMethods(typeof(ReflectionUtilsObject), clonesMethods, true);
+ Assert.Throws(() => ReflectionUtils.GetMatchingMethods(typeof(ReflectionUtilsObject), clonesMethods, true));
}
[Test]
@@ -401,19 +394,17 @@ public void MethodIsOnOneOfTheseInterfaces()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void MethodIsOnOneOfTheseInterfacesWithNonInterfaceType()
{
MethodInfo method = typeof(ReflectionUtilsObject).GetMethod("Spanglish");
- Assert.IsFalse(ReflectionUtils.MethodIsOnOneOfTheseInterfaces(method, new Type[] { GetType() }));
+ Assert.Throws(() => ReflectionUtils.MethodIsOnOneOfTheseInterfaces(method, new Type[] { GetType() }));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void MethodIsOnOneOfTheseInterfacesWithNullMethod()
{
MethodInfo method = null;
- Assert.IsFalse(ReflectionUtils.MethodIsOnOneOfTheseInterfaces(method, new Type[] { GetType() }));
+ Assert.Throws(() => ReflectionUtils.MethodIsOnOneOfTheseInterfaces(method, new Type[] { GetType() }));
}
[Test]
@@ -433,10 +424,9 @@ public void MethodIsOnOneOfTheseInterfacesMultiple()
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void ParameterTypesMatchWithNullArgs()
{
- ReflectionUtils.ParameterTypesMatch(null, null);
+ Assert.Throws(() => ReflectionUtils.ParameterTypesMatch(null, null));
}
[Test]
@@ -465,13 +455,11 @@ public void ToInterfaceArrayFromType()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void ToInterfaceArrayFromTypeWithNonInterface()
{
- ReflectionUtils.ToInterfaceArray(typeof(ExplicitFoo));
+ Assert.Throws(() => ReflectionUtils.ToInterfaceArray(typeof(ExplicitFoo)));
}
-
[Test]
public void GetMethod()
{
@@ -503,18 +491,15 @@ public void GetMethodIsCaseInsensitive()
}
[Test]
- [ExpectedException(typeof(ArgumentException),
- ExpectedMessage = "[Spring.Util.ReflectionUtilsTests] does not derive from the [System.Attribute] class.")]
public void CreateCustomAttributeForNonAttributeType()
{
- ReflectionUtils.CreateCustomAttribute(GetType());
+ Assert.Throws(() => ReflectionUtils.CreateCustomAttribute(GetType()), "[Spring.Util.ReflectionUtilsTests] does not derive from the [System.Attribute] class.");
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void CreateCustomAttributeWithNullType()
{
- ReflectionUtils.CreateCustomAttribute((Type)null);
+ Assert.Throws(() => ReflectionUtils.CreateCustomAttribute((Type) null));
}
[Test]
@@ -826,10 +811,9 @@ public void HasAtLeastOneMethodWithName()
}
[Test]
- [ExpectedException(typeof(NullReferenceException))]
public void GetTypeOfOrTypeWithNull()
{
- ReflectionUtils.TypeOfOrType(null);
+ Assert.Throws(() => ReflectionUtils.TypeOfOrType(null));
}
[Test]
@@ -875,10 +859,9 @@ public void GetTypesWithNullArrayArgument()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void GetDefaultValueWithZeroValueEnumType()
{
- ReflectionUtils.GetDefaultValue(typeof(EnumWithNoValues));
+ Assert.Throws(() => ReflectionUtils.GetDefaultValue(typeof(EnumWithNoValues)));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/SerializationTestUtils.cs b/test/Spring/Spring.Core.Tests/Util/SerializationTestUtils.cs
index 0b5c4005c..3df2b5fbc 100644
--- a/test/Spring/Spring.Core.Tests/Util/SerializationTestUtils.cs
+++ b/test/Spring/Spring.Core.Tests/Util/SerializationTestUtils.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
@@ -43,13 +42,12 @@ namespace Spring.Util
public sealed class SerializationTestUtils
{
[Test]
- [ExpectedException(typeof (SerializationException))]
public void WithNonSerializableObject()
{
TestObject o = new TestObject();
Assert.IsFalse(o is ISerializable);
Assert.IsFalse(IsSerializable(o));
- TrySerialization(o);
+ Assert.Throws(() => TrySerialization(o));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/StringUtilsTests.cs b/test/Spring/Spring.Core.Tests/Util/StringUtilsTests.cs
index f0a36836c..3bfd40969 100644
--- a/test/Spring/Spring.Core.Tests/Util/StringUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/StringUtilsTests.cs
@@ -283,10 +283,9 @@ private static void CheckGetAntExpressions(IList actual, params string[]
}
[Test]
- [ExpectedException(typeof (FormatException))]
public void GetAntExpressionsIgnoresEmptyExpression()
{
- StringUtils.GetAntExpressions("This is an empty expression ${}...");
+ Assert.Throws(() => StringUtils.GetAntExpressions("This is an empty expression ${}..."));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Util/UniqueKeyTests.cs b/test/Spring/Spring.Core.Tests/Util/UniqueKeyTests.cs
index 2282cc438..c992fa687 100644
--- a/test/Spring/Spring.Core.Tests/Util/UniqueKeyTests.cs
+++ b/test/Spring/Spring.Core.Tests/Util/UniqueKeyTests.cs
@@ -38,11 +38,10 @@ private class TestObject
{}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void MustNotCallObjectSignatureWithType()
{
Type myType = typeof(TestObject);
- UniqueKey.GetInstanceScopedString( (object)myType, "PartialKey");
+ Assert.Throws(() => UniqueKey.GetInstanceScopedString( (object)myType, "PartialKey"));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Validation/Actions/ErrorMessageActionTests.cs b/test/Spring/Spring.Core.Tests/Validation/Actions/ErrorMessageActionTests.cs
index fc7e65ea6..d674b5a06 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Actions/ErrorMessageActionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Actions/ErrorMessageActionTests.cs
@@ -35,38 +35,33 @@ namespace Spring.Validation.Actions
public class ErrorMessageActionTests
{
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void WithNullMesageId()
{
- new ErrorMessageAction(null, "errors");
+ Assert.Throws(() => new ErrorMessageAction(null, "errors"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void WithEmptyMesageId()
{
- new ErrorMessageAction("", "errors");
+ Assert.Throws(() => new ErrorMessageAction("", "errors"));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void WithWhitespaceMesageId()
{
- new ErrorMessageAction("\t ", "errors");
+ Assert.Throws(() => new ErrorMessageAction("\t ", "errors"));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithNullProviders()
{
- new ErrorMessageAction("error", null);
+ Assert.Throws(() => new ErrorMessageAction("error", null));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithEmptyProviders()
{
- new ErrorMessageAction("error", new string[0]);
+ Assert.Throws(() => new ErrorMessageAction("error", new string[0]));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Validation/Actions/ExceptionActionTests.cs b/test/Spring/Spring.Core.Tests/Validation/Actions/ExceptionActionTests.cs
index fbc9eb1d6..92c65b9e9 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Actions/ExceptionActionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Actions/ExceptionActionTests.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Validation/Actions/ExpressionActionTests.cs b/test/Spring/Spring.Core.Tests/Validation/Actions/ExpressionActionTests.cs
index c645ed96f..300b60ce9 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Actions/ExpressionActionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Actions/ExpressionActionTests.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Validation/AnyValidatorGroupTests.cs b/test/Spring/Spring.Core.Tests/Validation/AnyValidatorGroupTests.cs
index 6f2269805..8709106a4 100644
--- a/test/Spring/Spring.Core.Tests/Validation/AnyValidatorGroupTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/AnyValidatorGroupTests.cs
@@ -21,7 +21,7 @@
#region Imports
using NUnit.Framework;
-using Rhino.Mocks;
+
using Spring.Expressions;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Validation/CollectionValidatorTests.cs b/test/Spring/Spring.Core.Tests/Validation/CollectionValidatorTests.cs
index f66b87a1b..e928479d4 100644
--- a/test/Spring/Spring.Core.Tests/Validation/CollectionValidatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/CollectionValidatorTests.cs
@@ -99,7 +99,6 @@ public void TestDifferentCollectionTypes()
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestWithWrongArgumentType()
{
RequiredValidator req = new RequiredValidator("Name", "true");
@@ -107,9 +106,9 @@ public void TestWithWrongArgumentType()
validator.Validators.Add(req);
TestObject tObj = new TestObject("Damjan Tomic", 24);
-
+
//This should cause the ArgumentException because tObj is not a Collection
- Assert.IsTrue(validator.Validate(tObj, new ValidationErrors()));
+ Assert.Throws(() => validator.Validate(tObj, new ValidationErrors()));
}
[Test]
@@ -137,12 +136,11 @@ public void TestValidationErrorsAreCollected()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void TestWithNull()
{
CollectionValidator validator = new CollectionValidator();
//This should cause the ArgumentException because we passed null into Validate method
- Assert.IsTrue(validator.Validate(null, new ValidationErrors()));
+ Assert.Throws(() => validator.Validate(null, new ValidationErrors()));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Validation/HelperClasses.cs b/test/Spring/Spring.Core.Tests/Validation/HelperClasses.cs
index fc7200aae..d535bac56 100644
--- a/test/Spring/Spring.Core.Tests/Validation/HelperClasses.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/HelperClasses.cs
@@ -19,7 +19,6 @@
#endregion
using System;
-using System.Collections;
using System.Collections.Generic;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
diff --git a/test/Spring/Spring.Core.Tests/Validation/ValidationErrorsTests.cs b/test/Spring/Spring.Core.Tests/Validation/ValidationErrorsTests.cs
index 6115599de..a5db2b78a 100644
--- a/test/Spring/Spring.Core.Tests/Validation/ValidationErrorsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/ValidationErrorsTests.cs
@@ -21,7 +21,6 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
@@ -62,18 +61,16 @@ public void ContainsNoErrorsDirectlyAfterInstantiation()
}
[Test]
- [ExpectedException(typeof (ArgumentNullException))]
public void AddErrorWithNullMessage()
{
- new ValidationErrors().AddError(GoodErrorKey, null);
+ Assert.Throws(() => new ValidationErrors().AddError(GoodErrorKey, null));
}
[Test]
- [ExpectedException(typeof(ArgumentNullException))]
public void AddErrorWithNullKey()
{
IValidationErrors errors = new ValidationErrors();
- errors.AddError(null, ErrorMessageOne);
+ Assert.Throws(() => errors.AddError(null, ErrorMessageOne));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Validation/ValidationNamespaceParserTests.cs b/test/Spring/Spring.Core.Tests/Validation/ValidationNamespaceParserTests.cs
index f93826a99..62dfcdde8 100644
--- a/test/Spring/Spring.Core.Tests/Validation/ValidationNamespaceParserTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/ValidationNamespaceParserTests.cs
@@ -21,14 +21,14 @@
#region Imports
using System.Collections.Generic;
-using System.IO;
using System.Xml;
+
using NUnit.Framework;
+
using Spring.Core.IO;
using Spring.Objects;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
-using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
using Spring.Validation.Actions;
using Spring.Validation.Config;
@@ -142,7 +142,6 @@ private XmlDocument GetValidatedXmlResource(string resourceExtension)
}
[Test]
- [ExpectedException(typeof(ObjectDefinitionStoreException))]
public void WhenConfigFileIsNotValid()
{
// const string xml = @"
@@ -163,13 +162,16 @@ public void WhenConfigFileIsNotValid()
ParserContext parserContext = new ParserContext(helper);
ValidationNamespaceParser parser = new ValidationNamespaceParser();
- foreach (XmlElement element in doc.DocumentElement.ChildNodes)
+ Assert.Throws(() =>
{
- if (element.NamespaceURI == "http://www.springframework.net/validation")
+ foreach (XmlElement element in doc.DocumentElement.ChildNodes)
{
- parser.ParseElement(element, parserContext);
+ if (element.NamespaceURI == "http://www.springframework.net/validation")
+ {
+ parser.ParseElement(element, parserContext);
+ }
}
- }
+ });
}
}
}
\ No newline at end of file
diff --git a/test/Spring/Spring.Core.Tests/Validation/ValidatorGroupTests.cs b/test/Spring/Spring.Core.Tests/Validation/ValidatorGroupTests.cs
index dab960052..f259f6926 100644
--- a/test/Spring/Spring.Core.Tests/Validation/ValidatorGroupTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/ValidatorGroupTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Validation/Validators/ConditionValidatorTests.cs b/test/Spring/Spring.Core.Tests/Validation/Validators/ConditionValidatorTests.cs
index 368063097..91cc42a94 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Validators/ConditionValidatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Validators/ConditionValidatorTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Core.Tests/Validation/Validators/CreditCardValidatorTests.cs b/test/Spring/Spring.Core.Tests/Validation/Validators/CreditCardValidatorTests.cs
index 8459fe6d8..14e99d8d4 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Validators/CreditCardValidatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Validators/CreditCardValidatorTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Validation/Validators/EmailValidatorTests.cs b/test/Spring/Spring.Core.Tests/Validation/Validators/EmailValidatorTests.cs
index 1981c5872..4a9f789c4 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Validators/EmailValidatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Validators/EmailValidatorTests.cs
@@ -20,15 +20,8 @@
#region Imports
-using System;
-using System.Collections;
-using System.Text.RegularExpressions;
using NUnit.Framework;
-using Spring.Context.Support;
-using Spring.Expressions;
-using Spring.Validation.Actions;
-
#endregion
namespace Spring.Validation.Validators
diff --git a/test/Spring/Spring.Core.Tests/Validation/Validators/ISBNValidatorTests.cs b/test/Spring/Spring.Core.Tests/Validation/Validators/ISBNValidatorTests.cs
index 902b89fde..fe91c5f28 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Validators/ISBNValidatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Validators/ISBNValidatorTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using NUnit.Framework;
#endregion
diff --git a/test/Spring/Spring.Core.Tests/Validation/Validators/Integration/CreditCardValidatorIntegrationTests.cs b/test/Spring/Spring.Core.Tests/Validation/Validators/Integration/CreditCardValidatorIntegrationTests.cs
index 151309ec2..80c474a72 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Validators/Integration/CreditCardValidatorIntegrationTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Validators/Integration/CreditCardValidatorIntegrationTests.cs
@@ -65,7 +65,6 @@ public void CreditCardValidatorTests()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithNullCardType()
{
const string xml = @"
@@ -84,7 +83,7 @@ public void WithNullCardType()
Assert.IsTrue(obj is CreditCardValidator);
CreditCardValidator validator = obj as CreditCardValidator;
Assert.IsNull(validator.CardType);
- Assert.IsTrue(validator.Validate("378282246310005", new ValidationErrors()));
+ Assert.Throws(() => validator.Validate("378282246310005", new ValidationErrors()));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Validation/Validators/RegularExpressionValidatorTests.cs b/test/Spring/Spring.Core.Tests/Validation/Validators/RegularExpressionValidatorTests.cs
index d5b2ab90f..8571fd4b8 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Validators/RegularExpressionValidatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Validators/RegularExpressionValidatorTests.cs
@@ -39,19 +39,17 @@ namespace Spring.Validation.Validators
public sealed class RegularExpressionValidatorTests
{
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithNonString()
{
RegularExpressionValidator validator = new RegularExpressionValidator();
- validator.Validate(this, new ValidationErrors());
+ Assert.Throws(() => validator.Validate(this, new ValidationErrors()));
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void WithNull()
{
RegularExpressionValidator validator = new RegularExpressionValidator();
- validator.Validate(null, new ValidationErrors());
+ Assert.Throws(() => validator.Validate(null, new ValidationErrors()));
}
[Test]
diff --git a/test/Spring/Spring.Core.Tests/Validation/Validators/UrlValidatorTests.cs b/test/Spring/Spring.Core.Tests/Validation/Validators/UrlValidatorTests.cs
index 53f59cde4..ad108186b 100644
--- a/test/Spring/Spring.Core.Tests/Validation/Validators/UrlValidatorTests.cs
+++ b/test/Spring/Spring.Core.Tests/Validation/Validators/UrlValidatorTests.cs
@@ -20,15 +20,8 @@
#region Imports
-using System;
-using System.Collections;
-using System.Text.RegularExpressions;
using NUnit.Framework;
-using Spring.Context.Support;
-using Spring.Expressions;
-using Spring.Validation.Actions;
-
#endregion
namespace Spring.Validation.Validators
diff --git a/test/Spring/Spring.Core.Tests/packages.config b/test/Spring/Spring.Core.Tests/packages.config
index 9e2afc91b..52407b923 100644
--- a/test/Spring/Spring.Core.Tests/packages.config
+++ b/test/Spring/Spring.Core.Tests/packages.config
@@ -2,5 +2,5 @@
-
+
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/AccountDebitDao.cs b/test/Spring/Spring.Data.Integration.Tests/Data/AccountDebitDao.cs
index 16e26a82c..b31365060 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/AccountDebitDao.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/AccountDebitDao.cs
@@ -1,7 +1,6 @@
using System;
using System.Data;
using Spring.Data.Core;
-using Spring.Data.Support;
namespace Spring.Data
{
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/AccountManager.cs b/test/Spring/Spring.Data.Integration.Tests/Data/AccountManager.cs
index 7de83921c..8f115db08 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/AccountManager.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/AccountManager.cs
@@ -1,6 +1,3 @@
-
-using System;
-using System.Data;
using Spring.Transaction.Interceptor;
namespace Spring.Data
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/AdoDaoTests.cs b/test/Spring/Spring.Data.Integration.Tests/Data/AdoDaoTests.cs
index cdf1fce89..94ded6b06 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/AdoDaoTests.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/AdoDaoTests.cs
@@ -1,8 +1,6 @@
-using System;
using NUnit.Framework;
using Spring.Context;
using Spring.Context.Support;
-using Spring.Dao;
using Spring.Objects;
using Spring.Testing.NUnit;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/AdoTemplatePerformanceTests.cs b/test/Spring/Spring.Data.Integration.Tests/Data/AdoTemplatePerformanceTests.cs
index 5211e51be..639415763 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/AdoTemplatePerformanceTests.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/AdoTemplatePerformanceTests.cs
@@ -30,7 +30,6 @@
using Spring.Context.Support;
using Spring.Data.Core;
using Spring.Reflection.Dynamic;
-using Spring.Transaction;
using Spring.Transaction.Support;
using Spring.Util;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/CallCreateTestObject.cs b/test/Spring/Spring.Data.Integration.Tests/Data/CallCreateTestObject.cs
index bbeb5adb6..a80ca0ccf 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/CallCreateTestObject.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/CallCreateTestObject.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-using System.Collections;
using Spring.Data.Common;
using Spring.Data.Objects;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/ConsoleLoggingAroundAdvice.cs b/test/Spring/Spring.Data.Integration.Tests/Data/ConsoleLoggingAroundAdvice.cs
index 63b1aaf4e..f87e86002 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/ConsoleLoggingAroundAdvice.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/ConsoleLoggingAroundAdvice.cs
@@ -1,4 +1,3 @@
-using System;
using AopAlliance.Intercept;
using Common.Logging;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/CreateTestObjectNonQuery.cs b/test/Spring/Spring.Data.Integration.Tests/Data/CreateTestObjectNonQuery.cs
index 0d025f10a..58392e95d 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/CreateTestObjectNonQuery.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/CreateTestObjectNonQuery.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-using System.Collections;
using System.Data;
using Spring.Data.Common;
using Spring.Data.Objects;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/DTCTests.cs b/test/Spring/Spring.Data.Integration.Tests/Data/DTCTests.cs
index b37b29ef4..e3dc35401 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/DTCTests.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/DTCTests.cs
@@ -23,13 +23,11 @@
using System;
using System.Collections.Specialized;
using NUnit.Framework;
-using Spring.Aop.Config;
+
using Spring.Context;
using Spring.Context.Support;
using Common.Logging;
using Common.Logging.Simple;
-using Spring.Objects.Factory.Xml;
-using Spring.Transaction.Config;
#endregion
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/MappingAdoQueryTests.cs b/test/Spring/Spring.Data.Integration.Tests/Data/MappingAdoQueryTests.cs
index eec9bcb1c..9a8461a4b 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/MappingAdoQueryTests.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/MappingAdoQueryTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using Common.Logging;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/NativeAdoTests.cs b/test/Spring/Spring.Data.Integration.Tests/Data/NativeAdoTests.cs
index 35cfee396..1fbc92104 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/NativeAdoTests.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/NativeAdoTests.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Data;
using System.Data.SqlClient;
using NUnit.Framework;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/AdoTemplateShipperDao.cs b/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/AdoTemplateShipperDao.cs
index d6e1bae86..52481409e 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/AdoTemplateShipperDao.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/AdoTemplateShipperDao.cs
@@ -24,7 +24,6 @@
using System.Data;
using Spring.Data.Common;
using Spring.Data.Core;
-using Spring.Data.Support;
#endregion
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/IShipperDao.cs b/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/IShipperDao.cs
index ecb77f5c2..27bb87b93 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/IShipperDao.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/IShipperDao.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/Shipper.cs b/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/Shipper.cs
index e2772d958..db7f2e24e 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/Shipper.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/Northwind/Shipper.cs
@@ -20,7 +20,7 @@
#region Imports
-using System;
+
#endregion
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountCreditDao.cs b/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountCreditDao.cs
index d351a87ab..8c745d04a 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountCreditDao.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountCreditDao.cs
@@ -1,7 +1,6 @@
using System;
using System.Data;
using Spring.Data.Core;
-using Spring.Data.Support;
namespace Spring.Data
{
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountDebitDao.cs b/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountDebitDao.cs
index 2b1d9502f..3dbe7ad1e 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountDebitDao.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/SimpleAccountDebitDao.cs
@@ -1,7 +1,6 @@
using System;
using System.Data;
using Spring.Data.Core;
-using Spring.Data.Support;
namespace Spring.Data
{
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectDao.cs b/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectDao.cs
index d5729c132..3dd1b7553 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectDao.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectDao.cs
@@ -3,7 +3,6 @@
using System.Data;
using Spring.Data.Common;
using Spring.Data.Core;
-using Spring.Data.Support;
using Spring.Objects;
namespace Spring.Data
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectManager.cs b/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectManager.cs
index 7c7a75544..34b73238a 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectManager.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectManager.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using Common.Logging;
using Spring.Objects;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectStoredProcedure.cs b/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectStoredProcedure.cs
index 76ee2ba60..8a0b4fa5a 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectStoredProcedure.cs
+++ b/test/Spring/Spring.Data.Integration.Tests/Data/TestObjectStoredProcedure.cs
@@ -20,7 +20,6 @@
#region Imports
-using System;
using System.Collections;
using Spring.Data.Common;
using Spring.Data.Objects;
diff --git a/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj b/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj
index c4466cc0e..ff61f6ab0 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj
+++ b/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2010.csproj
@@ -30,7 +30,6 @@
..\..\..\
- true
..\..\..\build\VS.Net.2010\Spring.Data.Integration.Tests\Debug\
@@ -86,9 +85,9 @@
False
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
System
@@ -216,5 +215,5 @@
-
-
\ No newline at end of file
+
+
diff --git a/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.build b/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.build
index be72ab09d..eaaef5d97 100644
--- a/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.build
+++ b/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.build
@@ -55,7 +55,7 @@
-
+
diff --git a/test/Spring/Spring.Data.Integration.Tests/packages.config b/test/Spring/Spring.Data.Integration.Tests/packages.config
index 9e2afc91b..52407b923 100644
--- a/test/Spring/Spring.Data.Integration.Tests/packages.config
+++ b/test/Spring/Spring.Data.Integration.Tests/packages.config
@@ -2,5 +2,5 @@
-
+
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AccountController.cs b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AccountController.cs
index 6c656d4eb..0e73f7d03 100644
--- a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AccountController.cs
+++ b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AccountController.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Spring.Data.NHibernate
{
public class AccountController : IAccountController
diff --git a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AuditDao.cs b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AuditDao.cs
index 50fb5656b..5392e82a9 100644
--- a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AuditDao.cs
+++ b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/AuditDao.cs
@@ -1,7 +1,6 @@
using System.Data;
using log4net;
using Spring.Data.Core;
-using Spring.Data.Support;
namespace Spring.Data.NHibernate
{
diff --git a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/Bytecode/AbstractInjectableUserTypeFixture.cs b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/Bytecode/AbstractInjectableUserTypeFixture.cs
index fcf507427..ea55e8917 100644
--- a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/Bytecode/AbstractInjectableUserTypeFixture.cs
+++ b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/Bytecode/AbstractInjectableUserTypeFixture.cs
@@ -35,7 +35,7 @@ static AbstractInjectableUserTypeFixture()
protected abstract IBytecodeProvider GetBytecodeProvider();
[Ignore("Work in progress")]
- [TestFixtureSetUp]
+ [OneTimeSetUp]
public void CreateDb()
{
InitializeServiceLocator();
@@ -49,7 +49,7 @@ public void CreateDb()
}
[Ignore("Work in progress")]
- [TestFixtureTearDown]
+ [OneTimeTearDown]
public void CloseSessionFactory()
{
if (sessions != null)
diff --git a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/NativeNHTests.cs b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/NativeNHTests.cs
index 8493a4a2c..c67af0968 100644
--- a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/NativeNHTests.cs
+++ b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/NativeNHTests.cs
@@ -20,14 +20,9 @@
#region Imports
-using System;
-using System.Reflection;
-using NHibernate;
using NUnit.Framework;
using Spring.Context;
using Spring.Context.Support;
-using Spring.Objects;
-using Spring.Util;
#endregion
diff --git a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/DelegatingLocalSessionFactoryObjectTests.cs b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/DelegatingLocalSessionFactoryObjectTests.cs
index 3bf2c47df..ca17de8ce 100644
--- a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/DelegatingLocalSessionFactoryObjectTests.cs
+++ b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/DelegatingLocalSessionFactoryObjectTests.cs
@@ -1,18 +1,20 @@
-using System;
-using NUnit.Framework;
+using NUnit.Framework;
+
using NhCfg = NHibernate.Cfg;
-using NHibernate;
-using System.Collections;
+
+using System.Collections.Generic;
+
using Spring.Data.Common;
+
using NHibernate.Dialect;
+
using Spring.Context.Support;
+
using NHibernate.Connection;
using NHibernate.Driver;
-using Spring.Data.NHibernate.Bytecode;
namespace Spring.Data.NHibernate
{
-
[TestFixture]
public class DelegatingLocalSessionFactoryObjectTests
{
@@ -25,7 +27,7 @@ public void CanSetConfigurationAndProperties()
lsfo.DbProvider = dbProvider;
lsfo.ApplicationContext = new StaticApplicationContext();
- IDictionary properties = new Hashtable();
+ IDictionary properties = new Dictionary();
properties.Add(NhCfg.Environment.Dialect, typeof(MsSql2000Dialect).AssemblyQualifiedName);
properties.Add(NhCfg.Environment.ConnectionDriver, typeof(SqlClientDriver).AssemblyQualifiedName);
properties.Add(NhCfg.Environment.ConnectionProvider, typeof(DriverConnectionProvider).AssemblyQualifiedName);
@@ -39,11 +41,6 @@ public void CanSetConfigurationAndProperties()
Assert.AreEqual(lsfo.Configuration.Properties[NhCfg.Environment.ConnectionProvider], typeof(DriverConnectionProvider).AssemblyQualifiedName);
Assert.AreEqual(lsfo.Configuration.Properties[NhCfg.Environment.ConnectionDriver], typeof(SqlClientDriver).AssemblyQualifiedName);
Assert.AreEqual(lsfo.Configuration.Properties[NhCfg.Environment.Dialect], typeof(MsSql2000Dialect).AssemblyQualifiedName);
-
- Assert.AreEqual(lsfo.Configuration.Properties[NhCfg.Environment.ProxyFactoryFactoryClass], typeof(ProxyFactoryFactory).AssemblyQualifiedName);
-
}
-
}
-
-}
+}
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/ISimpleService.cs b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/ISimpleService.cs
index 99ef989b7..abe927929 100644
--- a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/ISimpleService.cs
+++ b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/ISimpleService.cs
@@ -3,8 +3,6 @@
* Created: Monday, July 16, 2007
*/
-using Spring.Objects;
-
namespace Spring.Data.NHibernate
{
public interface ISimpleService
diff --git a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/LocalSessionFactoryObjectTests.cs b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/LocalSessionFactoryObjectTests.cs
index 4f6de1461..0b9da7095 100644
--- a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/LocalSessionFactoryObjectTests.cs
+++ b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/LocalSessionFactoryObjectTests.cs
@@ -18,7 +18,6 @@
#endregion
-using System.Collections;
using System.Collections.Generic;
using System.IO;
@@ -79,17 +78,15 @@ public void LocalSessionFactoryObjectWithDbProviderAndProperties()
}
[Test]
- [ExpectedException(typeof(FileNotFoundException))]
public void LocalSessionFactoryObjectWithInvalidMapping()
{
LocalSessionFactoryObject sfo = new LocalSessionFactoryObject();
sfo.MappingResources = new string[] { "mapping.hbm.xml" };
- sfo.AfterPropertiesSet();
+ Assert.Throws(() => sfo.AfterPropertiesSet());
}
[Test]
- [ExpectedException(typeof(HibernateException))]
public void LocalSessionFactoryObjectWithInvalidProperties()
{
LocalSessionFactoryObject sfo = new LocalSessionFactoryObject();
@@ -97,7 +94,7 @@ public void LocalSessionFactoryObjectWithInvalidProperties()
properties.Add(Environment.Dialect, typeof(MsSql2000Dialect).AssemblyQualifiedName);
properties.Add(Environment.ConnectionProvider, "myClass");
sfo.HibernateProperties = properties;
- sfo.AfterPropertiesSet();
+ Assert.Throws(() => sfo.AfterPropertiesSet());
}
}
}
diff --git a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs
index 46b72a438..fe1d51557 100644
--- a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs
+++ b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs
@@ -20,12 +20,8 @@
#region Imports
-using System.Collections;
-using System.Data;
using System.Data.SqlClient;
-using System.IO;
-using NHibernate;
-using NHibernate.Cfg;
+
using NHibernate.Connection;
using NHibernate.Driver;
using NHibernate.Engine;
@@ -47,17 +43,16 @@ namespace Spring.Data.NHibernate
[TestFixture]
public class SessionFactoryUtilsTests
{
-#if !NET_1_1
[Test]
public void SessionFactoryUtilsWithGetDbProvider()
{
MockRepository mockery = new MockRepository();
- ISessionFactoryImplementor sessionFactory = (ISessionFactoryImplementor) mockery.CreateMultiMock(typeof(ISessionFactory), typeof(ISessionFactoryImplementor));
+ ISessionFactoryImplementor sessionFactory = mockery.DynamicMock();
- IDriver driver = (IDriver)mockery.DynamicMock(typeof(IDriver));
+ DriverBase driver = mockery.DynamicMock();
Expect.Call(driver.CreateCommand()).Repeat.AtLeastOnce().Return(new SqlCommand());
- IConnectionProvider cp = (IConnectionProvider) mockery.DynamicMock(typeof (IConnectionProvider));
+ IConnectionProvider cp = mockery.DynamicMock();
Expect.Call(cp.Driver).Repeat.AtLeastOnce().Return(driver);
Expect.Call(sessionFactory.ConnectionProvider).Repeat.AtLeastOnce().Return(cp);
@@ -66,11 +61,8 @@ public void SessionFactoryUtilsWithGetDbProvider()
IDbProvider provider = SessionFactoryUtils.GetDbProvider(sessionFactory);
Assert.AreEqual(typeof(SqlCommand), provider.DbMetadata.CommandType);
-
+
mockery.VerifyAll();
}
-#endif
}
-
-
-}
+}
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/ConfigSectionSessionScopeSettingsTests.cs b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/ConfigSectionSessionScopeSettingsTests.cs
index 423f5c037..1fa33ad8e 100644
--- a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/ConfigSectionSessionScopeSettingsTests.cs
+++ b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/ConfigSectionSessionScopeSettingsTests.cs
@@ -20,8 +20,6 @@
#region Imports
-using System;
-using System.Collections.Specialized;
using NHibernate;
using NUnit.Framework;
using Rhino.Mocks;
diff --git a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeSettingsTests.cs b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeSettingsTests.cs
index 8dbf0c999..b28c2f773 100644
--- a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeSettingsTests.cs
+++ b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeSettingsTests.cs
@@ -129,7 +129,6 @@ public void CallingDefaultConstructorCausesLazyResolvingReferences()
}
[Test]
- [ExpectedException(typeof(ArgumentException))]
public void MissingSessionFactoryCausesArgumentExceptionDuringLazyResolving()
{
SessionScopeSettings sss = new LazyResolvingSessionScopeSettings(null, null);
@@ -138,7 +137,8 @@ public void MissingSessionFactoryCausesArgumentExceptionDuringLazyResolving()
Assert.AreEqual(SessionScopeSettings.SINGLESESSION_DEFAULT, sss.SingleSession);
Assert.AreEqual(SessionScopeSettings.FLUSHMODE_DEFAULT, sss.DefaultFlushMode);
- ISessionFactory sessionFactory = sss.SessionFactory;
+ ISessionFactory temp;
+ Assert.Throws(() => temp = sss.SessionFactory);
}
[Test]
diff --git a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeTests.cs b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeTests.cs
index c20cdd290..3f410c7dc 100644
--- a/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeTests.cs
+++ b/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeTests.cs
@@ -103,13 +103,15 @@ public void CanCreateAndCloseSimpleCtor()
}
[Test]
- [ExpectedException(typeof(InvalidOperationException))]
public void OpeningTwiceThrowsInvalidOperationException()
{
- using (SessionScope scope = new SessionScope(expectedSessionFactory, true))
+ Assert.Throws(() =>
{
- scope.Open();
- }
+ using (SessionScope scope = new SessionScope(expectedSessionFactory, true))
+ {
+ scope.Open();
+ }
+ });
}
[Test]
diff --git a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj
index 86320d8d5..730cb1259 100644
--- a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj
+++ b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.2010.csproj
@@ -32,7 +32,6 @@
true
..\..\..\
- true
true
@@ -57,20 +56,20 @@
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
-
+
False
..\..\..\packages\Iesi.Collections.3.3.3.4001\lib\Net35\Iesi.Collections.dll
..\..\..\lib\Net\2.0\log4net.dll
-
+
False
..\..\..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
@@ -251,5 +250,5 @@
xcopy "$(ProjectDir)Data" ..\..\..\..\build\VS.Net.2010\Spring.Data.NHibernate3.Integration.Tests\$(ConfigurationName)\ /y /s /q /d
xcopy "$(ProjectDir)$(TargetFileName).config" ..\..\..\..\build\VS.Net.2010\Spring.Data.NHibernate3.Integration.Tests\$(ConfigurationName)\ /y /s /q
-
-
\ No newline at end of file
+
+
diff --git a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.build b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.build
index 4d8ec543e..371742f6a 100644
--- a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.build
+++ b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/Spring.Data.NHibernate3.Integration.Tests.build
@@ -45,10 +45,10 @@
-
-
+
+
-
+
diff --git a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/packages.config b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/packages.config
index 67ba57ed7..4cfa35a1c 100644
--- a/test/Spring/Spring.Data.NHibernate3.Integration.Tests/packages.config
+++ b/test/Spring/Spring.Data.NHibernate3.Integration.Tests/packages.config
@@ -4,5 +4,5 @@
-
+
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.2010.csproj b/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.2010.csproj
index 5cd8c60b7..b92916e1d 100644
--- a/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.2010.csproj
+++ b/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.2010.csproj
@@ -32,7 +32,6 @@
false
true
..\..\..\
- true
true
@@ -57,17 +56,17 @@
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
-
+
False
..\..\..\packages\Iesi.Collections.3.3.3.4001\lib\Net35\Iesi.Collections.dll
-
+
False
..\..\..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
False
@@ -81,6 +80,9 @@
Data\NHibernate\Config\AopConfiguration.cs
+
+ Data\NHibernate\DelegatingLocalSessionFactoryObjectTests.cs
+
Data\NHibernate\HibernateTransactionManagerTests.cs
@@ -96,6 +98,9 @@
Data\NHibernate\NHTestObjectDao.cs
+
+ Data\NHibernate\SessionFactoryUtilsTests.cs
+
Data\NHibernate\SimpleService.cs
@@ -185,5 +190,4 @@
xcopy "$(ProjectDir)Data" ..\..\..\..\build\VS.Net.2010\Spring.Data.NHibernate3.Tests\$(ConfigurationName)\ /y /s /q /d
xcopy "$(ProjectDir)$(TargetFileName).config" ..\..\..\..\build\VS.Net.2010\Spring.Data.NHibernate3.Tests\$(ConfigurationName)\ /y /s /q
-
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.build b/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.build
index c1867d84c..b8561ce6c 100644
--- a/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.build
+++ b/test/Spring/Spring.Data.NHibernate3.Tests/Spring.Data.NHibernate3.Tests.build
@@ -29,7 +29,7 @@
-
+
@@ -44,13 +44,14 @@
-
+
+
-
-
+
+
-
+
diff --git a/test/Spring/Spring.Data.NHibernate3.Tests/packages.config b/test/Spring/Spring.Data.NHibernate3.Tests/packages.config
index 67ba57ed7..4cfa35a1c 100644
--- a/test/Spring/Spring.Data.NHibernate3.Tests/packages.config
+++ b/test/Spring/Spring.Data.NHibernate3.Tests/packages.config
@@ -4,5 +4,5 @@
-
+
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.2010.csproj b/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.2010.csproj
index 44a998ce0..d67003308 100644
--- a/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.2010.csproj
+++ b/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.2010.csproj
@@ -32,7 +32,6 @@
true
..\..\..\
- true
true
@@ -71,9 +70,9 @@
False
..\..\..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll
+ True
@@ -254,5 +253,5 @@
xcopy "$(ProjectDir)Data" ..\..\..\..\build\VS.Net.2010\Spring.Data.NHibernate4.Integration.Tests\$(ConfigurationName)\ /y /s /q /d
xcopy "$(ProjectDir)$(TargetFileName).config" ..\..\..\..\build\VS.Net.2010\Spring.Data.NHibernate4.Integration.Tests\$(ConfigurationName)\ /y /s /q
-
-
\ No newline at end of file
+
+
diff --git a/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.build b/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.build
index c90319566..61e5a901b 100644
--- a/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.build
+++ b/test/Spring/Spring.Data.NHibernate4.Integration.Tests/Spring.Data.NHibernate4.Integration.Tests.build
@@ -47,10 +47,10 @@
-
-
+
+
-
+
diff --git a/test/Spring/Spring.Data.NHibernate4.Integration.Tests/packages.config b/test/Spring/Spring.Data.NHibernate4.Integration.Tests/packages.config
index 7d7ec2a42..97e9322e0 100644
--- a/test/Spring/Spring.Data.NHibernate4.Integration.Tests/packages.config
+++ b/test/Spring/Spring.Data.NHibernate4.Integration.Tests/packages.config
@@ -4,5 +4,5 @@
-
+
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.build b/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.build
index 158771c87..d8d748da8 100644
--- a/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.build
+++ b/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.build
@@ -50,9 +50,9 @@
-
-
-
+
+
+
diff --git a/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.csproj b/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.csproj
index c329d3902..b7803ddd1 100644
--- a/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.csproj
+++ b/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.csproj
@@ -38,12 +38,17 @@
False
..\..\..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll
-
+
+ ..\..\..\packages\Iesi.Collections.4.0.1.4000\lib\net40\Iesi.Collections.dll
+ True
+
+
..\..\..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll
+ True
-
- False
- ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll
+
+ ..\..\..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll
+ True
@@ -93,6 +98,7 @@
+
diff --git a/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/packages.config b/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/packages.config
new file mode 100644
index 000000000..5fc574d32
--- /dev/null
+++ b/test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/packages.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/Spring/Spring.Data.NHibernate4.Tests/Data/NHibernate/Config/AopConfiguration.xml b/test/Spring/Spring.Data.NHibernate4.Tests/Data/NHibernate/Config/AopConfiguration.xml
index 91cde1ec7..231e84b4b 100644
--- a/test/Spring/Spring.Data.NHibernate4.Tests/Data/NHibernate/Config/AopConfiguration.xml
+++ b/test/Spring/Spring.Data.NHibernate4.Tests/Data/NHibernate/Config/AopConfiguration.xml
@@ -12,11 +12,11 @@
-