diff --git a/build/Common.targets b/build/Common.targets index 4e42999942..057ab456be 100644 --- a/build/Common.targets +++ b/build/Common.targets @@ -66,7 +66,7 @@ Targets For GenerateSource *********************************************************************************************** --> - @@ -93,13 +93,18 @@ Targets For GenerateSource Targets For Test *********************************************************************************************** --> - + + - + + + diff --git a/build/build.csproj b/build/build.csproj index bbc4392a93..6b8a0c22e8 100644 --- a/build/build.csproj +++ b/build/build.csproj @@ -41,8 +41,9 @@ $(LibDirectory)\protoc.exe $(BuildOutputDirectory)\ProtoGen\protogen.exe $(BuildTempDirectory)\ProtoBench.exe - $(LibDirectory)\NUnit 2.2.8.0\nunit-console.exe - $(LibDirectory)\NUnit 2.2.8.0\nunit-console.$(ForcedFrameworkVersion).config + $(LibDirectory)\NUnit\tools\nunit-console.exe + $(LibDirectory)\NUnit-config\nunit-console.$(ForcedFrameworkVersion).config + $(LibDirectory)\StatLight\tools\StatLight.exe $(LibDirectory)\7-Zip 9.20\7za.exe @@ -171,6 +172,10 @@ + + + + @@ -200,7 +205,7 @@ - + diff --git a/lib/NUnit 2.2.8.0/NUnitTests.nunit b/lib/NUnit 2.2.8.0/NUnitTests.nunit deleted file mode 100644 index cde7d0005c..0000000000 --- a/lib/NUnit 2.2.8.0/NUnitTests.nunit +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/lib/NUnit 2.2.8.0/TestResult.xml b/lib/NUnit 2.2.8.0/TestResult.xml deleted file mode 100644 index fbce2d972c..0000000000 --- a/lib/NUnit 2.2.8.0/TestResult.xml +++ /dev/null @@ -1,1301 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit 2.2.8.0/clr.bat b/lib/NUnit 2.2.8.0/clr.bat deleted file mode 100644 index 0a838482ca..0000000000 --- a/lib/NUnit 2.2.8.0/clr.bat +++ /dev/null @@ -1,96 +0,0 @@ -@echo off -rem Run a program under a particular version of the .Net framework -rem by setting the COMPLUS_Version environment variable. -rem -rem This command was written by Charlie Poole for the NUnit project. -rem You may use it separately from NUnit at your own risk. - -if "%1"=="/?" goto help -if "%1"=="?" goto help -if "%1"=="" goto GetVersion -if /I "%1"=="off" goto RemoveVersion -if "%2"=="" goto SetVersion -goto main - -:help -echo Control the version of the .Net framework that is used. The -echo command has several forms: -echo. -echo CLR -echo Reports the version of the CLR that has been set -echo. -echo CLR version -echo Sets the local shell environment to use a specific -echo version of the CLR for subsequent commands. -echo. -echo CLR version command [arguments] -echo Executes a single command using the specified CLR version. -echo. -echo CLR off -echo Turns off specific version selection for commands -echo. -echo The CLR version may be specified as vn.n.n or n.n.n. In addition, -echo the following shortcuts are recognized: -echo net-1.0, 1.0 For version 1.0.3705 -echo net-1.1, 1.1 For version 1.1.4322 -echo beta2 For version 2.0.50215 -echo net-2.0, 2.0 For version 2.0.50727 -echo. -echo NOTE: -echo Any specific settings for required or supported runtime in -echo the ^ section of a program's config file will -echo override the version specified by this command, and the -echo command will have no effect. -echo. -goto done - -:main - -setlocal -set CMD= -call :SetVersion %1 -shift /1 - -:loop 'Copy remaining arguments to form the command -if "%1"=="" goto run -set CMD=%CMD% %1 -shift /1 -goto :loop - -:run 'Execute the command -%CMD% -endlocal -goto done - -:SetVersion -set COMPLUS_Version=%1 - -rem Substitute proper format for certain names -if /I "%COMPLUS_Version:~0,1%"=="v" goto useit -if /I "%COMPLUS_Version%"=="net-1.0" set COMPLUS_Version=v1.0.3705&goto report -if /I "%COMPLUS_Version%"=="1.0" set COMPLUS_Version=v1.0.3705&goto report -if /I "%COMPLUS_Version%"=="net-1.1" set COMPLUS_Version=v1.1.4322&goto report -if /I "%COMPLUS_Version%"=="1.1" set COMPLUS_Version=v1.1.4322&goto report -if /I "%COMPLUS_Version%"=="beta2" set COMPLUS_Version=v2.0.50215&goto report -if /I "%COMPLUS_Version%"=="net-2.0" set COMPLUS_Version=v2.0.50727&goto report -if /I "%COMPLUS_Version%"=="2.0" set COMPLUS_Version=v2.0.50727&goto report - -rem Add additional substitutions here, branching to report - -rem assume it's a version number without 'v' -set COMPLUS_Version=v%COMPLUS_Version% - -:report -echo Setting CLR version to %COMPLUS_Version% -goto done - -:GetVersion -if "%COMPLUS_Version%"=="" echo CLR version is not set -if NOT "%COMPLUS_Version%"=="" echo CLR version is set to %COMPLUS_Version% -goto done - -:RemoveVersion -set COMPLUS_Version= -echo CLR version is no longer set - -:done \ No newline at end of file diff --git a/lib/NUnit 2.2.8.0/mock-assembly.dll b/lib/NUnit 2.2.8.0/mock-assembly.dll deleted file mode 100644 index 574010aeef..0000000000 Binary files a/lib/NUnit 2.2.8.0/mock-assembly.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nonamespace-assembly.dll b/lib/NUnit 2.2.8.0/nonamespace-assembly.dll deleted file mode 100644 index 19a45ea347..0000000000 Binary files a/lib/NUnit 2.2.8.0/nonamespace-assembly.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/notestfixtures-assembly.dll b/lib/NUnit 2.2.8.0/notestfixtures-assembly.dll deleted file mode 100644 index e1b467e9ea..0000000000 Binary files a/lib/NUnit 2.2.8.0/notestfixtures-assembly.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-console-runner.dll b/lib/NUnit 2.2.8.0/nunit-console-runner.dll deleted file mode 100644 index 6a6b5e2eb8..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-console-runner.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-console.exe b/lib/NUnit 2.2.8.0/nunit-console.exe deleted file mode 100644 index 24fda7e4b5..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-console.exe and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-console.tests.dll b/lib/NUnit 2.2.8.0/nunit-console.tests.dll deleted file mode 100644 index 361ddb0fb2..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-console.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-gui-runner.dll b/lib/NUnit 2.2.8.0/nunit-gui-runner.dll deleted file mode 100644 index a6e1692d96..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-gui-runner.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-gui.exe b/lib/NUnit 2.2.8.0/nunit-gui.exe deleted file mode 100644 index 258f093c4c..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-gui.exe and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-gui.exe.config b/lib/NUnit 2.2.8.0/nunit-gui.exe.config deleted file mode 100644 index 3035c12e2c..0000000000 --- a/lib/NUnit 2.2.8.0/nunit-gui.exe.config +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/NUnit 2.2.8.0/nunit-gui.tests.dll b/lib/NUnit 2.2.8.0/nunit-gui.tests.dll deleted file mode 100644 index 039bcf964a..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-gui.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-server.exe b/lib/NUnit 2.2.8.0/nunit-server.exe deleted file mode 100644 index e3d2c8ee55..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-server.exe and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-server.tests.dll b/lib/NUnit 2.2.8.0/nunit-server.tests.dll deleted file mode 100644 index 346563256b..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-server.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit-test-server.dll b/lib/NUnit 2.2.8.0/nunit-test-server.dll deleted file mode 100644 index 40c265a240..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit-test-server.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.core.dll b/lib/NUnit 2.2.8.0/nunit.core.dll deleted file mode 100644 index a11e62341e..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.core.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.core.extensions.dll b/lib/NUnit 2.2.8.0/nunit.core.extensions.dll deleted file mode 100644 index d37d58eec3..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.core.extensions.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.extensions.tests.dll b/lib/NUnit 2.2.8.0/nunit.extensions.tests.dll deleted file mode 100644 index 9dedfabb86..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.extensions.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.framework.dll b/lib/NUnit 2.2.8.0/nunit.framework.dll deleted file mode 100644 index 44704bd5ea..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.framework.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.framework.tests.dll b/lib/NUnit 2.2.8.0/nunit.framework.tests.dll deleted file mode 100644 index 28b168ad44..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.framework.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.mocks.dll b/lib/NUnit 2.2.8.0/nunit.mocks.dll deleted file mode 100644 index 99c4282a09..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.mocks.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.mocks.tests.dll b/lib/NUnit 2.2.8.0/nunit.mocks.tests.dll deleted file mode 100644 index 84bd3ed444..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.mocks.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.uikit.dll b/lib/NUnit 2.2.8.0/nunit.uikit.dll deleted file mode 100644 index 32673ccc74..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.uikit.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.uikit.tests.dll b/lib/NUnit 2.2.8.0/nunit.uikit.tests.dll deleted file mode 100644 index 40e6ddfc47..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.uikit.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.util.dll b/lib/NUnit 2.2.8.0/nunit.util.dll deleted file mode 100644 index 8fff811dfd..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.util.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/nunit.util.tests.dll b/lib/NUnit 2.2.8.0/nunit.util.tests.dll deleted file mode 100644 index 57efc06e22..0000000000 Binary files a/lib/NUnit 2.2.8.0/nunit.util.tests.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/test-utilities.dll b/lib/NUnit 2.2.8.0/test-utilities.dll deleted file mode 100644 index 24a0f5d1c6..0000000000 Binary files a/lib/NUnit 2.2.8.0/test-utilities.dll and /dev/null differ diff --git a/lib/NUnit 2.2.8.0/timing-tests.dll b/lib/NUnit 2.2.8.0/timing-tests.dll deleted file mode 100644 index 45930da35e..0000000000 Binary files a/lib/NUnit 2.2.8.0/timing-tests.dll and /dev/null differ diff --git a/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs b/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs new file mode 100644 index 0000000000..d526c48930 --- /dev/null +++ b/lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs @@ -0,0 +1,53 @@ + +using System; + +namespace Microsoft.VisualStudio.TestTools.UnitTesting +{ + [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] + public sealed class TestClassAttribute : NUnit.Framework.TestFixtureAttribute + { + } + + [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] + public sealed class TestMethodAttribute : NUnit.Framework.TestAttribute + { + } + + [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] + public sealed class TestInitializeAttribute : NUnit.Framework.SetUpAttribute + { + } + + [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] + public sealed class IgnoreAttribute : NUnit.Framework.IgnoreAttribute + { + } + + [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)] + public sealed class ExpectedExceptionAttribute : NUnit.Framework.ExpectedExceptionAttribute + { + public ExpectedExceptionAttribute(Type type) : base(type) + { } + } + + public class Assert : NUnit.Framework.Assert + { + [Obsolete("Do not use AreEqual on Byte[], use TestUtil.AssertBytesEqual(,)")] + public static void AreEqual(byte[] b1, byte[] b2) + { + NUnit.Framework.Assert.AreEqual(b1, b2); + } + + [Obsolete("No not use assert with miss-matched types.")] + public static new void AreEqual(object b1, object b2) + { + NUnit.Framework.Assert.AreEqual(b1, b2); + } + + //Allowed if the types match + public static void AreEqual(T b1, T b2) + { + NUnit.Framework.Assert.AreEqual(b1, b2); + } + } +} \ No newline at end of file diff --git a/lib/NUnit-config/nunit-console.v2.0.config b/lib/NUnit-config/nunit-console.v2.0.config new file mode 100644 index 0000000000..30453c9b85 --- /dev/null +++ b/lib/NUnit-config/nunit-console.v2.0.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit-config/nunit-console.v3.5.config b/lib/NUnit-config/nunit-console.v3.5.config new file mode 100644 index 0000000000..30453c9b85 --- /dev/null +++ b/lib/NUnit-config/nunit-console.v3.5.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit-config/nunit-console.v4.0.config b/lib/NUnit-config/nunit-console.v4.0.config new file mode 100644 index 0000000000..08ee954714 --- /dev/null +++ b/lib/NUnit-config/nunit-console.v4.0.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/Logo.ico b/lib/NUnit/Logo.ico new file mode 100644 index 0000000000..13c4ff9d5b Binary files /dev/null and b/lib/NUnit/Logo.ico differ diff --git a/lib/NUnit/NUnit.nupkg b/lib/NUnit/NUnit.nupkg new file mode 100644 index 0000000000..7e9a7773f5 Binary files /dev/null and b/lib/NUnit/NUnit.nupkg differ diff --git a/lib/NUnit/NUnitFitTests.html b/lib/NUnit/NUnitFitTests.html new file mode 100644 index 0000000000..b7eb5c9117 --- /dev/null +++ b/lib/NUnit/NUnitFitTests.html @@ -0,0 +1,277 @@ + + + +

NUnit Acceptance Tests

+

+ Developers love self-referential programs! Hence, NUnit has always run all it's + own tests, even those that are not really unit tests. +

Now, beginning with NUnit 2.4, NUnit has top-level tests using Ward Cunningham's + FIT framework. At this time, the tests are pretty rudimentary, but it's a start + and it's a framework for doing more. +

Running the Tests

+

Open a console or shell window and navigate to the NUnit bin directory, which + contains this file. To run the test under Microsoft .Net, enter the command +

    runFile NUnitFitTests.html TestResults.html .
+ To run it under Mono, enter +
    mono runFile.exe NUnitFitTests.html TestResults.html .
+ Note the space and dot at the end of each command. The results of your test + will be in TestResults.html in the same directory. +

Platform and CLR Version

+ + + + +
NUnit.Fixtures.PlatformInfo
+

Verify Unit Tests

+

+ Load and run the NUnit unit tests, verifying that the results are as expected. + When these tests are run on different platforms, different numbers of tests may + be skipped, so the values for Skipped and Run tests are informational only. +

+ The number of tests in each assembly should be constant across all platforms - + any discrepancy usually means that one of the test source files was not + compiled on the platform. There should be no failures and no tests ignored. +

Note: + At the moment, the nunit.extensions.tests assembly is failing because the + fixture doesn't initialize addins in the test domain. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NUnit.Fixtures.AssemblyRunner
AssemblyTests()Run()Skipped()Ignored()Failures()
nunit.framework.tests.dll397  00
nunit.core.tests.dll355  00
nunit.util.tests.dll238  00
nunit.mocks.tests.dll43  00
nunit.extensions.tests.dll5  00
nunit-console.tests.dll40  00
nunit.uikit.tests.dll34  00
nunit-gui.tests.dll15  00
nunit.fixtures.tests.dll6  00
+

Code Snippet Tests

+

+ These tests create a test assembly from a snippet of code and then load and run + the tests that it contains, verifying that the structure of the loaded tests is + as expected and that the number of tests run, skipped, ignored or failed is + correct. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NUnit.Fixtures.SnippetRunner
CodeTree()Run()Skipped()Ignored()Failures()
public class TestClass
+{
+}
+
EMPTY0000
using NUnit.Framework;
+
+[TestFixture]
+public class TestClass
+{
+}
+
TestClass0000
using NUnit.Framework;
+
+[TestFixture]
+public class TestClass
+{
+    [Test]
+    public void T1() { }
+    [Test]
+    public void T2() { }
+    [Test]
+    public void T3() { }
+}
+
TestClass
+>T1
+>T2
+>T3
+
3000
using NUnit.Framework;
+
+[TestFixture]
+public class TestClass1
+{
+    [Test]
+    public void T1() { }
+}
+
+[TestFixture]
+public class TestClass2
+{
+    [Test]
+    public void T2() { }
+    [Test]
+    public void T3() { }
+}
+
TestClass1
+>T1
+TestClass2
+>T2
+>T3
+
3000
using NUnit.Framework;
+
+[TestFixture]
+public class TestClass
+{
+    [Test]
+    public void T1() { }
+    [Test, Ignore]
+    public void T2() { }
+    [Test]
+    public void T3() { }
+}
+
TestClass
+>T1
+>T2
+>T3
+
2010
using NUnit.Framework;
+
+[TestFixture]
+public class TestClass
+{
+    [Test]
+    public void T1() { }
+    [Test, Explicit]
+    public void T2() { }
+    [Test]
+    public void T3() { }
+}
+
TestClass
+>T1
+>T2
+>T3
+
2100
+

Summary Information

+ + + + +
fit.Summary
+ + diff --git a/lib/NUnit/fit-license.txt b/lib/NUnit/fit-license.txt new file mode 100644 index 0000000000..af375329e9 --- /dev/null +++ b/lib/NUnit/fit-license.txt @@ -0,0 +1,342 @@ + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file diff --git a/lib/NUnit/lib/nunit.framework.dll b/lib/NUnit/lib/nunit.framework.dll new file mode 100644 index 0000000000..6856e51ef0 Binary files /dev/null and b/lib/NUnit/lib/nunit.framework.dll differ diff --git a/lib/NUnit/lib/nunit.framework.xml b/lib/NUnit/lib/nunit.framework.xml new file mode 100644 index 0000000000..c98e5adcc5 --- /dev/null +++ b/lib/NUnit/lib/nunit.framework.xml @@ -0,0 +1,10407 @@ + + + + nunit.framework + + + + + Attribute used to apply a category to a test + + + + + The name of the category + + + + + Construct attribute for a given category based on + a name. The name may not contain the characters ',', + '+', '-' or '!'. However, this is not checked in the + constructor since it would cause an error to arise at + as the test was loaded without giving a clear indication + of where the problem is located. The error is handled + in NUnitFramework.cs by marking the test as not + runnable. + + The name of the category + + + + Protected constructor uses the Type name as the name + of the category. + + + + + The name of the category + + + + + Used to mark a field for use as a datapoint when executing a theory + within the same fixture that requires an argument of the field's Type. + + + + + Used to mark an array as containing a set of datapoints to be used + executing a theory within the same fixture that requires an argument + of the Type of the array elements. + + + + + Attribute used to provide descriptive text about a + test case or fixture. + + + + + Construct the attribute + + Text describing the test + + + + Gets the test description + + + + + Enumeration indicating how the expected message parameter is to be used + + + + Expect an exact match + + + Expect a message containing the parameter string + + + Match the regular expression provided as a parameter + + + Expect a message that starts with the parameter string + + + + ExpectedExceptionAttribute + + + + + + Constructor for a non-specific exception + + + + + Constructor for a given type of exception + + The type of the expected exception + + + + Constructor for a given exception name + + The full name of the expected exception + + + + Gets or sets the expected exception type + + + + + Gets or sets the full Type name of the expected exception + + + + + Gets or sets the expected message text + + + + + Gets or sets the user message displayed in case of failure + + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets the name of a method to be used as an exception handler + + + + + ExplicitAttribute marks a test or test fixture so that it will + only be run if explicitly executed from the gui or command line + or if it is included by use of a filter. The test will not be + run simply because an enclosing suite is run. + + + + + Default constructor + + + + + Constructor with a reason + + The reason test is marked explicit + + + + The reason test is marked explicit + + + + + Attribute used to mark a test that is to be ignored. + Ignored tests result in a warning message when the + tests are run. + + + + + Constructs the attribute without giving a reason + for ignoring the test. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The reason for ignoring a test + + + + + Abstract base for Attributes that are used to include tests + in the test run based on environmental settings. + + + + + Constructor with no included items specified, for use + with named property syntax. + + + + + Constructor taking one or more included items + + Comma-delimited list of included items + + + + Name of the item that is needed in order for + a test to run. Multiple itemss may be given, + separated by a comma. + + + + + Name of the item to be excluded. Multiple items + may be given, separated by a comma. + + + + + The reason for including or excluding the test + + + + + PlatformAttribute is used to mark a test fixture or an + individual method as applying to a particular platform only. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-deliminted list of platforms + + + + CultureAttribute is used to mark a test fixture or an + individual method as applying to a particular Culture only. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-deliminted list of cultures + + + + Marks a test to use a combinatorial join of any argument data + provided. NUnit will create a test case for every combination of + the arguments provided. This can result in a large number of test + cases and so should be used judiciously. This is the default join + type, so the attribute need not be used except as documentation. + + + + + PropertyAttribute is used to attach information to a test as a name/value pair.. + + + + + Construct a PropertyAttribute with a name and string value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and int value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and double value + + The name of the property + The property value + + + + Constructor for derived classes that set the + property dictionary directly. + + + + + Constructor for use by derived classes that use the + name of the type as the property name. Derived classes + must ensure that the Type of the property value is + a standard type supported by the BCL. Any custom + types will cause a serialization Exception when + in the client. + + + + + Gets the property dictionary for this attribute + + + + + Default constructor + + + + + Marks a test to use pairwise join of any argument data provided. + NUnit will attempt too excercise every pair of argument values at + least once, using as small a number of test cases as it can. With + only two arguments, this is the same as a combinatorial join. + + + + + Default constructor + + + + + Marks a test to use a sequential join of any argument data + provided. NUnit will use arguements for each parameter in + sequence, generating test cases up to the largest number + of argument values provided and using null for any arguments + for which it runs out of values. Normally, this should be + used with the same number of arguments for each parameter. + + + + + Default constructor + + + + + Summary description for MaxTimeAttribute. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + RandomAttribute is used to supply a set of random values + to a single parameter of a parameterized test. + + + + + ValuesAttribute is used to provide literal arguments for + an individual parameter of a test. + + + + + Abstract base class for attributes that apply to parameters + and supply data for the parameter. + + + + + Gets the data to be provided to the specified parameter + + + + + The collection of data to be returned. Must + be set by any derived attribute classes. + We use an object[] so that the individual + elements may have their type changed in GetData + if necessary. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Get the collection of values to be used as arguments + + + + + Construct a set of doubles from 0.0 to 1.0, + specifying only the count. + + + + + + Construct a set of doubles from min to max + + + + + + + + Construct a set of ints from min to max + + + + + + + + Get the collection of values to be used as arguments + + + + + RangeAttribute is used to supply a range of values to an + individual parameter of a parameterized test. + + + + + Construct a range of ints using default step of 1 + + + + + + + Construct a range of ints specifying the step size + + + + + + + + Construct a range of longs + + + + + + + + Construct a range of doubles + + + + + + + + Construct a range of floats + + + + + + + + RepeatAttribute may be applied to test case in order + to run it multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + RequiredAddinAttribute may be used to indicate the names of any addins + that must be present in order to run some or all of the tests in an + assembly. If the addin is not loaded, the entire assembly is marked + as NotRunnable. + + + + + Initializes a new instance of the class. + + The required addin. + + + + Gets the name of required addin. + + The required addin name. + + + + Summary description for SetCultureAttribute. + + + + + Construct given the name of a culture + + + + + + Summary description for SetUICultureAttribute. + + + + + Construct given the name of a culture + + + + + + Attribute used to mark a class that contains one-time SetUp + and/or TearDown methods that apply to all the tests in a + namespace or an assembly. + + + + + SetUpFixtureAttribute is used to identify a SetUpFixture + + + + + Attribute used to mark a static (shared in VB) property + that returns a list of tests. + + + + + Attribute used to identify a method that is called + immediately after each test is run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + TestCaseAttribute is used to mark parameterized test cases + and provide them with their arguments. + + + + + The ITestCaseData interface is implemented by a class + that is able to return complete testcases for use by + a parameterized test method. + + NOTE: This interface is used in both the framework + and the core, even though that results in two different + types. However, sharing the source code guarantees that + the various implementations will be compatible and that + the core is able to reflect successfully over the + framework implementations of ITestCaseData. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Construct a TestCaseAttribute with a list of arguments. + This constructor is not CLS-Compliant + + + + + + Construct a TestCaseAttribute with a single argument + + + + + + Construct a TestCaseAttribute with a two arguments + + + + + + + Construct a TestCaseAttribute with a three arguments + + + + + + + + Gets the list of arguments to a test case + + + + + Gets or sets the expected result. + + The result. + + + + Gets a list of categories associated with this test; + + + + + Gets or sets the category associated with this test. + May be a single category or a comma-separated list. + + + + + Gets or sets the expected exception. + + The expected exception. + + + + Gets or sets the name the expected exception. + + The expected name of the exception. + + + + Gets or sets the expected message of the expected exception + + The expected message of the exception. + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets or sets the description. + + The description. + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the ignored status of the test + + + + + Gets or sets the ignored status of the test + + + + + Gets the ignore reason. + + The ignore reason. + + + + FactoryAttribute indicates the source to be used to + provide test cases for a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + An array of the names of the factories that will provide data + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + [TestFixture] + public class ExampleClass + {} + + + + + Default constructor + + + + + Construct with a object[] representing a set of arguments. + In .NET 2.0, the arguments may later be separated into + type arguments and constructor arguments. + + + + + + Descriptive text for this fixture + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Gets a list of categories for this fixture + + + + + The arguments originally provided to the attribute + + + + + Gets or sets a value indicating whether this should be ignored. + + true if ignore; otherwise, false. + + + + Gets or sets the ignore reason. May set Ignored as a side effect. + + The ignore reason. + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Attribute used to identify a method that is + called before any tests in a fixture are run. + + + + + Attribute used to identify a method that is called after + all the tests in a fixture have run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + WUsed on a method, marks the test with a timeout value in milliseconds. + The test will be run in a separate thread and is cancelled if the timeout + is exceeded. Used on a method or assembly, sets the default timeout + for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Marks a test that must run in the STA, causing it + to run in a separate thread if necessary. + + On methods, you may also use STAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresSTAAttribute + + + + + Marks a test that must run in the MTA, causing it + to run in a separate thread if necessary. + + On methods, you may also use MTAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresMTAAttribute + + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + ValueSourceAttribute indicates the source to be used to + provide data for one parameter of a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + The name of the data source to be used + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + The IConstraintExpression interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + Static UnsetObject used to detect derived constraints + failing to set the actual value. + + + + + The actual value being tested against a constraint + + + + + The display name of this Constraint for use by ToString() + + + + + Argument fields used by ToString(); + + + + + The builder holding this constraint + + + + + Construct a constraint with no arguments + + + + + Construct a constraint with one argument + + + + + Construct a constraint with two arguments + + + + + Sets the ConstraintBuilder holding this constraint + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the constraint and the actual value to the writer, which + then displays the constraint description and the value. + + Constraints that need to provide additional details, + such as where the error occured can override this. + + The MessageWriter on which to display the message + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the constraint is satisfied by an + ActualValueDelegate that returns the value to be tested. + The default implementation simply evaluates the delegate + but derived classes may override it to provide for delayed + processing. + + An ActualValueDelegate + True for success, false for failure + + + + Test whether the constraint is satisfied by a given reference. + The default implementation simply dereferences the value but + derived classes may override it to provide for delayed processing. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Default override of ToString returns the constraint DisplayName + followed by any arguments within angle brackets. + + + + + + Returns the string representation of this constraint + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if the + argument constraint is not satisfied. + + + + + Returns a DelayedConstraint with the specified delay time. + + The delay in milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + The display name of this Constraint for use by ToString(). + The default value is the name of the constraint with + trailing "Constraint" removed. Derived classes may set + this to another name in their constructors. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending Or + to the current constraint. + + + + + Class used to detect any derived constraints + that fail to set the actual value in their + Matches override. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + Writes the description of the constraint to the specified writer + + + + + AttributeConstraint tests that a specified attribute is present + on a Type or other provider and that the value of the attribute + satisfies some other constraint. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Construct given a base constraint + + + + + + Constructs an AttributeConstraint for a specified attriute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Writes a description of the attribute to the specified writer. + + + + + Writes the actual value supplied to the specified writer. + + + + + Returns a string representation of the constraint. + + + + + BasicConstraint is the abstract base for constraints that + perform a simple comparison to a constant value. + + + + + Initializes a new instance of the class. + + The expected. + The description. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + Test that the actual value is an NaN + + + + + + + Write the constraint description to a specified writer + + + + + + BinaryConstraint is the abstract base of all constraints + that combine two other constraints in some fashion. + + + + + The first constraint being combined + + + + + The second constraint being combined + + + + + Construct a BinaryConstraint from two other constraints + + The first constraint + The second constraint + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply both member constraints to an actual value, succeeding + succeeding only if both of them succeed. + + The actual value + True if the constraints both succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply the member constraints to an actual value, succeeding + succeeding as soon as one of them succeeds. + + The actual value + True if either constraint succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + CollectionConstraint is the abstract base class for + constraints that operate on collections. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Determines whether the specified enumerable is empty. + + The enumerable. + + true if the specified enumerable is empty; otherwise, false. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Protected method to be implemented by derived classes + + + + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + Flag the constraint to ignore case and return self. + + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + Check that the collection is empty + + + + + + + Write the constraint description to a MessageWriter + + + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + Check that all items are unique. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + Test whether the expected item is contained in the collection + + + + + + + Write a descripton of the constraint to a MessageWriter + + + + + + CollectionEquivalentCOnstraint is used to determine whether two + collections are equivalent. + + + + + Construct a CollectionEquivalentConstraint + + + + + + Test whether two collections are equivalent + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionSubsetConstraint is used to determine whether + one collection is a subset of another + + + + + Construct a CollectionSubsetConstraint + + The collection that the actual value is expected to be a subset of + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + Modifies the constraint to use an IComparer and returns self. + + + + + Modifies the constraint to use an IComparer<T> and returns self. + + + + + Modifies the constraint to use a Comparison<T> and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Test whether the collection is ordered + + + + + + + Write a description of the constraint to a MessageWriter + + + + + + Returns the string representation of the constraint. + + + + + + If used performs a reverse comparison + + + + + CollectionTally counts (tallies) the number of + occurences of each object in one or more enumerations. + + + + + Construct a CollectionTally object from a comparer and a collection + + + + + Try to remove an object from the tally + + The object to remove + True if successful, false if the object was not found + + + + Try to remove a set of objects from the tally + + The objects to remove + True if successful, false if any object was not found + + + + The number of objects remaining in the tally + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + IComparer, IComparer<T> or Comparison<T> + + + + + Returns a ComparisonAdapter that wraps an IComparer + + + + + Returns a ComparisonAdapter that wraps an IComparer<T> + + + + + Returns a ComparisonAdapter that wraps a Comparison<T> + + + + + Compares two objects + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Construct a ComparisonAdapter for an IComparer + + + + + Compares two objects + + + + + + + + Construct a default ComparisonAdapter + + + + + ComparisonAdapter<T> extends ComparisonAdapter and + allows use of an IComparer<T> or Comparison<T> + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an IComparer<T> + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a Comparison<T> + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + If true, less than returns success + + + + + if true, equal returns success + + + + + if true, greater than returns success + + + + + The predicate used as a part of the description + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + if set to true less succeeds. + if set to true equal succeeds. + if set to true greater succeeds. + String used in describing the constraint. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Modifies the constraint to use an IComparer and returns self + + + + + Modifies the constraint to use an IComparer<T> and returns self + + + + + Modifies the constraint to use a Comparison<T> and returns self + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + ConstraintBuilder maintains the stacks that are used in + processing a ConstraintExpression. An OperatorStack + is used to hold operators that are waiting for their + operands to be reognized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + Initializes a new instance of the class. + + + + + Appends the specified operator to the expression by first + reducing the operator stack and then pushing the new + operator on the stack. + + The operator to push. + + + + Appends the specified constraint to the expresson by pushing + it on the constraint stack. + + The constraint to push. + + + + Sets the top operator right context. + + The right context. + + + + Reduces the operator stack until the topmost item + precedence is greater than or equal to the target precedence. + + The target precedence. + + + + Resolves this instance, returning a Constraint. If the builder + is not currently in a resolvable state, an exception is thrown. + + The resolved constraint + + + + Gets a value indicating whether this instance is resolvable. + + + true if this instance is resolvable; otherwise, false. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified operator onto the stack. + + The op. + + + + Pops the topmost operator from the stack. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + The top. + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified constraint. As a side effect, + the constraint's builder field is set to the + ConstraintBuilder owning this stack. + + The constraint. + + + + Pops this topmost constrait from the stack. + As a side effect, the constraint's builder + field is set to null. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost constraint without modifying the stack. + + The topmost constraint + + + + ConstraintExpression represents a compound constraint in the + process of being constructed from a series of syntactic elements. + + Individual elements are appended to the expression as they are + reognized. Once an actual Constraint is appended, the expression + returns a resolvable Constraint. + + + + + ConstraintExpressionBase is the abstract base class for the + generated ConstraintExpression class, which represents a + compound constraint in the process of being constructed + from a series of syntactic elements. + + NOTE: ConstraintExpressionBase is aware of some of its + derived classes, which is an apparent violation of + encapsulation. Ideally, these classes would be a + single class, but they must be separated in order to + allow parts to be generated under .NET 1.x and to + provide proper user feedback in syntactically + aware IDEs. + + + + + The ConstraintBuilder holding the elements recognized so far + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a string representation of the expression as it + currently stands. This should only be used for testing, + since it has the side-effect of resolving the expression. + + + + + + Appends an operator to the expression and returns the + resulting expression itself. + + + + + Appends a self-resolving operator to the expression and + returns a new ResolvableConstraintExpression. + + + + + Appends a constraint to the expression and returns that + constraint, which is associated with the current state + of the expression being built. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + With is currently a NOP - reserved for future use. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The ConstraintOperator class is used internally by a + ConstraintBuilder to represent an operator that + modifies or combines constraints. + + Constraint operators use left and right precedence + values to determine whether the top operator on the + stack should be reduced before pushing a new operator. + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + The syntax element preceding this operator + + + + + The syntax element folowing this operator + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + PrefixOperator takes a single constraint and modifies + it's action in some way. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Returns the constraint created by applying this + prefix to another constraint. + + + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + Represents a constraint that succeeds if all the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + they all succeed. + + + + + Represents a constraint that succeeds if any of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + any of them succeed. + + + + + Represents a constraint that succeeds if none of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + none of them succeed. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifes the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + Operator used to test for the presence of a named Property + on an object and optionally apply further tests to the + value of that property. + + + + + Constructs a PropOperator for a particular named property + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Gets the name of the property to which the operator applies + + + + + Operator that tests for the presence of a particular attribute + on a type and optionally applies further tests to the attribute. + + + + + Construct an AttributeOperator for a particular Type + + The Type of attribute tested + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Operator that tests that an exception is thrown and + optionally applies further tests to the exception. + + + + + Construct a ThrowsOperator + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Abstract base class for all binary operators + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Operator that requires both it's arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + Operator that requires at least one of it's arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + ContainsConstraint tests a whether a string contains a substring + or a collection contains an object. It postpones the decision of + which test to use until the type of the actual argument is known. + This allows testing whether a string is contained in a collection + or as a substring of another string using the same syntax. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to ignore case and return self. + + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + If the value of is less than 0 + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + The time interval used for polling + If the value of is less than 0 + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a delegate + + The delegate whose value is to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a given reference. + Overridden to wait for the specified delay period before + calling the base constraint with the dereferenced value. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + EmptyConstraint tests a whether a string or collection is empty, + postponing the decision about which test is applied until the + type of the actual argument is known. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EqualConstraint is able to compare an actual value with the + expected value provided in its constructor. Two objects are + considered equal if both are null, or if both have the same + value. NUnit has special semantics for some object types. + + + + + If true, strings in error messages will be clipped + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Write description of this constraint + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to suppress string clipping + and return self. + + + + + Flag the constraint to compare arrays as collections + and return self. + + + + + Switches the .Within() modifier to interpret its tolerance as + a distance in representable values (see remarks). + + Self. + + Ulp stands for "unit in the last place" and describes the minimum + amount a given value can change. For any integers, an ulp is 1 whole + digit. For floating point values, the accuracy of which is better + for smaller numbers and worse for larger numbers, an ulp depends + on the size of the number. Using ulps for comparison of floating + point results instead of fixed tolerances is safer because it will + automatically compensate for the added inaccuracy of larger numbers. + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in days. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in hours. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in minutes. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in seconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in milliseconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in clock ticks. + + Self + + + + EqualityAdapter class handles all equality comparisons + that use an IEqualityComparer, IEqualityComparer<T> + or a ComparisonAdapter. + + + + + Compares two objects, returning true if they are equal + + + + + Returns an EqualityAdapter that wraps an IComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer<T>. + + + + + Returns an EqualityAdapter that wraps an IComparer<T>. + + + + + Returns an EqualityAdapter that wraps a Comparison<T>. + + + + Helper routines for working with floating point numbers + + + The floating point comparison code is based on this excellent article: + http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm + + + "ULP" means Unit in the Last Place and in the context of this library refers to + the distance between two adjacent floating point numbers. IEEE floating point + numbers can only represent a finite subset of natural numbers, with greater + accuracy for smaller numbers and lower accuracy for very large numbers. + + + If a comparison is allowed "2 ulps" of deviation, that means the values are + allowed to deviate by up to 2 adjacent floating point values, which might be + as low as 0.0000001 for small numbers or as high as 10.0 for large numbers. + + + + + Compares two floating point values for equality + First floating point value to be compared + Second floating point value t be compared + + Maximum number of representable floating point values that are allowed to + be between the left and the right floating point values + + True if both numbers are equal or close to being equal + + + Floating point values can only represent a finite subset of natural numbers. + For example, the values 2.00000000 and 2.00000024 can be stored in a float, + but nothing inbetween them. + + + This comparison will count how many possible floating point values are between + the left and the right number. If the number of possible values between both + numbers is less than or equal to maxUlps, then the numbers are considered as + being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + Compares two double precision floating point values for equality + First double precision floating point value to be compared + Second double precision floating point value t be compared + + Maximum number of representable double precision floating point values that are + allowed to be between the left and the right double precision floating point values + + True if both numbers are equal or close to being equal + + + Double precision floating point values can only represent a limited series of + natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 + can be stored in a double, but nothing inbetween them. + + + This comparison will count how many possible double precision floating point + values are between the left and the right number. If the number of possible + values between both numbers is less than or equal to maxUlps, then the numbers + are considered as being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + + Reinterprets the memory contents of a floating point value as an integer value + + + Floating point value whose memory contents to reinterpret + + + The memory contents of the floating point value interpreted as an integer + + + + + Reinterprets the memory contents of a double precision floating point + value as an integer value + + + Double precision floating point value whose memory contents to reinterpret + + + The memory contents of the double precision floating point value + interpreted as an integer + + + + + Reinterprets the memory contents of an integer as a floating point value + + Integer value whose memory contents to reinterpret + + The memory contents of the integer value interpreted as a floating point value + + + + + Reinterprets the memory contents of an integer value as a double precision + floating point value + + Integer whose memory contents to reinterpret + + The memory contents of the integer interpreted as a double precision + floating point value + + + + Union of a floating point variable and an integer + + + The union's value as a floating point variable + + + The union's value as an integer + + + The union's value as an unsigned integer + + + Union of a double precision floating point variable and a long + + + The union's value as a double precision floating point variable + + + The union's value as a long + + + The union's value as an unsigned long + + + + MessageWriter is the abstract base for classes that write + constraint descriptions and messages in some form. The + class has separate methods for writing various components + of a message, allowing implementations to tailor the + presentation as needed. + + + + + Construct a MessageWriter given a culture + + + + + Method to write single line message with optional args, usually + written to precede the general failure message. + + The message to be written + Any arguments used in formatting the message + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the Expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in locating the point where the strings differ + If true, the strings should be clipped to fit the line + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for a modifier + + The modifier. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Abstract method to get the max line length + + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Returns the representation of a type as used in NUnitLite. + This is the same as Type.ToString() except for arrays, + which are displayed with their declared sizes. + + + + + + + Converts any control characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + The Numerics class contains common operations on numeric values. + + + + + Checks the type of the object, returning true if + the object is a numeric type. + + The object to check + true if the object is a numeric type + + + + Checks the type of the object, returning true if + the object is a floating point numeric type. + + The object to check + true if the object is a floating point numeric type + + + + Checks the type of the object, returning true if + the object is a fixed point numeric type. + + The object to check + true if the object is a fixed point numeric type + + + + Test two numeric values for equality, performing the usual numeric + conversions and using a provided or default tolerance. If the tolerance + provided is Empty, this method may set it to a default tolerance. + + The expected value + The actual value + A reference to the tolerance in effect + True if the values are equal + + + + Compare two numeric values, performing the usual numeric conversions. + + The expected value + The actual value + The relationship of the values to each other + + + + NUnitComparer encapsulates NUnit's default behavior + in comparing two objects. + + + + + Compares two objects + + + + + + + + Returns the default NUnitComparer. + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + If non-zero, equality comparisons within the specified + tolerance will succeed. + + + + + Comparison object used in comparisons for some constraints. + + + + + Compares two objects for equality. + + + + + Helper method to compare two arrays + + + + + Method to compare two DirectoryInfo objects + + first directory to compare + second directory to compare + true if equivalent, false if not + + + + Returns the default NUnitEqualityComparer + + + + + Gets and sets a flag indicating whether case should + be ignored in determining equality. + + + + + Gets and sets a flag indicating that arrays should be + compared as collections, without regard to their shape. + + + + + Gets and sets an external comparer to be used to + test for equality. It is applied to members of + collections, in place of NUnit's own logic. + + + + + Gets and sets a tolerance used to compare objects of + certin types. + + + + + Gets the list of failure points for the last Match performed. + + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + The expected path used in the constraint + + + + + The actual path being tested + + + + + Flag indicating whether a caseInsensitive comparison should be made + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns true if the expected path and actual path match + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether two paths are the same + + The first path + The second path + Indicates whether case should be ignored + + + + + Test whether one path is under another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + Indicates whether case should be ignored + + + + + Test whether one path is the same as or under another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Modifies the current instance to be case-insensitve + and returns it. + + + + + Modifies the current instance to be case-sensitve + and returns it. + + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Writes the description to a MessageWriter + + + + + NotConstraint negates the effect of some other constraint + + + + + Initializes a new instance of the class. + + The base constraint to be negated. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + SomeItemsConstraint applies another constraint to each + item in a collection, succeeding if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + PropertyExistsConstraint tests that a named property + exists on the object provided through Match. + + Originally, PropertyConstraint provided this feature + in addition to making optional tests on the vaue + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + PropertyConstraint extracts a named property and uses + its value as the actual value for a chained constraint. + + + + + Initializes a new instance of the class. + + The name. + The constraint to apply to the property. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whethe two values are within a + specified range. + + + + + Initializes a new instance of the class. + + From. + To. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Modifies the constraint to use an IComparer and returns self. + + + + + Modifies the constraint to use an IComparer<T> and returns self. + + + + + Modifies the constraint to use a Comparison<T> and returns self. + + + + + ResolvableConstraintExpression is used to represent a compound + constraint being constructed at a point where the last operator + may either terminate the expression or may have additional + qualifying constraints added to it. + + It is used, for example, for a Property element or for + an Exception element, either of which may be optionally + followed by constraints that apply to the property or + exception. + + + + + Create a new instance of ResolvableConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + Resolve the current expression to a Constraint + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + ReusableConstraint wraps a resolved constraint so that it + may be saved and reused as needed. + + + + + Construct a ReusableConstraint + + The constraint or expression to be reused + + + + Conversion operator from a normal constraint to a ReusableConstraint. + + The original constraint to be wrapped as a ReusableConstraint + + + + + Returns the string representation of the constraint. + + A string representing the constraint + + + + Resolves the ReusableConstraint by returning the constraint + that it originally wrapped. + + A resolved constraint + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation + + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + StringConstraint is the abstract base for constraints + that operate on strings. It supports the IgnoreCase + modifier for string operations. + + + + + The expected value + + + + + Indicates whether tests should be case-insensitive + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + EmptyStringConstraint tests whether a string is empty. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullEmptyStringConstraint tests whether a string is either null or empty. + + + + + Constructs a new NullOrEmptyStringConstraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + StartsWithConstraint can test whether a string starts + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EndsWithConstraint can test whether a string ends + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + RegexConstraint can test whether a string matches + the pattern provided. + + + + + Initializes a new instance of the class. + + The pattern. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + ThrowsConstraint is used to test the exception thrown by + a delegate by applying a constraint to it. + + + + + Initializes a new instance of the class, + using a constraint to be applied to the exception. + + A constraint to apply to the caught exception. + + + + Executes the code of the delegate and captures any exception. + If a non-null base constraint was provided, it applies that + constraint to the exception. + + A delegate representing the code to be tested + True if an exception is thrown and the constraint succeeds, otherwise false + + + + Converts an ActualValueDelegate to a TestDelegate + before calling the primary overload. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Converts an ActualValueDelegate to a TestDelegate + before calling the primary overload. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Modes in which the tolerance value for a comparison can + be interpreted. + + + + + The tolerance was created with a value, without specifying + how the value would be used. This is used to prevent setting + the mode more than once and is generally changed to Linear + upon execution of the test. + + + + + The tolerance is used as a numeric range within which + two compared values are considered to be equal. + + + + + Interprets the tolerance as the percentage by which + the two compared values my deviate from each other. + + + + + Compares two values based in their distance in + representable numbers. + + + + + The Tolerance class generalizes the notion of a tolerance + within which an equality test succeeds. Normally, it is + used with numeric types, but it can be used with any + type that supports taking a difference between two + objects and comparing that difference to a value. + + + + + Constructs a linear tolerance of a specdified amount + + + + + Constructs a tolerance given an amount and ToleranceMode + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Returns an empty Tolerance object, equivalent to + specifying an exact match. + + + + + Gets the ToleranceMode for the current Tolerance + + + + + Gets the value of the current Tolerance instance. + + + + + Returns a new tolerance, using the current amount as a percentage. + + + + + Returns a new tolerance, using the current amount in Ulps. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of clock ticks. + + + + + Returns true if the current tolerance is empty. + + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + Construct a TypeConstraint for a given Type + + + + + + Write the actual value for a failing constraint test to a + MessageWriter. TypeConstraints override this method to write + the name of the type. + + The writer on which the actual value is displayed + + + + ExactTypeConstraint is used to test that an object + is of the exact type provided in the constructor + + + + + Construct an ExactTypeConstraint for a given Type + + The expected Type. + + + + Test that an object is of the exact type specified + + The actual value. + True if the tested object is of the exact type provided, otherwise false. + + + + Write the description of this constraint to a MessageWriter + + The MessageWriter to use + + + + InstanceOfTypeConstraint is used to test that an object + is of the same type provided or derived from it. + + + + + Construct an InstanceOfTypeConstraint for the type provided + + The expected Type + + + + Test whether an object is of the specified type or a derived type + + The object to be tested + True if the object is of the provided type or derives from it, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Test whether an object can be assigned from the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Test whether an object can be assigned to the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + Thrown when an assertion failed. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when a test executes inconclusively. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Helper for Assert.AreEqual(double expected, double actual, ...) + allowing code generation to work consistently. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + + + + Throws an with the message and arguments + that are passed in. This is used by the other Assert functions. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This is used by the other Assert functions. + + The message to initialize the with. + + + + Throws an . + This is used by the other Assert functions. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as ignored. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as Inconclusive. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not null or empty + + The string to be tested + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + + + + Gets the number of assertions executed so far and + resets the counter to zero. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names for constraints and + asserts and avoiding conflict with the definition of + , from which it inherits much of its + behavior, in certain mock object frameworks. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + Provides static methods to express the assumptions + that must be met for a test to give a meaningful + result. If an assumption is not met, the test + should produce an inconclusive result. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the + method throws an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + A set of Assert methods operationg on one or more collections + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + The message that will be displayed on failure + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + + + + Static helper class used in the constraint-based syntax + + + + + Creates a new SubstringConstraint + + The value of the substring + A SubstringConstraint + + + + Creates a new CollectionContainsConstraint. + + The item that should be found. + A new CollectionContainsConstraint + + + + Summary description for DirectoryAssert + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Summary description for FileAssert. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if objects are not equal + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the two Stream are the same. + Arguments to be used in formatting the message + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the Streams are the same. + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + GlobalSettings is a place for setting default values used + by the framework in performing asserts. + + + + + Default tolerance for floating point equality + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Interface implemented by a user fixture in order to + validate any expected exceptions. It is only called + for test methods marked with the ExpectedException + attribute. + + + + + Method to handle an expected exception + + The exception to be handled + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The Iz class is a synonym for Is intended for use in VB, + which regards Is as a keyword. + + + + + The List class is a helper class with properties and methods + that supply a number of constraints used with lists and collections. + + + + + List.Map returns a ListMapper, which can be used to map + the original collection to another collection. + + + + + + + ListMapper is used to transform a collection used as an actual argument + producing another collection to be used in the assertion. + + + + + Construct a ListMapper based on a collection + + The collection to be transformed + + + + Produces a collection containing all the values of a property + + The collection of property values + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. + + + + + Get a randomizer for a particular member, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Get a randomizer for a particular parameter, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Construct a randomizer using a random seed + + + + + Construct a randomizer using a specified seed + + + + + Return an array of random doubles between 0.0 and 1.0. + + + + + + + Return an array of random doubles with values in a specified range. + + + + + Return an array of random ints with values in a specified range. + + + + + Get a random seed for use in creating a randomizer. + + + + + The SpecialValue enum is used to represent TestCase arguments + that cannot be used as arguments to an Attribute. + + + + + Null represents a null value, which cannot be used as an + argument to an attriute under .NET 1.x + + + + + Basic Asserts on strings. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string is not found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are Notequal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + + + + The TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It provides a number of instance modifiers + for use in initializing the test case. + + Note: Instance modifiers are getters that return + the same instance after modifying it's state. + + + + + The argument list to be provided to the test + + + + + The expected result to be returned + + + + + The expected exception Type + + + + + The FullName of the expected exception + + + + + The name to be used for the test + + + + + The description of the test + + + + + A dictionary of properties, used to add information + to tests without requiring the class to change. + + + + + If true, indicates that the test case is to be ignored + + + + + The reason for ignoring a test case + + + + + Initializes a new instance of the class. + + The arguments. + + + + Initializes a new instance of the class. + + The argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + The third argument. + + + + Sets the expected result for the test + + The expected result + A modified TestCaseData + + + + Sets the expected exception type for the test + + Type of the expected exception. + The modified TestCaseData instance + + + + Sets the expected exception type for the test + + FullName of the expected exception. + The modified TestCaseData instance + + + + Sets the name of the test case + + The modified TestCaseData instance + + + + Sets the description for the test case + being constructed. + + The description. + The modified TestCaseData instance. + + + + Applies a category to the test + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Ignores this TestCase. + + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Gets a list of categories associated with this test. + + + + + Gets the property dictionary for this test + + + + + Provide the context information of the current test + + + + + Constructs a TestContext using the provided context dictionary + + A context dictionary + + + + Get the current test context. This is created + as needed. The user may save the context for + use within a test, but it should not be used + outside the test for which it is created. + + + + + Gets a TestAdapter representing the currently executing test in this context. + + + + + Gets a ResultAdapter representing the current result for the test + executing in this context. + + + + + Gets the current directory for this TestContext + + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Constructs a TestAdapter for this context + + The context dictionary + + + + The name of the test. + + + + + The FullName of the test + + + + + The properties of the test. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a context + + The context holding the result + + + + The TestState of current test. This maps to the ResultState + used in nunit.core and is subject to change in the future. + + + + + The TestStatus of current test. This enum will be used + in future versions of NUnit and so is to be preferred + to the TestState value. + + + + + The ResultState enum indicates the result of running a test + + + + + The result is inconclusive + + + + + The test was not runnable. + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test succeeded + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + The test failed + + + + + Helper class with static methods used to supply constraints + that operate on strings. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + TextMessageWriter writes constraint descriptions and messages + in displayable form as a text stream. It tailors the display + of individual message components to form the standard message + format of NUnit assertion failure messages. + + + + + Prefix used for the expected value line of a message + + + + + Prefix used for the actual value line of a message + + + + + Length of a message prefix + + + + + Construct a TextMessageWriter + + + + + Construct a TextMessageWriter, specifying a user message + and optional formatting arguments. + + + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in string comparisons + If true, clip the strings to fit the max line length + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Write the text for a modifier. + + The modifier. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Write the generic 'Expected' line for a constraint + + The constraint that failed + + + + Write the generic 'Expected' line for a given value + + The expected value + + + + Write the generic 'Expected' line for a given value + and tolerance. + + The expected value + The tolerance within which the test was made + + + + Write the generic 'Actual' line for a constraint + + The constraint for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Gets or sets the maximum line length for this writer + + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying an expected exception + + + + + Creates a constraint specifying an exception with a given InnerException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying that no exception is thrown + + + + diff --git a/lib/NUnit/lib/nunit.mocks.dll b/lib/NUnit/lib/nunit.mocks.dll new file mode 100644 index 0000000000..6ee2c1cc20 Binary files /dev/null and b/lib/NUnit/lib/nunit.mocks.dll differ diff --git a/lib/NUnit/lib/pnunit.framework.dll b/lib/NUnit/lib/pnunit.framework.dll new file mode 100644 index 0000000000..6c105d70f9 Binary files /dev/null and b/lib/NUnit/lib/pnunit.framework.dll differ diff --git a/lib/NUnit/license.txt b/lib/NUnit/license.txt new file mode 100644 index 0000000000..ab91df4496 --- /dev/null +++ b/lib/NUnit/license.txt @@ -0,0 +1,15 @@ +Copyright © 2002-2008 Charlie Poole +Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov +Copyright © 2000-2002 Philip A. Craig + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. + +Portions Copyright © 2002-2008 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/lib/NUnit/tools/NUnitTests.VisualState.xml b/lib/NUnit/tools/NUnitTests.VisualState.xml new file mode 100644 index 0000000000..603cda770e --- /dev/null +++ b/lib/NUnit/tools/NUnitTests.VisualState.xml @@ -0,0 +1,124 @@ + + + [0-1000]D:\Dev\NUnit\nunit-2.5\work\build\net\2.0\release\NUnitTests.nunit + [0-1000]D:\Dev\NUnit\nunit-2.5\work\build\net\2.0\release\NUnitTests.nunit + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit 2.2.8.0/NUnitTests.config b/lib/NUnit/tools/NUnitTests.config similarity index 62% rename from lib/NUnit 2.2.8.0/NUnitTests.config rename to lib/NUnit/tools/NUnitTests.config index 4e6cfce9e5..9487c07d26 100644 --- a/lib/NUnit 2.2.8.0/NUnitTests.config +++ b/lib/NUnit/tools/NUnitTests.config @@ -1,76 +1,85 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/NUnit/tools/NUnitTests.nunit b/lib/NUnit/tools/NUnitTests.nunit new file mode 100644 index 0000000000..bb80dd6492 --- /dev/null +++ b/lib/NUnit/tools/NUnitTests.nunit @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/lib/NUnit/tools/TestResult.xml b/lib/NUnit/tools/TestResult.xml new file mode 100644 index 0000000000..058d42bf88 --- /dev/null +++ b/lib/NUnit/tools/TestResult.xml @@ -0,0 +1,5971 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/agent.conf b/lib/NUnit/tools/agent.conf new file mode 100644 index 0000000000..b4cf5509e7 --- /dev/null +++ b/lib/NUnit/tools/agent.conf @@ -0,0 +1,4 @@ + + 8080 + . + \ No newline at end of file diff --git a/lib/NUnit/tools/agent.log.conf b/lib/NUnit/tools/agent.log.conf new file mode 100644 index 0000000000..d340cad1e9 --- /dev/null +++ b/lib/NUnit/tools/agent.log.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/lib/NUnit/tools/launcher.log.conf b/lib/NUnit/tools/launcher.log.conf new file mode 100644 index 0000000000..d340cad1e9 --- /dev/null +++ b/lib/NUnit/tools/launcher.log.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/lib/NUnit/tools/lib/Failure.png b/lib/NUnit/tools/lib/Failure.png new file mode 100644 index 0000000000..2e400b276f Binary files /dev/null and b/lib/NUnit/tools/lib/Failure.png differ diff --git a/lib/NUnit/tools/lib/Ignored.png b/lib/NUnit/tools/lib/Ignored.png new file mode 100644 index 0000000000..478efbf00b Binary files /dev/null and b/lib/NUnit/tools/lib/Ignored.png differ diff --git a/lib/NUnit/tools/lib/Inconclusive.png b/lib/NUnit/tools/lib/Inconclusive.png new file mode 100644 index 0000000000..4807b7cedb Binary files /dev/null and b/lib/NUnit/tools/lib/Inconclusive.png differ diff --git a/lib/NUnit/tools/lib/Skipped.png b/lib/NUnit/tools/lib/Skipped.png new file mode 100644 index 0000000000..7c9fc64e38 Binary files /dev/null and b/lib/NUnit/tools/lib/Skipped.png differ diff --git a/lib/NUnit/tools/lib/Success.png b/lib/NUnit/tools/lib/Success.png new file mode 100644 index 0000000000..2a301508c6 Binary files /dev/null and b/lib/NUnit/tools/lib/Success.png differ diff --git a/lib/NUnit/tools/lib/fit.dll b/lib/NUnit/tools/lib/fit.dll new file mode 100644 index 0000000000..40bbef0e29 Binary files /dev/null and b/lib/NUnit/tools/lib/fit.dll differ diff --git a/lib/NUnit/tools/lib/log4net.dll b/lib/NUnit/tools/lib/log4net.dll new file mode 100644 index 0000000000..20a2e1c47d Binary files /dev/null and b/lib/NUnit/tools/lib/log4net.dll differ diff --git a/lib/NUnit/tools/lib/nunit-console-runner.dll b/lib/NUnit/tools/lib/nunit-console-runner.dll new file mode 100644 index 0000000000..1709ce7bd2 Binary files /dev/null and b/lib/NUnit/tools/lib/nunit-console-runner.dll differ diff --git a/lib/NUnit/tools/lib/nunit-gui-runner.dll b/lib/NUnit/tools/lib/nunit-gui-runner.dll new file mode 100644 index 0000000000..35efa737c3 Binary files /dev/null and b/lib/NUnit/tools/lib/nunit-gui-runner.dll differ diff --git a/lib/NUnit/tools/lib/nunit.core.dll b/lib/NUnit/tools/lib/nunit.core.dll new file mode 100644 index 0000000000..a1dd69866d Binary files /dev/null and b/lib/NUnit/tools/lib/nunit.core.dll differ diff --git a/lib/NUnit/tools/lib/nunit.core.interfaces.dll b/lib/NUnit/tools/lib/nunit.core.interfaces.dll new file mode 100644 index 0000000000..0ac8788205 Binary files /dev/null and b/lib/NUnit/tools/lib/nunit.core.interfaces.dll differ diff --git a/lib/NUnit/tools/lib/nunit.fixtures.dll b/lib/NUnit/tools/lib/nunit.fixtures.dll new file mode 100644 index 0000000000..8fd1932d75 Binary files /dev/null and b/lib/NUnit/tools/lib/nunit.fixtures.dll differ diff --git a/lib/NUnit/tools/lib/nunit.uiexception.dll b/lib/NUnit/tools/lib/nunit.uiexception.dll new file mode 100644 index 0000000000..610c1700ed Binary files /dev/null and b/lib/NUnit/tools/lib/nunit.uiexception.dll differ diff --git a/lib/NUnit/tools/lib/nunit.uikit.dll b/lib/NUnit/tools/lib/nunit.uikit.dll new file mode 100644 index 0000000000..9087db2d16 Binary files /dev/null and b/lib/NUnit/tools/lib/nunit.uikit.dll differ diff --git a/lib/NUnit/tools/lib/nunit.util.dll b/lib/NUnit/tools/lib/nunit.util.dll new file mode 100644 index 0000000000..0b315c2106 Binary files /dev/null and b/lib/NUnit/tools/lib/nunit.util.dll differ diff --git a/lib/NUnit/tools/nunit-agent-x86.exe b/lib/NUnit/tools/nunit-agent-x86.exe new file mode 100644 index 0000000000..ebcee1be24 Binary files /dev/null and b/lib/NUnit/tools/nunit-agent-x86.exe differ diff --git a/lib/NUnit 2.2.8.0/nunit-console.v4.0.config b/lib/NUnit/tools/nunit-agent-x86.exe.config similarity index 58% rename from lib/NUnit 2.2.8.0/nunit-console.v4.0.config rename to lib/NUnit/tools/nunit-agent-x86.exe.config index 999eed1c61..84c2906d6e 100644 --- a/lib/NUnit 2.2.8.0/nunit-console.v4.0.config +++ b/lib/NUnit/tools/nunit-agent-x86.exe.config @@ -1,102 +1,69 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/nunit-agent.exe b/lib/NUnit/tools/nunit-agent.exe new file mode 100644 index 0000000000..ec41f32382 Binary files /dev/null and b/lib/NUnit/tools/nunit-agent.exe differ diff --git a/lib/NUnit 2.2.8.0/mock-assembly.dll.config b/lib/NUnit/tools/nunit-agent.exe.config similarity index 56% rename from lib/NUnit 2.2.8.0/mock-assembly.dll.config rename to lib/NUnit/tools/nunit-agent.exe.config index 22f0349409..84c2906d6e 100644 --- a/lib/NUnit 2.2.8.0/mock-assembly.dll.config +++ b/lib/NUnit/tools/nunit-agent.exe.config @@ -1,60 +1,69 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/nunit-console-x86.exe b/lib/NUnit/tools/nunit-console-x86.exe new file mode 100644 index 0000000000..e08ac9c81d Binary files /dev/null and b/lib/NUnit/tools/nunit-console-x86.exe differ diff --git a/lib/NUnit/tools/nunit-console-x86.exe.config b/lib/NUnit/tools/nunit-console-x86.exe.config new file mode 100644 index 0000000000..ce92b5b41f --- /dev/null +++ b/lib/NUnit/tools/nunit-console-x86.exe.config @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/nunit-console.exe b/lib/NUnit/tools/nunit-console.exe new file mode 100644 index 0000000000..1544a9d831 Binary files /dev/null and b/lib/NUnit/tools/nunit-console.exe differ diff --git a/lib/NUnit/tools/nunit-console.exe.config b/lib/NUnit/tools/nunit-console.exe.config new file mode 100644 index 0000000000..08ee954714 --- /dev/null +++ b/lib/NUnit/tools/nunit-console.exe.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/nunit-x86.exe b/lib/NUnit/tools/nunit-x86.exe new file mode 100644 index 0000000000..fd342c070a Binary files /dev/null and b/lib/NUnit/tools/nunit-x86.exe differ diff --git a/lib/NUnit/tools/nunit-x86.exe.config b/lib/NUnit/tools/nunit-x86.exe.config new file mode 100644 index 0000000000..6c0320e871 --- /dev/null +++ b/lib/NUnit/tools/nunit-x86.exe.config @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/nunit.exe b/lib/NUnit/tools/nunit.exe new file mode 100644 index 0000000000..ad8b08af38 Binary files /dev/null and b/lib/NUnit/tools/nunit.exe differ diff --git a/lib/NUnit/tools/nunit.exe.config b/lib/NUnit/tools/nunit.exe.config new file mode 100644 index 0000000000..6c0320e871 --- /dev/null +++ b/lib/NUnit/tools/nunit.exe.config @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/nunit.framework.dll b/lib/NUnit/tools/nunit.framework.dll new file mode 100644 index 0000000000..6856e51ef0 Binary files /dev/null and b/lib/NUnit/tools/nunit.framework.dll differ diff --git a/lib/NUnit/tools/pnunit-agent.exe b/lib/NUnit/tools/pnunit-agent.exe new file mode 100644 index 0000000000..7a555e16c9 Binary files /dev/null and b/lib/NUnit/tools/pnunit-agent.exe differ diff --git a/lib/NUnit 2.2.8.0/nunit-console.v2.0.config b/lib/NUnit/tools/pnunit-agent.exe.config similarity index 60% rename from lib/NUnit 2.2.8.0/nunit-console.v2.0.config rename to lib/NUnit/tools/pnunit-agent.exe.config index f01f07d020..5ed5f7b72c 100644 --- a/lib/NUnit 2.2.8.0/nunit-console.v2.0.config +++ b/lib/NUnit/tools/pnunit-agent.exe.config @@ -1,102 +1,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/pnunit-launcher.exe b/lib/NUnit/tools/pnunit-launcher.exe new file mode 100644 index 0000000000..c70e58ef13 Binary files /dev/null and b/lib/NUnit/tools/pnunit-launcher.exe differ diff --git a/lib/NUnit 2.2.8.0/nunit-console.v3.5.config b/lib/NUnit/tools/pnunit-launcher.exe.config similarity index 60% rename from lib/NUnit 2.2.8.0/nunit-console.v3.5.config rename to lib/NUnit/tools/pnunit-launcher.exe.config index f01f07d020..5ed5f7b72c 100644 --- a/lib/NUnit 2.2.8.0/nunit-console.v3.5.config +++ b/lib/NUnit/tools/pnunit-launcher.exe.config @@ -1,102 +1,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/NUnit/tools/pnunit.framework.dll b/lib/NUnit/tools/pnunit.framework.dll new file mode 100644 index 0000000000..6c105d70f9 Binary files /dev/null and b/lib/NUnit/tools/pnunit.framework.dll differ diff --git a/lib/NUnit/tools/pnunit.tests.dll b/lib/NUnit/tools/pnunit.tests.dll new file mode 100644 index 0000000000..dce018acda Binary files /dev/null and b/lib/NUnit/tools/pnunit.tests.dll differ diff --git a/lib/NUnit/tools/runFile.exe b/lib/NUnit/tools/runFile.exe new file mode 100644 index 0000000000..a794458669 Binary files /dev/null and b/lib/NUnit/tools/runFile.exe differ diff --git a/lib/NUnit/tools/runFile.exe.config b/lib/NUnit/tools/runFile.exe.config new file mode 100644 index 0000000000..35909b4ced --- /dev/null +++ b/lib/NUnit/tools/runFile.exe.config @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/NUnit/tools/runpnunit.bat b/lib/NUnit/tools/runpnunit.bat new file mode 100644 index 0000000000..6efc8b442b --- /dev/null +++ b/lib/NUnit/tools/runpnunit.bat @@ -0,0 +1,2 @@ +start pnunit-agent agent.conf +pnunit-launcher test.conf \ No newline at end of file diff --git a/lib/NUnit/tools/test.conf b/lib/NUnit/tools/test.conf new file mode 100644 index 0000000000..a35e7184da --- /dev/null +++ b/lib/NUnit/tools/test.conf @@ -0,0 +1,24 @@ + + + + + Testing + + + Testing + pnunit.tests.dll + TestLibraries.Testing.EqualTo19 + localhost:8080 + + ..\server + + + + + + + + + + + \ No newline at end of file diff --git a/lib/System.Core/ExtensionAttribute.cs b/lib/System.Core/ExtensionAttribute.cs deleted file mode 100644 index fcb186f3f2..0000000000 --- a/lib/System.Core/ExtensionAttribute.cs +++ /dev/null @@ -1,7 +0,0 @@ - -namespace System.Runtime.CompilerServices -{ - /// Used for 2.0 compatibility - [AttributeUsage(AttributeTargets.Method)] - public sealed class ExtensionAttribute : Attribute { } -} diff --git a/lib/System.Core/System.Core.dll b/lib/System.Core/System.Core.dll deleted file mode 100644 index d34141b3e8..0000000000 Binary files a/lib/System.Core/System.Core.dll and /dev/null differ diff --git a/lib/System.Core/build.bat b/lib/System.Core/build.bat deleted file mode 100644 index 13883e6174..0000000000 --- a/lib/System.Core/build.bat +++ /dev/null @@ -1 +0,0 @@ -c:\Windows\Microsoft.NET\Framework\v2.0.50727\csc /target:library /out:System.Core.dll /keyfile:..\..\keys\Google.ProtocolBuffers.snk ExtensionAttribute.cs diff --git a/src/ProtoDump/ProtoDump.csproj b/src/ProtoDump/ProtoDump.csproj index 9e14573683..f07cdc0f82 100644 --- a/src/ProtoDump/ProtoDump.csproj +++ b/src/ProtoDump/ProtoDump.csproj @@ -1,97 +1,97 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D7282E99-2DC3-405B-946F-177DB2FD2AE2} - Exe - Properties - Google.ProtocolBuffers.ProtoDump - ProtoDump - v2.0 - 512 - - - - - 3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {D7282E99-2DC3-405B-946F-177DB2FD2AE2} + Exe + Properties + Google.ProtocolBuffers.ProtoDump + ProtoDump + v2.0 + 512 + + + + + 3.5 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + {6908BDCE-D925-43F3-94AC-A531E6DF2591} + ProtocolBuffers + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + --> \ No newline at end of file diff --git a/src/ProtoGen.Test/ProtoGen.Test.csproj b/src/ProtoGen.Test/ProtoGen.Test.csproj index d08cbb7349..5325be5180 100644 --- a/src/ProtoGen.Test/ProtoGen.Test.csproj +++ b/src/ProtoGen.Test/ProtoGen.Test.csproj @@ -1,124 +1,130 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C268DA4C-4004-47DA-AF23-44C983281A68} - Library - Properties - Google.ProtocolBuffers.ProtoGen - Google.ProtocolBuffers.ProtoGen.Test - v2.0 - 512 - true - ..\..\keys\Google.ProtocolBuffers.snk - - - - - 3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\lib\NUnit 2.2.8.0\nunit.framework.dll - - - False - ..\..\lib\Rhino.Mocks.dll - - - - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - {250ADE34-82FD-4BAE-86D5-985FBE589C4A} - ProtoGen - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - protoc.exe - Always - - - google\protobuf\csharp_options.proto - Always - - - google\protobuf\descriptor.proto - Always - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C268DA4C-4004-47DA-AF23-44C983281A68} + Library + Properties + Google.ProtocolBuffers.ProtoGen + Google.ProtocolBuffers.ProtoGen.Test + v2.0 + 512 + true + ..\..\keys\Google.ProtocolBuffers.snk + + + + + 3.5 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + False + ..\..\lib\NUnit\lib\nunit.framework.dll + + + False + ..\..\lib\Rhino.Mocks.dll + + + + + + + + + + + + + + + {6908BDCE-D925-43F3-94AC-A531E6DF2591} + ProtocolBuffers + + + {250ADE34-82FD-4BAE-86D5-985FBE589C4A} + ProtoGen + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + protoc.exe + Always + + + google\protobuf\csharp_options.proto + Always + + + google\protobuf\descriptor.proto + Always + + + + + + Program + $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe + /nologo /noshadow /labels /wait $(AssemblyName).dll + $(ProjectDir)$(OutputPath) + \ No newline at end of file diff --git a/src/ProtoGen/ServiceInterfaceGenerator.cs b/src/ProtoGen/ServiceInterfaceGenerator.cs index 041cffce4f..64b6d69be9 100644 --- a/src/ProtoGen/ServiceInterfaceGenerator.cs +++ b/src/ProtoGen/ServiceInterfaceGenerator.cs @@ -159,8 +159,7 @@ namespace Google.ProtocolBuffers.ProtoGen writer.WriteLine("public {0}(pb::IRpcDispatch dispatch) : this(dispatch, true) {{", Descriptor.Name); writer.WriteLine("}"); writer.WriteLine("public {0}(pb::IRpcDispatch dispatch, bool dispose) {{", Descriptor.Name); - writer.WriteLine( - " if (null == (this.dispatch = dispatch)) throw new global::System.ArgumentNullException();"); + writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, \"dispatch\");"); writer.WriteLine(" this.dispose = dispose && dispatch is global::System.IDisposable;"); writer.WriteLine("}"); writer.WriteLine(); @@ -209,8 +208,7 @@ namespace Google.ProtocolBuffers.ProtoGen Descriptor.Name); writer.WriteLine("}"); writer.WriteLine("public Dispatch(I{0} implementation, bool dispose) {{", Descriptor.Name); - writer.WriteLine( - " if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();"); + writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");"); writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;"); writer.WriteLine("}"); writer.WriteLine(); @@ -235,9 +233,7 @@ namespace Google.ProtocolBuffers.ProtoGen method.Name, NameHelpers.UnderscoresToPascalCase(method.Name), GetClassName(method.InputType)); } - writer.WriteLine( - "default: throw new global::System.MissingMethodException(typeof(I{0}).FullName, methodName);", - Descriptor.Name); + writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name); writer.Outdent(); writer.WriteLine("}"); //end switch writer.Outdent(); @@ -272,8 +268,7 @@ namespace Google.ProtocolBuffers.ProtoGen writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) {"); writer.WriteLine("}"); writer.WriteLine("public ServerStub(pb::IRpcDispatch implementation, bool dispose) {"); - writer.WriteLine( - " if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException();"); + writer.WriteLine(" pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, \"implementation\");"); writer.WriteLine(" this.dispose = dispose && implementation is global::System.IDisposable;"); writer.WriteLine("}"); writer.WriteLine(); @@ -296,9 +291,7 @@ namespace Google.ProtocolBuffers.ProtoGen "case \"{0}\": return implementation.CallMethod(methodName, {1}.ParseFrom(input, registry), {2}.CreateBuilder());", method.Name, GetClassName(method.InputType), GetClassName(method.OutputType)); } - writer.WriteLine( - "default: throw new global::System.MissingMethodException(typeof(I{0}).FullName, methodName);", - Descriptor.Name); + writer.WriteLine("default: throw pb::ThrowHelper.CreateMissingMethod(typeof(I{0}), methodName);", Descriptor.Name); writer.Outdent(); writer.WriteLine("}"); //end switch writer.Outdent(); diff --git a/src/ProtoMunge/ProtoMunge.csproj b/src/ProtoMunge/ProtoMunge.csproj index a04276cc99..a62fdcc2e7 100644 --- a/src/ProtoMunge/ProtoMunge.csproj +++ b/src/ProtoMunge/ProtoMunge.csproj @@ -1,97 +1,97 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8F09AF72-3327-4FA7-BC09-070B80221AB9} - Exe - Properties - Google.ProtocolBuffers.ProtoMunge - ProtoMunge - v2.0 - 512 - - - - - 3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} - ProtocolBuffers - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {8F09AF72-3327-4FA7-BC09-070B80221AB9} + Exe + Properties + Google.ProtocolBuffers.ProtoMunge + ProtoMunge + v2.0 + 512 + + + + + 3.5 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + {6908BDCE-D925-43F3-94AC-A531E6DF2591} + ProtocolBuffers + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + --> \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization(Silverlight).csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization(Silverlight).csproj new file mode 100644 index 0000000000..5c05adb814 --- /dev/null +++ b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization(Silverlight).csproj @@ -0,0 +1,99 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {72B69A15-E28E-4738-A779-18D76C87D225} + Library + Properties + Google.ProtocolBuffers.Serialization + Google.ProtocolBuffers.Serialization + v2.0 + 512 + true + ..\..\keys\Google.ProtocolBuffers.snk + 3.5 + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + v3.5 + false + true + true + v2.0 + + + true + full + false + bin\Debug_Silverlight\ + $(OutputPath)\$(AssemblyName).xml + 1591, 1570, 1571, 1572, 1573, 1574 + DEBUG;TRACE;SILVERLIGHT + prompt + 4 + true + + + pdbonly + true + bin\Release_Silverlight\ + $(OutputPath)\$(AssemblyName).xml + 1591, 1570, 1571, 1572, 1573, 1574 + TRACE;SILVERLIGHT + prompt + 4 + true + + + NET20;$(DefineConstants) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {7E4E681E-5D09-43FB-8D9E-35A454730A85} + ProtocolBuffers%28Silverlight%29 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj index 1b246f1fd4..6ac39241fa 100644 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj +++ b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj @@ -14,28 +14,7 @@ 512 true ..\..\keys\Google.ProtocolBuffers.snk - - - - 3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v2.0 - NET20; true @@ -44,11 +23,10 @@ bin\Debug\ $(OutputPath)\$(AssemblyName).xml 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE;DEBUG; + DEBUG;TRACE prompt 4 true - AllRules.ruleset pdbonly @@ -56,36 +34,13 @@ bin\Release\ $(OutputPath)\$(AssemblyName).xml 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE; + TRACE prompt 4 true - AllRules.ruleset - - true - full - false - bin\Debug_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE;DEBUG;SILVERLIGHT - prompt - 4 - true - AllRules.ruleset - - - pdbonly - true - bin\Release_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE;SILVERLIGHT - prompt - 4 - true - AllRules.ruleset + + NET20;$(DefineConstants) @@ -114,23 +69,6 @@ - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - {6908BDCE-D925-43F3-94AC-A531E6DF2591} @@ -138,10 +76,7 @@ False - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj index d9794fa082..0c4222d90d 100644 --- a/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj +++ b/src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj @@ -14,28 +14,7 @@ 512 true ..\..\keys\Google.ProtocolBuffers.snk - - - - 3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v2.0 - NET20; true @@ -44,11 +23,10 @@ bin\Debug\ $(OutputPath)\$(AssemblyName).xml 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE;DEBUG + DEBUG;TRACE;LITE prompt 4 true - AllRules.ruleset pdbonly @@ -56,36 +34,13 @@ bin\Release\ $(OutputPath)\$(AssemblyName).xml 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE; + TRACE;LITE prompt 4 true - AllRules.ruleset - - true - full - false - bin\Debug_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE;DEBUG;SILVERLIGHT - prompt - 4 - true - AllRules.ruleset - - - pdbonly - true - bin\Release_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - $(DefineConstants)TRACE;SILVERLIGHT - prompt - 4 - true - AllRules.ruleset + + NET20;$(DefineConstants) @@ -114,23 +69,6 @@ - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - {6969BDCE-D925-43F3-94AC-A531E6DF2591} @@ -138,10 +76,7 @@ False - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj index 8000e7d204..24547a47b2 100644 --- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj +++ b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj @@ -58,9 +58,9 @@ true - + False - ..\..\lib\NUnit 2.2.8.0\nunit.framework.dll + ..\..\lib\NUnit\lib\nunit.framework.dll False @@ -72,6 +72,9 @@ + + Microsoft.VisualStudio.TestTools.cs + @@ -162,8 +165,7 @@ - - + + + Program + $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe + /nologo /noshadow /labels /wait $(AssemblyName).dll + $(ProjectDir)$(OutputPath) + \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/ReflectionTester.cs b/src/ProtocolBuffers.Test/ReflectionTester.cs index 5f323228b9..9565a167f0 100644 --- a/src/ProtocolBuffers.Test/ReflectionTester.cs +++ b/src/ProtocolBuffers.Test/ReflectionTester.cs @@ -37,7 +37,9 @@ using System; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +#pragma warning disable 618 // Disable warning about obsolete use miss-matched assert arguments namespace Google.ProtocolBuffers { @@ -472,7 +474,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(101, message[f("optional_int32")]); Assert.AreEqual(102L, message[f("optional_int64")]); - Assert.AreEqual(103U, message[f("optional_uint32")]); + Assert.AreEqual(103u, message[f("optional_uint32")]); Assert.AreEqual(104UL, message[f("optional_uint64")]); Assert.AreEqual(105, message[f("optional_sint32")]); Assert.AreEqual(106L, message[f("optional_sint64")]); @@ -957,28 +959,30 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_double"))); Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_bool"))); Assert.AreEqual(2, message.GetRepeatedFieldCount(f("packed_enum"))); + Assert.AreEqual(601, message[f("packed_int32"), 0]); Assert.AreEqual(602L, message[f("packed_int64"), 0]); - Assert.AreEqual(603, message[f("packed_uint32"), 0]); - Assert.AreEqual(604L, message[f("packed_uint64"), 0]); + Assert.AreEqual(603u, message[f("packed_uint32"), 0]); + Assert.AreEqual(604uL, message[f("packed_uint64"), 0]); Assert.AreEqual(605, message[f("packed_sint32"), 0]); Assert.AreEqual(606L, message[f("packed_sint64"), 0]); - Assert.AreEqual(607, message[f("packed_fixed32"), 0]); - Assert.AreEqual(608L, message[f("packed_fixed64"), 0]); + Assert.AreEqual(607u, message[f("packed_fixed32"), 0]); + Assert.AreEqual(608uL, message[f("packed_fixed64"), 0]); Assert.AreEqual(609, message[f("packed_sfixed32"), 0]); Assert.AreEqual(610L, message[f("packed_sfixed64"), 0]); Assert.AreEqual(611F, message[f("packed_float"), 0]); Assert.AreEqual(612D, message[f("packed_double"), 0]); Assert.AreEqual(true, message[f("packed_bool"), 0]); Assert.AreEqual(foreignBar, message[f("packed_enum"), 0]); + Assert.AreEqual(701, message[f("packed_int32"), 1]); Assert.AreEqual(702L, message[f("packed_int64"), 1]); - Assert.AreEqual(703, message[f("packed_uint32"), 1]); - Assert.AreEqual(704L, message[f("packed_uint64"), 1]); + Assert.AreEqual(703u, message[f("packed_uint32"), 1]); + Assert.AreEqual(704uL, message[f("packed_uint64"), 1]); Assert.AreEqual(705, message[f("packed_sint32"), 1]); Assert.AreEqual(706L, message[f("packed_sint64"), 1]); - Assert.AreEqual(707, message[f("packed_fixed32"), 1]); - Assert.AreEqual(708L, message[f("packed_fixed64"), 1]); + Assert.AreEqual(707u, message[f("packed_fixed32"), 1]); + Assert.AreEqual(708uL, message[f("packed_fixed64"), 1]); Assert.AreEqual(709, message[f("packed_sfixed32"), 1]); Assert.AreEqual(710L, message[f("packed_sfixed64"), 1]); Assert.AreEqual(711F, message[f("packed_float"), 1]); diff --git a/src/ProtocolBuffers.Test/ReusableBuilderTest.cs b/src/ProtocolBuffers.Test/ReusableBuilderTest.cs index d5755f6f6b..93129b2f1a 100644 --- a/src/ProtocolBuffers.Test/ReusableBuilderTest.cs +++ b/src/ProtocolBuffers.Test/ReusableBuilderTest.cs @@ -3,17 +3,17 @@ using System.Collections.Generic; using System.ComponentModel; using System.Text; using Google.ProtocolBuffers.Collections; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.Serialization; using UnitTest.Issues.TestProtos; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class ReusableBuilderTest { - [Test, Description("Issue 28: Circular message dependencies result in null defaults for DefaultInstance")] + [TestMethod, System.ComponentModel.Description("Issue 28: Circular message dependencies result in null defaults for DefaultInstance")] public void EnsureStaticCicularReference() { MyMessageAReferenceB ab = MyMessageAReferenceB.DefaultInstance; @@ -24,7 +24,7 @@ namespace Google.ProtocolBuffers Assert.IsNotNull(ba.Value); } - [Test] + [TestMethod] public void TestModifyDefaultInstance() { //verify that the default instance has correctly been marked as read-only @@ -33,7 +33,7 @@ namespace Google.ProtocolBuffers Assert.IsTrue(list.IsReadOnly); } - [Test] + [TestMethod] public void TestUnmodifiedDefaultInstance() { //Simply calling ToBuilder().Build() no longer creates a copy of the message @@ -41,7 +41,7 @@ namespace Google.ProtocolBuffers Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void BuildMultipleWithoutChange() { //Calling Build() or BuildPartial() does not require a copy of the message @@ -55,7 +55,7 @@ namespace Google.ProtocolBuffers Assert.IsTrue(ReferenceEquals(first, builder.BuildPartial().ToBuilder().Build())); } - [Test] + [TestMethod] public void MergeFromDefaultInstance() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -64,7 +64,7 @@ namespace Google.ProtocolBuffers Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void BuildNewBuilderIsDefaultInstance() { Assert.IsTrue(ReferenceEquals(TestAllTypes.DefaultInstance, new TestAllTypes.Builder().Build())); @@ -74,7 +74,7 @@ namespace Google.ProtocolBuffers TestAllTypes.CreateBuilder().SetOptionalBool(true).Build().ToBuilder().Clear().Build())); } - [Test] + [TestMethod] public void BuildModifyAndRebuild() { TestAllTypes.Builder b1 = new TestAllTypes.Builder(); @@ -94,7 +94,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual("{\"optional_foreign_message\":{\"c\":7},\"repeated_int32\":[2,6],\"default_int32\":5}", Extensions.ToJson(m2)); } - [Test] + [TestMethod] public void CloneOnChangePrimitive() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -103,7 +103,7 @@ namespace Google.ProtocolBuffers Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void CloneOnAddRepeatedBool() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -112,7 +112,7 @@ namespace Google.ProtocolBuffers Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void CloneOnGetRepeatedBoolList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -121,7 +121,7 @@ namespace Google.ProtocolBuffers Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void CloneOnChangeMessage() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -130,7 +130,7 @@ namespace Google.ProtocolBuffers Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void CloneOnClearMessage() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -139,7 +139,7 @@ namespace Google.ProtocolBuffers Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void CloneOnGetRepeatedForeignMessageList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -148,7 +148,7 @@ namespace Google.ProtocolBuffers Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void CloneOnChangeEnumValue() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); @@ -157,7 +157,7 @@ namespace Google.ProtocolBuffers Assert.IsFalse(ReferenceEquals(TestAllTypes.DefaultInstance, builder.Build())); } - [Test] + [TestMethod] public void CloneOnGetRepeatedForeignEnumList() { TestAllTypes.Builder builder = TestAllTypes.DefaultInstance.ToBuilder(); diff --git a/src/ProtocolBuffers.Test/SerializableAttribute.cs b/src/ProtocolBuffers.Test/SerializableAttribute.cs new file mode 100644 index 0000000000..04fcdcbadd --- /dev/null +++ b/src/ProtocolBuffers.Test/SerializableAttribute.cs @@ -0,0 +1,12 @@ +#if SILVERLIGHT + +namespace System +{ + [AttributeUsage(AttributeTargets.Class)] + public class SerializableAttribute : Attribute + { + public SerializableAttribute () : base() { } + } +} + +#endif diff --git a/src/ProtocolBuffers.Test/SerializableTest.cs b/src/ProtocolBuffers.Test/SerializableTest.cs index f1073c1e45..edf6ce491d 100644 --- a/src/ProtocolBuffers.Test/SerializableTest.cs +++ b/src/ProtocolBuffers.Test/SerializableTest.cs @@ -5,11 +5,11 @@ using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Text; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class SerializableTest { /// @@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers public static readonly ISerializable CompileTimeCheckSerializableMessage = TestXmlMessage.DefaultInstance; public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestXmlMessage.Builder(); - [Test] + [TestMethod] public void TestPlainMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -51,7 +51,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestMessageWithExtensions() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -96,7 +96,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestPlainBuilder() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() @@ -129,7 +129,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(builder.Build(), copy.Build()); } - [Test] + [TestMethod] public void TestBuilderWithExtensions() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder() diff --git a/src/ProtocolBuffers.Test/ServiceTest.cs b/src/ProtocolBuffers.Test/ServiceTest.cs index dbfa10c939..4678ca7b25 100644 --- a/src/ProtocolBuffers.Test/ServiceTest.cs +++ b/src/ProtocolBuffers.Test/ServiceTest.cs @@ -37,9 +37,10 @@ using System; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Rhino.Mocks; using Rhino.Mocks.Constraints; +using Is = Rhino.Mocks.Constraints.Is; namespace Google.ProtocolBuffers { @@ -47,7 +48,7 @@ namespace Google.ProtocolBuffers /// Tests for generated service classes. /// TODO(jonskeet): Convert the mocking tests using Rhino.Mocks. /// - [TestFixture] + [TestClass] public class ServiceTest { private delegate void Action(T1 t1, T2 t2); @@ -55,7 +56,7 @@ namespace Google.ProtocolBuffers private static readonly MethodDescriptor FooDescriptor = TestGenericService.Descriptor.Methods[0]; private static readonly MethodDescriptor BarDescriptor = TestGenericService.Descriptor.Methods[1]; - [Test] + [TestMethod] public void GetRequestPrototype() { TestGenericService service = new TestServiceImpl(); @@ -64,7 +65,7 @@ namespace Google.ProtocolBuffers Assert.AreSame(service.GetRequestPrototype(BarDescriptor), BarRequest.DefaultInstance); } - [Test] + [TestMethod] public void GetResponsePrototype() { TestGenericService service = new TestServiceImpl(); @@ -73,7 +74,7 @@ namespace Google.ProtocolBuffers Assert.AreSame(service.GetResponsePrototype(BarDescriptor), BarResponse.DefaultInstance); } - [Test] + [TestMethod] public void CallMethodFoo() { MockRepository mocks = new MockRepository(); @@ -117,8 +118,8 @@ namespace Google.ProtocolBuffers /// that the choice between Foo and Bar is arbitrary, hence the lack of a corresponding Bar /// test. /// - [Test] - [Ignore("Crashes Mono - needs further investigation")] + [TestMethod] + [Ignore, System.ComponentModel.Description("Crashes Mono - needs further investigation")] public void GeneratedStubFooCall() { FooRequest fooRequest = FooRequest.CreateBuilder().Build(); @@ -144,7 +145,7 @@ namespace Google.ProtocolBuffers mocks.VerifyAll(); } - [Test] + [TestMethod] public void CallMethodBar() { MockRepository mocks = new MockRepository(); diff --git a/src/ProtocolBuffers.Test/TestCornerCases.cs b/src/ProtocolBuffers.Test/TestCornerCases.cs index 8a3fe051d6..0be4e1d4e3 100644 --- a/src/ProtocolBuffers.Test/TestCornerCases.cs +++ b/src/ProtocolBuffers.Test/TestCornerCases.cs @@ -1,15 +1,15 @@ using System; using System.Collections.Generic; using System.Text; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using UnitTest.Issues.TestProtos; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class TestCornerCases { - [Test] + [TestMethod] public void TestRoundTripNegativeEnums() { NegativeEnumMessage msg = NegativeEnumMessage.CreateBuilder() diff --git a/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs b/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs index 619f4357bc..c16f567ffa 100644 --- a/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs +++ b/src/ProtocolBuffers.Test/TestMimeMessageFormats.cs @@ -5,11 +5,11 @@ using System.Text; using Google.ProtocolBuffers.Serialization; using Google.ProtocolBuffers.Serialization.Http; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class TestMimeMessageFormats { // There is a whole host of various json mime types in use around the net, this is the set we accept... @@ -17,7 +17,7 @@ namespace Google.ProtocolBuffers readonly IEnumerable XmlTypes = new string[] { "text/xml", "application/xml" }; readonly IEnumerable ProtobufTypes = new string[] { "application/binary", "application/x-protobuf", "application/vnd.google.protobuf" }; - [Test] + [TestMethod] public void TestReadJsonMimeTypes() { foreach (string type in JsonTypes) @@ -30,7 +30,7 @@ namespace Google.ProtocolBuffers MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) is JsonFormatReader); } - [Test] + [TestMethod] public void TestWriteJsonMimeTypes() { foreach (string type in JsonTypes) @@ -43,7 +43,7 @@ namespace Google.ProtocolBuffers MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/json" }, null, Stream.Null) is JsonFormatWriter); } - [Test] + [TestMethod] public void TestReadXmlMimeTypes() { foreach (string type in XmlTypes) @@ -56,7 +56,7 @@ namespace Google.ProtocolBuffers MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) is XmlFormatReader); } - [Test] + [TestMethod] public void TestWriteXmlMimeTypes() { foreach (string type in XmlTypes) @@ -69,7 +69,7 @@ namespace Google.ProtocolBuffers MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/xml" }, null, Stream.Null) is XmlFormatWriter); } - [Test] + [TestMethod] public void TestReadProtoMimeTypes() { foreach (string type in ProtobufTypes) @@ -82,7 +82,7 @@ namespace Google.ProtocolBuffers MessageFormatFactory.CreateInputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) is CodedInputStream); } - [Test] + [TestMethod] public void TestWriteProtoMimeTypes() { foreach (string type in ProtobufTypes) @@ -95,29 +95,29 @@ namespace Google.ProtocolBuffers MessageFormatFactory.CreateOutputStream(new MessageFormatOptions() { DefaultContentType = "application/vnd.google.protobuf" }, null, Stream.Null) is CodedOutputStream); } - [Test] + [TestMethod] public void TestMergeFromJsonType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), - new MessageFormatOptions(), "application/json", new MemoryStream(Encoding.ASCII.GetBytes( + new MessageFormatOptions(), "application/json", new MemoryStream(Encoding.UTF8.GetBytes( Extensions.ToJson(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) ))) .Build(); Assert.AreEqual("a", msg.Text); Assert.AreEqual(1, msg.Number); } - [Test] + [TestMethod] public void TestMergeFromXmlType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), - new MessageFormatOptions(), "application/xml", new MemoryStream(Encoding.ASCII.GetBytes( + new MessageFormatOptions(), "application/xml", new MemoryStream(Encoding.UTF8.GetBytes( Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) ))) .Build(); Assert.AreEqual("a", msg.Text); Assert.AreEqual(1, msg.Number); } - [Test] + [TestMethod] public void TestMergeFromProtoType() { TestXmlMessage msg = Extensions.MergeFrom(new TestXmlMessage.Builder(), @@ -128,25 +128,25 @@ namespace Google.ProtocolBuffers Assert.AreEqual("a", msg.Text); Assert.AreEqual(1, msg.Number); } - [Test] + [TestMethod] public void TestWriteToJsonType() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions(), "application/json", ms); - Assert.AreEqual(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray())); + Assert.AreEqual(@"{""text"":""a"",""number"":1}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Test] + [TestMethod] public void TestWriteToXmlType() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions(), "application/xml", ms); - Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray())); + Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Test] + [TestMethod] public void TestWriteToProtoType() { MemoryStream ms = new MemoryStream(); @@ -154,9 +154,9 @@ namespace Google.ProtocolBuffers new MessageFormatOptions(), "application/vnd.google.protobuf", ms); byte[] bytes = TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build().ToByteArray(); - Assert.AreEqual(bytes, ms.ToArray()); + TestUtil.AssertBytesEqual(bytes, ms.ToArray()); } - [Test] + [TestMethod] public void TestXmlReaderOptions() { MemoryStream ms = new MemoryStream(); @@ -180,7 +180,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, msg.NumbersList[1]); } - [Test] + [TestMethod] public void TestXmlWriterOptions() { TestXmlMessage message = TestXmlMessage.CreateBuilder().SetText("a").AddNumbers(1).AddNumbers(2).Build(); @@ -203,26 +203,26 @@ namespace Google.ProtocolBuffers Assert.AreEqual(1, builder.NumbersList[0]); Assert.AreEqual(2, builder.NumbersList[1]); } - [Test] + [TestMethod] public void TestJsonFormatted() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions() { FormattedOutput = true }, "application/json", ms); - Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray())); + Assert.AreEqual("{\r\n \"text\": \"a\",\r\n \"number\": 1\r\n}", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Test] + [TestMethod] public void TestXmlFormatted() { MemoryStream ms = new MemoryStream(); Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), new MessageFormatOptions() { FormattedOutput = true }, "application/xml", ms); - Assert.AreEqual("\r\n a\r\n 1\r\n", Encoding.UTF8.GetString(ms.ToArray())); + Assert.AreEqual("\r\n a\r\n 1\r\n", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } - [Test] + [TestMethod] public void TestReadCustomMimeTypes() { var options = new MessageFormatOptions(); @@ -232,7 +232,7 @@ namespace Google.ProtocolBuffers options.MimeInputTypes.Add("-custom-XML-mime-type-", XmlFormatReader.CreateInstance); Assert.AreEqual(1, options.MimeInputTypes.Count); - Stream xmlStream = new MemoryStream(Encoding.ASCII.GetBytes( + Stream xmlStream = new MemoryStream(Encoding.UTF8.GetBytes( Extensions.ToXml(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build()) )); @@ -243,7 +243,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(1, msg.Number); } - [Test] + [TestMethod] public void TestWriteToCustomType() { var options = new MessageFormatOptions(); @@ -258,7 +258,7 @@ namespace Google.ProtocolBuffers Extensions.WriteTo(TestXmlMessage.CreateBuilder().SetText("a").SetNumber(1).Build(), options, "-custom-XML-mime-type-", ms); - Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray())); + Assert.AreEqual("a1", Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length)); } } } \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs index ce8f66d945..b9d9b0bec9 100644 --- a/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs +++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestRpcInterop.cs @@ -1391,7 +1391,7 @@ namespace Google.ProtocolBuffers.TestProtos { public SearchService(pb::IRpcDispatch dispatch) : this(dispatch, true) { } public SearchService(pb::IRpcDispatch dispatch, bool dispose) { - if (null == (this.dispatch = dispatch)) throw new global::System.ArgumentNullException(); + pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, "dispatch"); this.dispose = dispose && dispatch is global::System.IDisposable; } @@ -1421,7 +1421,7 @@ namespace Google.ProtocolBuffers.TestProtos { public Dispatch(ISearchService implementation) : this(implementation, true) { } public Dispatch(ISearchService implementation, bool dispose) { - if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException(); + pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); this.dispose = dispose && implementation is global::System.IDisposable; } @@ -1435,7 +1435,7 @@ namespace Google.ProtocolBuffers.TestProtos { switch(methodName) { case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build(); case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build(); - default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName); + default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); } } } @@ -1453,7 +1453,7 @@ namespace Google.ProtocolBuffers.TestProtos { public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) { } public ServerStub(pb::IRpcDispatch implementation, bool dispose) { - if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException(); + pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); this.dispose = dispose && implementation is global::System.IDisposable; } @@ -1465,7 +1465,7 @@ namespace Google.ProtocolBuffers.TestProtos { switch(methodName) { case "Search": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.SearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); case "RefineSearch": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName); + default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); } } } diff --git a/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs b/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs index 7861e9860a..1c43e24da5 100644 --- a/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs +++ b/src/ProtocolBuffers.Test/TestReaderForUrlEncoded.cs @@ -1,16 +1,16 @@ using System; using System.IO; using System.Text; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.Serialization.Http; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class TestReaderForUrlEncoded { - [Test] + [TestMethod] public void Example_FromQueryString() { Uri sampleUri = new Uri("http://sample.com/Path/File.ext?text=two+three%20four&valid=true&numbers=1&numbers=2", UriKind.Absolute); @@ -28,7 +28,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, message.NumbersList[1]); } - [Test] + [TestMethod] public void Example_FromFormData() { Stream rawPost = new MemoryStream(Encoding.UTF8.GetBytes("text=two+three%20four&valid=true&numbers=1&numbers=2"), false); @@ -46,7 +46,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, message.NumbersList[1]); } - [Test] + [TestMethod] public void TestEmptyValues() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text=&numbers=1"); @@ -60,7 +60,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(1, builder.NumbersList[0]); } - [Test] + [TestMethod] public void TestNoValue() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text&numbers=1"); @@ -74,7 +74,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(1, builder.NumbersList[0]); } - [Test, ExpectedException(typeof(NotSupportedException))] + [TestMethod, ExpectedException(typeof(NotSupportedException))] public void FormUrlEncodedReaderDoesNotSupportChildren() { ICodedInputStream input = FormUrlEncodedReader.CreateInstance("child=uh0"); diff --git a/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs b/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs index 6575e0fd1b..68cb93da3f 100644 --- a/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs +++ b/src/ProtocolBuffers.Test/TestRpcForMimeTypes.cs @@ -38,7 +38,7 @@ using System; using Google.ProtocolBuffers; using Google.ProtocolBuffers.Serialization.Http; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System.IO; using Google.ProtocolBuffers.Serialization; using System.Text; @@ -49,7 +49,7 @@ namespace Google.ProtocolBuffers /// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration /// of using the new IRpcDispatch to write a client/server /// - [TestFixture] + [TestClass] public class TestRpcForMimeTypes { /// @@ -181,7 +181,7 @@ namespace Google.ProtocolBuffers /// /// Test sending and recieving messages via text/json /// - [Test] + [TestMethod] public void TestClientServerWithJsonFormat() { ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); @@ -210,7 +210,7 @@ namespace Google.ProtocolBuffers /// /// Test sending and recieving messages via text/json /// - [Test] + [TestMethod] public void TestClientServerWithXmlFormat() { ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); @@ -239,7 +239,7 @@ namespace Google.ProtocolBuffers /// /// Test sending and recieving messages via text/json /// - [Test] + [TestMethod] public void TestClientServerWithProtoFormat() { ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); @@ -268,7 +268,7 @@ namespace Google.ProtocolBuffers /// /// Test sending and recieving messages via text/json /// - [Test] + [TestMethod] public void TestClientServerWithCustomFormat() { ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); @@ -308,7 +308,7 @@ namespace Google.ProtocolBuffers /// /// Test sending and recieving messages via text/json /// - [Test] + [TestMethod] public void TestServerWithUriFormat() { ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); @@ -336,7 +336,7 @@ namespace Google.ProtocolBuffers /// /// Test sending and recieving messages via text/json /// - [Test, ExpectedException(typeof(ArgumentOutOfRangeException))] + [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] public void TestInvalidMimeType() { ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); @@ -357,7 +357,7 @@ namespace Google.ProtocolBuffers /// /// Test sending and recieving messages via text/json /// - [Test] + [TestMethod] public void TestDefaultMimeType() { ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); diff --git a/src/ProtocolBuffers.Test/TestRpcGenerator.cs b/src/ProtocolBuffers.Test/TestRpcGenerator.cs index 5f159b6273..18532d6901 100644 --- a/src/ProtocolBuffers.Test/TestRpcGenerator.cs +++ b/src/ProtocolBuffers.Test/TestRpcGenerator.cs @@ -37,7 +37,7 @@ using System; using Google.ProtocolBuffers; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers { @@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers /// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration /// of using the new IRpcDispatch to write a client/server /// - [TestFixture] + [TestClass] public class TestRpcGenerator { /// @@ -142,7 +142,7 @@ namespace Google.ProtocolBuffers /// Put it all together to create one seamless client/server experience full of rich-type goodness ;) /// All you need to do is send/recieve the method name and message bytes across the wire. /// - [Test] + [TestMethod] public void TestClientServerDispatch() { ExampleServerHost server = new ExampleServerHost(new ExampleSearchImpl()); diff --git a/src/ProtocolBuffers.Test/TestUtil.cs b/src/ProtocolBuffers.Test/TestUtil.cs index ae2c1164e1..dd1c981d94 100644 --- a/src/ProtocolBuffers.Test/TestUtil.cs +++ b/src/ProtocolBuffers.Test/TestUtil.cs @@ -41,14 +41,21 @@ using System.IO; using System.Text; using System.Threading; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +#if SILVERLIGHT +using TestClass = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute; +using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute; +using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; +#else +using Microsoft.VisualStudio.TestTools.UnitTesting; +#endif + namespace Google.ProtocolBuffers { internal static class TestUtil { +#if !SILVERLIGHT private static string testDataDirectory; - private static ByteString goldenMessage = null; internal static string TestDataDirectory { @@ -76,6 +83,8 @@ namespace Google.ProtocolBuffers } } + private static ByteString goldenMessage = null; + internal static ByteString GoldenMessage { get @@ -88,6 +97,36 @@ namespace Google.ProtocolBuffers } } + internal static string ReadTextFromFile(string filePath) + { + return ReadBytesFromFile(filePath).ToStringUtf8(); + } + + internal static ByteString ReadBytesFromFile(String filename) + { + byte[] data = File.ReadAllBytes(Path.Combine(TestDataDirectory, filename)); + return ByteString.CopyFrom(data); + } + + private static ByteString goldenPackedFieldsMessage = null; + + /// + /// Get the bytes of the "golden packed fields message". This is a serialized + /// TestPackedTypes with all fields set as they would be by SetPackedFields, + /// but it is loaded from a file on disk rather than generated dynamically. + /// The file is actually generated by C++ code, so testing against it verifies compatibility + /// with C++. + /// + public static ByteString GetGoldenPackedFieldsMessage() + { + if (goldenPackedFieldsMessage == null) + { + goldenPackedFieldsMessage = ReadBytesFromFile("golden_packed_fields_message"); + } + return goldenPackedFieldsMessage; + } + +#endif /// /// Creates an unmodifiable ExtensionRegistry containing all the extensions /// of TestAllExtensions. @@ -193,17 +232,6 @@ namespace Google.ProtocolBuffers registry.Add(UnitTestProtoFile.PackedEnumExtension); } - internal static string ReadTextFromFile(string filePath) - { - return ReadBytesFromFile(filePath).ToStringUtf8(); - } - - internal static ByteString ReadBytesFromFile(String filename) - { - byte[] data = File.ReadAllBytes(Path.Combine(TestDataDirectory, filename)); - return ByteString.CopyFrom(data); - } - /// /// Helper to convert a String to ByteString. /// @@ -379,12 +407,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(101, message.OptionalInt32); Assert.AreEqual(102, message.OptionalInt64); - Assert.AreEqual(103, message.OptionalUint32); - Assert.AreEqual(104, message.OptionalUint64); + Assert.AreEqual(103u, message.OptionalUint32); + Assert.AreEqual(104u, message.OptionalUint64); Assert.AreEqual(105, message.OptionalSint32); Assert.AreEqual(106, message.OptionalSint64); - Assert.AreEqual(107, message.OptionalFixed32); - Assert.AreEqual(108, message.OptionalFixed64); + Assert.AreEqual(107u, message.OptionalFixed32); + Assert.AreEqual(108u, message.OptionalFixed64); Assert.AreEqual(109, message.OptionalSfixed32); Assert.AreEqual(110, message.OptionalSfixed64); Assert.AreEqual(111, message.OptionalFloat); @@ -436,12 +464,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(201, message.GetRepeatedInt32(0)); Assert.AreEqual(202, message.GetRepeatedInt64(0)); - Assert.AreEqual(203, message.GetRepeatedUint32(0)); - Assert.AreEqual(204, message.GetRepeatedUint64(0)); + Assert.AreEqual(203u, message.GetRepeatedUint32(0)); + Assert.AreEqual(204u, message.GetRepeatedUint64(0)); Assert.AreEqual(205, message.GetRepeatedSint32(0)); Assert.AreEqual(206, message.GetRepeatedSint64(0)); - Assert.AreEqual(207, message.GetRepeatedFixed32(0)); - Assert.AreEqual(208, message.GetRepeatedFixed64(0)); + Assert.AreEqual(207u, message.GetRepeatedFixed32(0)); + Assert.AreEqual(208u, message.GetRepeatedFixed64(0)); Assert.AreEqual(209, message.GetRepeatedSfixed32(0)); Assert.AreEqual(210, message.GetRepeatedSfixed64(0)); Assert.AreEqual(211, message.GetRepeatedFloat(0)); @@ -464,12 +492,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(301, message.GetRepeatedInt32(1)); Assert.AreEqual(302, message.GetRepeatedInt64(1)); - Assert.AreEqual(303, message.GetRepeatedUint32(1)); - Assert.AreEqual(304, message.GetRepeatedUint64(1)); + Assert.AreEqual(303u, message.GetRepeatedUint32(1)); + Assert.AreEqual(304u, message.GetRepeatedUint64(1)); Assert.AreEqual(305, message.GetRepeatedSint32(1)); Assert.AreEqual(306, message.GetRepeatedSint64(1)); - Assert.AreEqual(307, message.GetRepeatedFixed32(1)); - Assert.AreEqual(308, message.GetRepeatedFixed64(1)); + Assert.AreEqual(307u, message.GetRepeatedFixed32(1)); + Assert.AreEqual(308u, message.GetRepeatedFixed64(1)); Assert.AreEqual(309, message.GetRepeatedSfixed32(1)); Assert.AreEqual(310, message.GetRepeatedSfixed64(1)); Assert.AreEqual(311, message.GetRepeatedFloat(1), 0.0); @@ -517,12 +545,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(401, message.DefaultInt32); Assert.AreEqual(402, message.DefaultInt64); - Assert.AreEqual(403, message.DefaultUint32); - Assert.AreEqual(404, message.DefaultUint64); + Assert.AreEqual(403u, message.DefaultUint32); + Assert.AreEqual(404u, message.DefaultUint64); Assert.AreEqual(405, message.DefaultSint32); Assert.AreEqual(406, message.DefaultSint64); - Assert.AreEqual(407, message.DefaultFixed32); - Assert.AreEqual(408, message.DefaultFixed64); + Assert.AreEqual(407u, message.DefaultFixed32); + Assert.AreEqual(408u, message.DefaultFixed64); Assert.AreEqual(409, message.DefaultSfixed32); Assert.AreEqual(410, message.DefaultSfixed64); Assert.AreEqual(411, message.DefaultFloat); @@ -573,12 +601,12 @@ namespace Google.ProtocolBuffers // Optional fields without defaults are set to zero or something like it. Assert.AreEqual(0, message.OptionalInt32); Assert.AreEqual(0, message.OptionalInt64); - Assert.AreEqual(0, message.OptionalUint32); - Assert.AreEqual(0, message.OptionalUint64); + Assert.AreEqual(0u, message.OptionalUint32); + Assert.AreEqual(0u, message.OptionalUint64); Assert.AreEqual(0, message.OptionalSint32); Assert.AreEqual(0, message.OptionalSint64); - Assert.AreEqual(0, message.OptionalFixed32); - Assert.AreEqual(0, message.OptionalFixed64); + Assert.AreEqual(0u, message.OptionalFixed32); + Assert.AreEqual(0u, message.OptionalFixed64); Assert.AreEqual(0, message.OptionalSfixed32); Assert.AreEqual(0, message.OptionalSfixed64); Assert.AreEqual(0, message.OptionalFloat); @@ -661,12 +689,12 @@ namespace Google.ProtocolBuffers // Fields with defaults have their default values (duh). Assert.AreEqual(41, message.DefaultInt32); Assert.AreEqual(42, message.DefaultInt64); - Assert.AreEqual(43, message.DefaultUint32); - Assert.AreEqual(44, message.DefaultUint64); + Assert.AreEqual(43u, message.DefaultUint32); + Assert.AreEqual(44u, message.DefaultUint64); Assert.AreEqual(-45, message.DefaultSint32); Assert.AreEqual(46, message.DefaultSint64); - Assert.AreEqual(47, message.DefaultFixed32); - Assert.AreEqual(48, message.DefaultFixed64); + Assert.AreEqual(47u, message.DefaultFixed32); + Assert.AreEqual(48u, message.DefaultFixed64); Assert.AreEqual(49, message.DefaultSfixed32); Assert.AreEqual(-50, message.DefaultSfixed64); Assert.AreEqual(51.5, message.DefaultFloat, 0.0); @@ -1531,12 +1559,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, message.PackedEnumCount); Assert.AreEqual(601, message.GetPackedInt32(0)); Assert.AreEqual(602, message.GetPackedInt64(0)); - Assert.AreEqual(603, message.GetPackedUint32(0)); - Assert.AreEqual(604, message.GetPackedUint64(0)); + Assert.AreEqual(603u, message.GetPackedUint32(0)); + Assert.AreEqual(604u, message.GetPackedUint64(0)); Assert.AreEqual(605, message.GetPackedSint32(0)); Assert.AreEqual(606, message.GetPackedSint64(0)); - Assert.AreEqual(607, message.GetPackedFixed32(0)); - Assert.AreEqual(608, message.GetPackedFixed64(0)); + Assert.AreEqual(607u, message.GetPackedFixed32(0)); + Assert.AreEqual(608u, message.GetPackedFixed64(0)); Assert.AreEqual(609, message.GetPackedSfixed32(0)); Assert.AreEqual(610, message.GetPackedSfixed64(0)); Assert.AreEqual(611, message.GetPackedFloat(0), 0.0); @@ -1545,12 +1573,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetPackedEnum(0)); Assert.AreEqual(701, message.GetPackedInt32(1)); Assert.AreEqual(702, message.GetPackedInt64(1)); - Assert.AreEqual(703, message.GetPackedUint32(1)); - Assert.AreEqual(704, message.GetPackedUint64(1)); + Assert.AreEqual(703u, message.GetPackedUint32(1)); + Assert.AreEqual(704u, message.GetPackedUint64(1)); Assert.AreEqual(705, message.GetPackedSint32(1)); Assert.AreEqual(706, message.GetPackedSint64(1)); - Assert.AreEqual(707, message.GetPackedFixed32(1)); - Assert.AreEqual(708, message.GetPackedFixed64(1)); + Assert.AreEqual(707u, message.GetPackedFixed32(1)); + Assert.AreEqual(708u, message.GetPackedFixed64(1)); Assert.AreEqual(709, message.GetPackedSfixed32(1)); Assert.AreEqual(710, message.GetPackedSfixed64(1)); Assert.AreEqual(711, message.GetPackedFloat(1), 0.0); @@ -1580,12 +1608,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, message.UnpackedEnumCount); Assert.AreEqual(601, message.GetUnpackedInt32(0)); Assert.AreEqual(602, message.GetUnpackedInt64(0)); - Assert.AreEqual(603, message.GetUnpackedUint32(0)); - Assert.AreEqual(604, message.GetUnpackedUint64(0)); + Assert.AreEqual(603u, message.GetUnpackedUint32(0)); + Assert.AreEqual(604u, message.GetUnpackedUint64(0)); Assert.AreEqual(605, message.GetUnpackedSint32(0)); Assert.AreEqual(606, message.GetUnpackedSint64(0)); - Assert.AreEqual(607, message.GetUnpackedFixed32(0)); - Assert.AreEqual(608, message.GetUnpackedFixed64(0)); + Assert.AreEqual(607u, message.GetUnpackedFixed32(0)); + Assert.AreEqual(608u, message.GetUnpackedFixed64(0)); Assert.AreEqual(609, message.GetUnpackedSfixed32(0)); Assert.AreEqual(610, message.GetUnpackedSfixed64(0)); Assert.AreEqual(611, message.GetUnpackedFloat(0), 0.0); @@ -1594,12 +1622,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(ForeignEnum.FOREIGN_BAR, message.GetUnpackedEnum(0)); Assert.AreEqual(701, message.GetUnpackedInt32(1)); Assert.AreEqual(702, message.GetUnpackedInt64(1)); - Assert.AreEqual(703, message.GetUnpackedUint32(1)); - Assert.AreEqual(704, message.GetUnpackedUint64(1)); + Assert.AreEqual(703u, message.GetUnpackedUint32(1)); + Assert.AreEqual(704u, message.GetUnpackedUint64(1)); Assert.AreEqual(705, message.GetUnpackedSint32(1)); Assert.AreEqual(706, message.GetUnpackedSint64(1)); - Assert.AreEqual(707, message.GetUnpackedFixed32(1)); - Assert.AreEqual(708, message.GetUnpackedFixed64(1)); + Assert.AreEqual(707u, message.GetUnpackedFixed32(1)); + Assert.AreEqual(708u, message.GetUnpackedFixed64(1)); Assert.AreEqual(709, message.GetUnpackedSfixed32(1)); Assert.AreEqual(710, message.GetUnpackedSfixed64(1)); Assert.AreEqual(711, message.GetUnpackedFloat(1), 0.0); @@ -1659,12 +1687,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, message.GetExtensionCount(UnitTestProtoFile.PackedEnumExtension)); Assert.AreEqual(601, message.GetExtension(UnitTestProtoFile.PackedInt32Extension, 0)); Assert.AreEqual(602L, message.GetExtension(UnitTestProtoFile.PackedInt64Extension, 0)); - Assert.AreEqual(603, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 0)); - Assert.AreEqual(604L, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 0)); + Assert.AreEqual(603u, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 0)); + Assert.AreEqual(604uL, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 0)); Assert.AreEqual(605, message.GetExtension(UnitTestProtoFile.PackedSint32Extension, 0)); Assert.AreEqual(606L, message.GetExtension(UnitTestProtoFile.PackedSint64Extension, 0)); - Assert.AreEqual(607, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 0)); - Assert.AreEqual(608L, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 0)); + Assert.AreEqual(607u, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 0)); + Assert.AreEqual(608uL, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 0)); Assert.AreEqual(609, message.GetExtension(UnitTestProtoFile.PackedSfixed32Extension, 0)); Assert.AreEqual(610L, message.GetExtension(UnitTestProtoFile.PackedSfixed64Extension, 0)); Assert.AreEqual(611F, message.GetExtension(UnitTestProtoFile.PackedFloatExtension, 0)); @@ -1674,12 +1702,12 @@ namespace Google.ProtocolBuffers message.GetExtension(UnitTestProtoFile.PackedEnumExtension, 0)); Assert.AreEqual(701, message.GetExtension(UnitTestProtoFile.PackedInt32Extension, 1)); Assert.AreEqual(702L, message.GetExtension(UnitTestProtoFile.PackedInt64Extension, 1)); - Assert.AreEqual(703, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 1)); - Assert.AreEqual(704L, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 1)); + Assert.AreEqual(703u, message.GetExtension(UnitTestProtoFile.PackedUint32Extension, 1)); + Assert.AreEqual(704uL, message.GetExtension(UnitTestProtoFile.PackedUint64Extension, 1)); Assert.AreEqual(705, message.GetExtension(UnitTestProtoFile.PackedSint32Extension, 1)); Assert.AreEqual(706L, message.GetExtension(UnitTestProtoFile.PackedSint64Extension, 1)); - Assert.AreEqual(707, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 1)); - Assert.AreEqual(708L, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 1)); + Assert.AreEqual(707u, message.GetExtension(UnitTestProtoFile.PackedFixed32Extension, 1)); + Assert.AreEqual(708uL, message.GetExtension(UnitTestProtoFile.PackedFixed64Extension, 1)); Assert.AreEqual(709, message.GetExtension(UnitTestProtoFile.PackedSfixed32Extension, 1)); Assert.AreEqual(710L, message.GetExtension(UnitTestProtoFile.PackedSfixed64Extension, 1)); Assert.AreEqual(711F, message.GetExtension(UnitTestProtoFile.PackedFloatExtension, 1)); @@ -1706,12 +1734,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2, message.GetExtensionCount(UnitTestExtrasProtoFile.UnpackedEnumExtension)); Assert.AreEqual(601, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt32Extension, 0)); Assert.AreEqual(602L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt64Extension, 0)); - Assert.AreEqual(603, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 0)); - Assert.AreEqual(604L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 0)); + Assert.AreEqual(603u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 0)); + Assert.AreEqual(604uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 0)); Assert.AreEqual(605, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint32Extension, 0)); Assert.AreEqual(606L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint64Extension, 0)); - Assert.AreEqual(607, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 0)); - Assert.AreEqual(608L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 0)); + Assert.AreEqual(607u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 0)); + Assert.AreEqual(608uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 0)); Assert.AreEqual(609, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed32Extension, 0)); Assert.AreEqual(610L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed64Extension, 0)); Assert.AreEqual(611F, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFloatExtension, 0)); @@ -1721,12 +1749,12 @@ namespace Google.ProtocolBuffers message.GetExtension(UnitTestExtrasProtoFile.UnpackedEnumExtension, 0)); Assert.AreEqual(701, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt32Extension, 1)); Assert.AreEqual(702L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedInt64Extension, 1)); - Assert.AreEqual(703, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 1)); - Assert.AreEqual(704L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 1)); + Assert.AreEqual(703u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint32Extension, 1)); + Assert.AreEqual(704uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedUint64Extension, 1)); Assert.AreEqual(705, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint32Extension, 1)); Assert.AreEqual(706L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSint64Extension, 1)); - Assert.AreEqual(707, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 1)); - Assert.AreEqual(708L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 1)); + Assert.AreEqual(707u, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed32Extension, 1)); + Assert.AreEqual(708uL, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFixed64Extension, 1)); Assert.AreEqual(709, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed32Extension, 1)); Assert.AreEqual(710L, message.GetExtension(UnitTestExtrasProtoFile.UnpackedSfixed64Extension, 1)); Assert.AreEqual(711F, message.GetExtension(UnitTestExtrasProtoFile.UnpackedFloatExtension, 1)); @@ -1735,27 +1763,11 @@ namespace Google.ProtocolBuffers Assert.AreEqual(UnpackedExtensionsForeignEnum.FOREIGN_BAZ, message.GetExtension(UnitTestExtrasProtoFile.UnpackedEnumExtension, 1)); } - private static ByteString goldenPackedFieldsMessage = null; - - /// - /// Get the bytes of the "golden packed fields message". This is a serialized - /// TestPackedTypes with all fields set as they would be by SetPackedFields, - /// but it is loaded from a file on disk rather than generated dynamically. - /// The file is actually generated by C++ code, so testing against it verifies compatibility - /// with C++. - /// - public static ByteString GetGoldenPackedFieldsMessage() - { - if (goldenPackedFieldsMessage == null) - { - goldenPackedFieldsMessage = ReadBytesFromFile("golden_packed_fields_message"); - } - return goldenPackedFieldsMessage; - } - private static readonly string[] TestCultures = {"en-US", "en-GB", "fr-FR", "de-DE"}; - public static void TestInMultipleCultures(Action test) + public delegate void CultureAction(); + + public static void TestInMultipleCultures(CultureAction test) { CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture; foreach (string culture in TestCultures) @@ -1785,6 +1797,22 @@ namespace Google.ProtocolBuffers return bytes; } + + internal delegate void Action(); + + internal static void AssertNotSupported(Action action) + { + try + { + action(); + Assert.Fail("Expected NotSupportedException"); + } + catch (NotSupportedException) + { + // Expected + } + } + internal static void AssertArgumentNullException(Action action) { try @@ -1797,5 +1825,25 @@ namespace Google.ProtocolBuffers // We expect this exception. } } + + internal static void AssertBytesEqual(byte[] a, byte[]b) + { + if (a == null || b == null) + { + Assert.AreEqual(a, b); + } + else + { + Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length."); + + for (int i = 0; i < a.Length; i++) + { + if (a[i] != b[i]) + { + Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i); + } + } + } + } } } \ No newline at end of file diff --git a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs b/src/ProtocolBuffers.Test/TestWriterFormatJson.cs index 98215ebc9d..86a3e3002d 100644 --- a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs +++ b/src/ProtocolBuffers.Test/TestWriterFormatJson.cs @@ -2,15 +2,15 @@ using System; using System.IO; using System.Text; using Google.ProtocolBuffers.Serialization; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class TestWriterFormatJson { - [Test] + [TestMethod] public void Example_FromJson() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -22,7 +22,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(true, message.Valid); } - [Test] + [TestMethod] public void Example_ToJson() { TestXmlMessage message = @@ -36,7 +36,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(@"{""valid"":true}", json); } - [Test] + [TestMethod] public void Example_WriteJsonUsingICodedOutputStream() { TestXmlMessage message = @@ -63,7 +63,7 @@ namespace Google.ProtocolBuffers } } - [Test] + [TestMethod] public void Example_ReadJsonUsingICodedInputStream() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -98,7 +98,7 @@ namespace Google.ProtocolBuffers Assert.IsTrue(Content.IndexOf(expect) >= 0, "Expected to find content '{0}' in: \r\n{1}", expect, Content); } - [Test] + [TestMethod] public void TestToJsonParseFromJson() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); @@ -109,7 +109,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(msg, copy); } - [Test] + [TestMethod] public void TestToJsonParseFromJsonReader() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); @@ -120,7 +120,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(msg, copy); } - [Test] + [TestMethod] public void TestJsonFormatted() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -143,7 +143,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestEmptyMessage() { FormatterAssert( @@ -152,7 +152,7 @@ namespace Google.ProtocolBuffers @"{}" ); } - [Test] + [TestMethod] public void TestRepeatedField() { FormatterAssert( @@ -163,7 +163,7 @@ namespace Google.ProtocolBuffers @"{""options"":[""ONE"",""TWO""]}" ); } - [Test] + [TestMethod] public void TestNestedEmptyMessage() { FormatterAssert( @@ -173,7 +173,7 @@ namespace Google.ProtocolBuffers @"{""child"":{}}" ); } - [Test] + [TestMethod] public void TestNestedMessage() { FormatterAssert( @@ -183,7 +183,7 @@ namespace Google.ProtocolBuffers @"{""child"":{""options"":[""TWO""]}}" ); } - [Test] + [TestMethod] public void TestBooleanTypes() { FormatterAssert( @@ -193,7 +193,7 @@ namespace Google.ProtocolBuffers @"{""valid"":true}" ); } - [Test] + [TestMethod] public void TestFullMessage() { FormatterAssert( @@ -222,7 +222,7 @@ namespace Google.ProtocolBuffers 0x1010101010L.ToString() ); } - [Test] + [TestMethod] public void TestMessageWithXmlText() { FormatterAssert( @@ -232,7 +232,7 @@ namespace Google.ProtocolBuffers @"{""text"":""<\/text>""}" ); } - [Test] + [TestMethod] public void TestWithEscapeChars() { FormatterAssert( @@ -242,7 +242,7 @@ namespace Google.ProtocolBuffers "{\"text\":\" \\t <- \\\"leading space and trailing\\\" -> \\\\ \\uef54 \\u0000 \\u00ff \\uffff \\b \\f \\r \\n \\t \"}" ); } - [Test] + [TestMethod] public void TestWithExtensionText() { FormatterAssert( @@ -253,7 +253,7 @@ namespace Google.ProtocolBuffers @"{""valid"":false,""extension_text"":"" extension text value ! ""}" ); } - [Test] + [TestMethod] public void TestWithExtensionNumber() { FormatterAssert( @@ -264,7 +264,7 @@ namespace Google.ProtocolBuffers @"{""number"":42}" ); } - [Test] + [TestMethod] public void TestWithExtensionArray() { FormatterAssert( @@ -276,7 +276,7 @@ namespace Google.ProtocolBuffers @"{""extension_number"":[100,101,102]}" ); } - [Test] + [TestMethod] public void TestWithExtensionEnum() { FormatterAssert( @@ -286,7 +286,7 @@ namespace Google.ProtocolBuffers @"{""extension_enum"":""ONE""}" ); } - [Test] + [TestMethod] public void TestMessageWithExtensions() { FormatterAssert( @@ -308,7 +308,7 @@ namespace Google.ProtocolBuffers @"""extension_message"":{""number"":42}" ); } - [Test] + [TestMethod] public void TestMessageMissingExtensions() { TestXmlMessage original = TestXmlMessage.CreateBuilder() @@ -340,7 +340,7 @@ namespace Google.ProtocolBuffers Assert.AreNotEqual(original, copy); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestMergeFields() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -350,7 +350,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual("text", builder.Text); Assert.AreEqual(411, builder.Number); } - [Test] + [TestMethod] public void TestMessageArray() { JsonFormatWriter writer = JsonFormatWriter.CreateInstance().Formatted(); @@ -374,7 +374,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(3, ordinal); Assert.AreEqual(3, builder.TextlinesCount); } - [Test] + [TestMethod] public void TestNestedMessageArray() { JsonFormatWriter writer = JsonFormatWriter.CreateInstance(); @@ -403,7 +403,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(3, ordinal); Assert.AreEqual(3, builder.TextlinesCount); } - [Test] + [TestMethod] public void TestReadWriteJsonWithoutRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -425,7 +425,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(message, copy); } - [Test,ExpectedException(typeof(RecursionLimitExceededException))] + [TestMethod,ExpectedException(typeof(RecursionLimitExceededException))] public void TestRecursiveLimit() { StringBuilder sb = new StringBuilder(8192); @@ -433,25 +433,25 @@ namespace Google.ProtocolBuffers sb.Append("{\"child\":"); TestXmlRescursive msg = Extensions.MergeFromJson(new TestXmlRescursive.Builder(), sb.ToString()).Build(); } - [Test, ExpectedException(typeof(FormatException))] + [TestMethod, ExpectedException(typeof(FormatException))] public void FailWithEmptyText() { JsonFormatReader.CreateInstance("") .Merge(TestXmlMessage.CreateBuilder()); } - [Test, ExpectedException(typeof(FormatException))] + [TestMethod, ExpectedException(typeof(FormatException))] public void FailWithUnexpectedValue() { JsonFormatReader.CreateInstance("{{}}") .Merge(TestXmlMessage.CreateBuilder()); } - [Test, ExpectedException(typeof(FormatException))] + [TestMethod, ExpectedException(typeof(FormatException))] public void FailWithUnQuotedName() { JsonFormatReader.CreateInstance("{name:{}}") .Merge(TestXmlMessage.CreateBuilder()); } - [Test, ExpectedException(typeof(FormatException))] + [TestMethod, ExpectedException(typeof(FormatException))] public void FailWithUnexpectedType() { JsonFormatReader.CreateInstance("{\"valid\":{}}") diff --git a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs b/src/ProtocolBuffers.Test/TestWriterFormatXml.cs index aa4db87520..13ea060b49 100644 --- a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs +++ b/src/ProtocolBuffers.Test/TestWriterFormatXml.cs @@ -4,15 +4,15 @@ using System.IO; using System.Text; using System.Xml; using Google.ProtocolBuffers.Serialization; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using Google.ProtocolBuffers.TestProtos; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class TestWriterFormatXml { - [Test] + [TestMethod] public void Example_FromXml() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -25,7 +25,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(true, message.Valid); } - [Test] + [TestMethod] public void Example_ToXml() { TestXmlMessage message = @@ -39,7 +39,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(@"true", Xml); } - [Test] + [TestMethod] public void Example_WriteXmlUsingICodedOutputStream() { TestXmlMessage message = @@ -60,7 +60,7 @@ namespace Google.ProtocolBuffers } } - [Test] + [TestMethod] public void Example_ReadXmlUsingICodedInputStream() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -73,7 +73,7 @@ namespace Google.ProtocolBuffers reader.ReadMessageEnd(); //manually read the end message '}' } - [Test] + [TestMethod] public void TestToXmlParseFromXml() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); @@ -84,7 +84,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(msg, copy); } - [Test] + [TestMethod] public void TestToXmlParseFromXmlWithRootName() { TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build(); @@ -95,14 +95,14 @@ namespace Google.ProtocolBuffers Assert.AreEqual(msg, copy); } - [Test] + [TestMethod] public void TestEmptyMessage() { TestXmlChild message = TestXmlChild.CreateBuilder() .Build(); StringWriter sw = new StringWriter(); - XmlTextWriter xw = new XmlTextWriter(sw); + XmlWriter xw = XmlWriter.Create(sw); //When we call message.WriteTo, we are responsible for the root element xw.WriteStartElement("root"); @@ -115,7 +115,7 @@ namespace Google.ProtocolBuffers TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestRepeatedField() { TestXmlChild message = TestXmlChild.CreateBuilder() @@ -132,7 +132,7 @@ namespace Google.ProtocolBuffers TestXmlChild copy = rdr.Merge(TestXmlChild.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestNestedEmptyMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -147,7 +147,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestNestedMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -162,7 +162,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestBooleanTypes() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -177,7 +177,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestFullMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -206,7 +206,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestFullMessageWithRichTypes() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -238,7 +238,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestFullMessageWithUnknownFields() { TestXmlMessage origial = TestXmlMessage.CreateBuilder() @@ -281,7 +281,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(TestXmlMessage.DefaultInstance, copy); } - [Test] + [TestMethod] public void TestMessageWithXmlText() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -296,7 +296,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestXmlWithWhitespace() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -311,7 +311,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder()).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestXmlWithExtensionText() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -330,7 +330,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestXmlWithExtensionMessage() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -349,7 +349,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestXmlWithExtensionArray() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -370,7 +370,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestXmlWithExtensionEnum() { TestXmlMessage message = TestXmlMessage.CreateBuilder() @@ -389,7 +389,7 @@ namespace Google.ProtocolBuffers TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build(); Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestXmlReadEmptyRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -402,7 +402,7 @@ namespace Google.ProtocolBuffers reader.ReadMessageEnd(); //manually read the end message '}' } - [Test] + [TestMethod] public void TestXmlReadEmptyChild() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -415,7 +415,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(String.Empty, builder.Text); } - [Test] + [TestMethod] public void TestXmlReadWriteWithoutRoot() { TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder(); @@ -443,7 +443,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(message, copy); } - [Test, ExpectedException(typeof(RecursionLimitExceededException))] + [TestMethod, ExpectedException(typeof(RecursionLimitExceededException))] public void TestRecursiveLimit() { StringBuilder sb = new StringBuilder(8192); diff --git a/src/ProtocolBuffers.Test/TextFormatTest.cs b/src/ProtocolBuffers.Test/TextFormatTest.cs index 49dac2510e..299b2650d1 100644 --- a/src/ProtocolBuffers.Test/TextFormatTest.cs +++ b/src/ProtocolBuffers.Test/TextFormatTest.cs @@ -38,13 +38,13 @@ using System; using System.IO; using System.Text; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Globalization; using System.Threading; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class TextFormatTest { private static readonly string AllFieldsSetText = TestUtil.ReadTextFromFile("text_format_unittest_data.txt"); @@ -90,7 +90,7 @@ namespace Google.ProtocolBuffers /// /// Print TestAllTypes and compare with golden file. /// - [Test] + [TestMethod] public void PrintMessage() { TestUtil.TestInMultipleCultures(() => @@ -104,7 +104,7 @@ namespace Google.ProtocolBuffers /// /// Print TestAllExtensions and compare with golden file. /// - [Test] + [TestMethod] public void PrintExtensions() { string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet()); @@ -115,7 +115,7 @@ namespace Google.ProtocolBuffers /// /// Test printing of unknown fields in a message. /// - [Test] + [TestMethod] public void PrintUnknownFields() { TestEmptyMessage message = @@ -178,7 +178,7 @@ namespace Google.ProtocolBuffers return ByteString.CopyFrom(Encoding.GetEncoding(28591).GetBytes(str)); } - [Test] + [TestMethod] public void PrintExotic() { IMessage message = TestAllTypes.CreateBuilder() @@ -212,7 +212,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(ExoticText, message.ToString()); } - [Test] + [TestMethod] public void PrintMessageSet() { TestMessageSet messageSet = @@ -230,7 +230,7 @@ namespace Google.ProtocolBuffers // ================================================================= - [Test] + [TestMethod] public void Parse() { TestUtil.TestInMultipleCultures(() => @@ -241,7 +241,7 @@ namespace Google.ProtocolBuffers }); } - [Test] + [TestMethod] public void ParseReader() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -249,7 +249,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(builder.Build()); } - [Test] + [TestMethod] public void ParseExtensions() { TestAllExtensions.Builder builder = TestAllExtensions.CreateBuilder(); @@ -259,7 +259,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(builder.Build()); } - [Test] + [TestMethod] public void ParseCompatibility() { string original = "repeated_float: inf\n" + @@ -291,7 +291,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(canonical, builder.Build().ToString()); } - [Test] + [TestMethod] public void ParseExotic() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -302,7 +302,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(ExoticText, builder.Build().ToString()); } - [Test] + [TestMethod] public void ParseMessageSet() { ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); @@ -319,7 +319,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str); } - [Test] + [TestMethod] public void ParseNumericEnum() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -327,7 +327,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(TestAllTypes.Types.NestedEnum.BAR, builder.OptionalNestedEnum); } - [Test] + [TestMethod] public void ParseAngleBrackets() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -336,7 +336,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(1, builder.OptionalGroup.A); } - [Test] + [TestMethod] public void ParseComment() { TestAllTypes.Builder builder = TestAllTypes.CreateBuilder(); @@ -364,7 +364,7 @@ namespace Google.ProtocolBuffers } } - [Test] + [TestMethod] public void ParseErrors() { AssertParseError( @@ -454,7 +454,7 @@ namespace Google.ProtocolBuffers } } - [Test] + [TestMethod] public void Escape() { // Escape sequences. @@ -481,7 +481,7 @@ namespace Google.ProtocolBuffers AssertFormatException(() => TextFormat.UnescapeText("\\")); } - [Test] + [TestMethod] public void ParseInteger() { Assert.AreEqual(0, TextFormat.ParseInt32("0")); @@ -492,10 +492,10 @@ namespace Google.ProtocolBuffers Assert.AreEqual(2147483647, TextFormat.ParseInt32("2147483647")); Assert.AreEqual(-2147483648, TextFormat.ParseInt32("-2147483648")); - Assert.AreEqual(0, TextFormat.ParseUInt32("0")); - Assert.AreEqual(1, TextFormat.ParseUInt32("1")); - Assert.AreEqual(12345, TextFormat.ParseUInt32("12345")); - Assert.AreEqual(2147483647, TextFormat.ParseUInt32("2147483647")); + Assert.AreEqual(0u, TextFormat.ParseUInt32("0")); + Assert.AreEqual(1u, TextFormat.ParseUInt32("1")); + Assert.AreEqual(12345u, TextFormat.ParseUInt32("12345")); + Assert.AreEqual(2147483647u, TextFormat.ParseUInt32("2147483647")); Assert.AreEqual(2147483648U, TextFormat.ParseUInt32("2147483648")); Assert.AreEqual(4294967295U, TextFormat.ParseUInt32("4294967295")); @@ -511,12 +511,12 @@ namespace Google.ProtocolBuffers Assert.AreEqual(9223372036854775807L, TextFormat.ParseInt64("9223372036854775807")); Assert.AreEqual(-9223372036854775808L, TextFormat.ParseInt64("-9223372036854775808")); - Assert.AreEqual(0L, TextFormat.ParseUInt64("0")); - Assert.AreEqual(1L, TextFormat.ParseUInt64("1")); - Assert.AreEqual(12345L, TextFormat.ParseUInt64("12345")); - Assert.AreEqual(2147483647L, TextFormat.ParseUInt64("2147483647")); - Assert.AreEqual(4294967295L, TextFormat.ParseUInt64("4294967295")); - Assert.AreEqual(4294967296L, TextFormat.ParseUInt64("4294967296")); + Assert.AreEqual(0uL, TextFormat.ParseUInt64("0")); + Assert.AreEqual(1uL, TextFormat.ParseUInt64("1")); + Assert.AreEqual(12345uL, TextFormat.ParseUInt64("12345")); + Assert.AreEqual(2147483647uL, TextFormat.ParseUInt64("2147483647")); + Assert.AreEqual(4294967295uL, TextFormat.ParseUInt64("4294967295")); + Assert.AreEqual(4294967296uL, TextFormat.ParseUInt64("4294967296")); Assert.AreEqual(9223372036854775807UL, TextFormat.ParseUInt64("9223372036854775807")); Assert.AreEqual(9223372036854775808UL, TextFormat.ParseUInt64("9223372036854775808")); Assert.AreEqual(18446744073709551615UL, TextFormat.ParseUInt64("18446744073709551615")); @@ -543,7 +543,7 @@ namespace Google.ProtocolBuffers AssertFormatException(() => TextFormat.ParseInt32("abcd")); } - [Test] + [TestMethod] public void ParseLongString() { string longText = diff --git a/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs b/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs index bd3d950ae8..f9bfd84e75 100644 --- a/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs +++ b/src/ProtocolBuffers.Test/UnknownFieldSetTest.cs @@ -38,11 +38,11 @@ using System; using System.Collections.Generic; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class UnknownFieldSetTest { private MessageDescriptor descriptor; @@ -57,7 +57,7 @@ namespace Google.ProtocolBuffers private UnknownFieldSet unknownFields; - [SetUp] + [TestInitialize] public void SetUp() { descriptor = TestAllTypes.Descriptor; @@ -105,7 +105,7 @@ namespace Google.ProtocolBuffers // ================================================================= - [Test] + [TestMethod] public void Varint() { UnknownField field = GetField("optional_int32"); @@ -113,23 +113,23 @@ namespace Google.ProtocolBuffers Assert.AreEqual(allFields.OptionalInt32, (long) field.VarintList[0]); } - [Test] + [TestMethod] public void Fixed32() { UnknownField field = GetField("optional_fixed32"); Assert.AreEqual(1, field.Fixed32List.Count); - Assert.AreEqual(allFields.OptionalFixed32, (int) field.Fixed32List[0]); + Assert.AreEqual(allFields.OptionalFixed32, (int) field.Fixed32List[0]); } - [Test] + [TestMethod] public void Fixed64() { UnknownField field = GetField("optional_fixed64"); Assert.AreEqual(1, field.Fixed64List.Count); - Assert.AreEqual(allFields.OptionalFixed64, (long) field.Fixed64List[0]); + Assert.AreEqual((long)allFields.OptionalFixed64, (long)field.Fixed64List[0]); } - [Test] + [TestMethod] public void LengthDelimited() { UnknownField field = GetField("optional_bytes"); @@ -137,7 +137,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(allFields.OptionalBytes, field.LengthDelimitedList[0]); } - [Test] + [TestMethod] public void Group() { FieldDescriptor nestedFieldDescriptor = @@ -156,7 +156,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(allFields.OptionalGroup.A, (long) nestedField.VarintList[0]); } - [Test] + [TestMethod] public void Serialize() { // Check that serializing the UnknownFieldSet produces the original data again. @@ -164,7 +164,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(allFieldsData, data); } - [Test] + [TestMethod] public void CopyFrom() { TestEmptyMessage message = @@ -173,7 +173,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(emptyMessage.ToString(), message.ToString()); } - [Test] + [TestMethod] public void MergeFrom() { TestEmptyMessage source = @@ -210,7 +210,7 @@ namespace Google.ProtocolBuffers destination.ToString()); } - [Test] + [TestMethod] public void Clear() { UnknownFieldSet fields = @@ -218,7 +218,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(0, fields.FieldDictionary.Count); } - [Test] + [TestMethod] public void ClearMessage() { TestEmptyMessage message = @@ -226,7 +226,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(0, message.SerializedSize); } - [Test] + [TestMethod] public void ParseKnownAndUnknown() { // Test mixing known and unknown fields when parsing. @@ -248,7 +248,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(654321, (long) field.VarintList[0]); } - [Test] + [TestMethod] public void WrongTypeTreatedAsUnknown() { // Test that fields of the wrong wire type are treated like unknown fields @@ -263,7 +263,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(emptyMessage.ToString(), allTypesMessage.ToString()); } - [Test] + [TestMethod] public void UnknownExtensions() { // Make sure fields are properly parsed to the UnknownFieldSet even when @@ -277,7 +277,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(allFieldsData, message.ToByteString()); } - [Test] + [TestMethod] public void WrongExtensionTypeTreatedAsUnknown() { // Test that fields of the wrong wire type are treated like unknown fields @@ -293,7 +293,7 @@ namespace Google.ProtocolBuffers allExtensionsMessage.ToString()); } - [Test] + [TestMethod] public void ParseUnknownEnumValue() { FieldDescriptor singularField = @@ -342,7 +342,7 @@ namespace Google.ProtocolBuffers } } - [Test] + [TestMethod] public void LargeVarint() { ByteString data = @@ -359,7 +359,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(0x7FFFFFFFFFFFFFFFUL, field.VarintList[0]); } - [Test] + [TestMethod] public void EqualsAndHashCode() { UnknownField fixed32Field = UnknownField.CreateBuilder().AddFixed32(1).Build(); diff --git a/src/ProtocolBuffers.Test/WireFormatTest.cs b/src/ProtocolBuffers.Test/WireFormatTest.cs index e390ce0d22..415624e523 100644 --- a/src/ProtocolBuffers.Test/WireFormatTest.cs +++ b/src/ProtocolBuffers.Test/WireFormatTest.cs @@ -38,17 +38,17 @@ using System.IO; using System.Reflection; using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class WireFormatTest { /// /// Keeps the attributes on FieldType and the switch statement in WireFormat in sync. /// - [Test] + [TestMethod] public void FieldTypeToWireTypeMapping() { foreach (FieldInfo field in typeof (FieldType).GetFields(BindingFlags.Static | BindingFlags.Public)) @@ -60,7 +60,7 @@ namespace Google.ProtocolBuffers } } - [Test] + [TestMethod] public void Serialization() { TestAllTypes message = TestUtil.GetAllSet(); @@ -73,7 +73,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(message2); } - [Test] + [TestMethod] public void SerializationPacked() { TestPackedTypes message = TestUtil.GetPackedSet(); @@ -83,7 +83,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedFieldsSet(message2); } - [Test] + [TestMethod] public void SerializeExtensions() { // TestAllTypes and TestAllExtensions should have compatible wire formats, @@ -98,7 +98,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllFieldsSet(message2); } - [Test] + [TestMethod] public void SerializePackedExtensions() { // TestPackedTypes and TestPackedExtensions should have compatible wire @@ -112,7 +112,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(rawBytes, rawBytes2); } - [Test] + [TestMethod] public void SerializeDelimited() { MemoryStream stream = new MemoryStream(); @@ -130,7 +130,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(-1, stream.ReadByte()); } - [Test] + [TestMethod] public void ParseExtensions() { // TestAllTypes and TestAllExtensions should have compatible wire formats, @@ -149,7 +149,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertAllExtensionsSet(message2); } - [Test] + [TestMethod] public void ParsePackedExtensions() { // Ensure that packed extensions can be properly parsed. @@ -162,7 +162,7 @@ namespace Google.ProtocolBuffers TestUtil.AssertPackedExtensionsSet(message2); } - [Test] + [TestMethod] public void ExtensionsSerializedSize() { Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize); @@ -183,7 +183,7 @@ namespace Google.ProtocolBuffers } } - [Test] + [TestMethod] public void InterleavedFieldsAndExtensions() { // Tests that fields are written in order even when extension ranges @@ -214,7 +214,7 @@ namespace Google.ProtocolBuffers private static readonly int TypeId1 = TestMessageSetExtension1.Descriptor.Extensions[0].FieldNumber; private static readonly int TypeId2 = TestMessageSetExtension2.Descriptor.Extensions[0].FieldNumber; - [Test] + [TestMethod] public void SerializeMessageSet() { // Set up a TestMessageSet with two known messages and an unknown one. @@ -256,7 +256,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual("bar", raw.GetItem(2).Message.ToStringUtf8()); } - [Test] + [TestMethod] public void ParseMessageSet() { ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); diff --git a/src/ProtocolBuffers.sln b/src/ProtocolBuffers.sln index 62f9a26f6e..f9c7550247 100644 --- a/src/ProtocolBuffers.sln +++ b/src/ProtocolBuffers.sln @@ -75,6 +75,28 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serializati EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers(Silverlight)", "ProtocolBuffers\ProtocolBuffers(Silverlight).csproj", "{7E4E681E-5D09-43FB-8D9E-35A454730A85}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite(Silverlight)", "ProtocolBuffers\ProtocolBuffersLite(Silverlight).csproj", "{2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C7B69674-7A51-4AC6-8674-0330BA742CE4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{75D5D25A-01A6-4594-957F-5993FB83F450}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization(Silverlight)", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization(Silverlight).csproj", "{72B69A15-E28E-4738-A779-18D76C87D225}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization(Silverlight)", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization(Silverlight).csproj", "{B6CDC03B-EBBD-4F38-9F84-736EC0948090}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test(Silverlight)", "ProtocolBuffers.Test\ProtocolBuffers.Test(Silverlight).csproj", "{D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Silverlight", "Silverlight", "{AC305C07-0DBD-4247-B458-1B739F84F172}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test(Silverlight)", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test(Silverlight).csproj", "{C56950B0-9F97-4250-8945-4B3C2D441FEA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test(Silverlight)", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test(Silverlight).csproj", "{63B8D05E-4581-4B92-B8D5-77E702535C7F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_Silverlight|Any CPU = Debug_Silverlight|Any CPU @@ -83,12 +105,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU - {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU {6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU {DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU @@ -133,12 +153,10 @@ Global {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU {D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU - {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU {6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU {EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU @@ -153,27 +171,80 @@ Global {EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU {EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {231391AF-449C-4A39-986C-AD7F270F4750}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU - {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {231391AF-449C-4A39-986C-AD7F270F4750}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU {231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug_Silverlight|Any CPU.ActiveCfg = Debug|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU - {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release_Silverlight|Any CPU.ActiveCfg = Release|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU {E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU + {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {7E4E681E-5D09-43FB-8D9E-35A454730A85}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {72B69A15-E28E-4738-A779-18D76C87D225}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {72B69A15-E28E-4738-A779-18D76C87D225}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {72B69A15-E28E-4738-A779-18D76C87D225}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {72B69A15-E28E-4738-A779-18D76C87D225}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {72B69A15-E28E-4738-A779-18D76C87D225}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {72B69A15-E28E-4738-A779-18D76C87D225}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {B6CDC03B-EBBD-4F38-9F84-736EC0948090}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {C56950B0-9F97-4250-8945-4B3C2D441FEA}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug_Silverlight|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug_Silverlight|Any CPU.Build.0 = Debug_Silverlight|Any CPU + {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Debug|Any CPU.ActiveCfg = Debug_Silverlight|Any CPU + {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release_Silverlight|Any CPU.ActiveCfg = Release_Silverlight|Any CPU + {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release_Silverlight|Any CPU.Build.0 = Release_Silverlight|Any CPU + {63B8D05E-4581-4B92-B8D5-77E702535C7F}.Release|Any CPU.ActiveCfg = Release_Silverlight|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {C8D3015A-EA39-4F03-AEEC-3FF1F2087A12} = {1F896D5C-5FC2-4671-9216-781CB8187EC7} + {C268DA4C-4004-47DA-AF23-44C983281A68} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} + {EE01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} + {EEFFED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} + {DD01ED24-3750-4567-9A23-1DB676A15610} = {C7B69674-7A51-4AC6-8674-0330BA742CE4} + {A31F5FB2-4FF3-432A-B35B-5CD203606311} = {75D5D25A-01A6-4594-957F-5993FB83F450} + {C7A4A435-2813-41C8-AA87-BD914BA5223D} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} + {D7282E99-2DC3-405B-946F-177DB2FD2AE2} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} + {8F09AF72-3327-4FA7-BC09-070B80221AB9} = {0D7CDA8F-1BBF-4E0F-8D35-31AEA21A96E6} + {2275EE6B-195B-485C-B6F6-CCA01C1B5AE0} = {AC305C07-0DBD-4247-B458-1B739F84F172} + {72B69A15-E28E-4738-A779-18D76C87D225} = {AC305C07-0DBD-4247-B458-1B739F84F172} + {B6CDC03B-EBBD-4F38-9F84-736EC0948090} = {AC305C07-0DBD-4247-B458-1B739F84F172} + {D6C6BFB0-831A-444A-B0D9-11E3E30DA2C2} = {AC305C07-0DBD-4247-B458-1B739F84F172} + {7E4E681E-5D09-43FB-8D9E-35A454730A85} = {AC305C07-0DBD-4247-B458-1B739F84F172} + {C56950B0-9F97-4250-8945-4B3C2D441FEA} = {AC305C07-0DBD-4247-B458-1B739F84F172} + {63B8D05E-4581-4B92-B8D5-77E702535C7F} = {AC305C07-0DBD-4247-B458-1B739F84F172} EndGlobalSection EndGlobal diff --git a/src/ProtocolBuffers/ProtocolBuffers(Silverlight).csproj b/src/ProtocolBuffers/ProtocolBuffers(Silverlight).csproj new file mode 100644 index 0000000000..c539c68f29 --- /dev/null +++ b/src/ProtocolBuffers/ProtocolBuffers(Silverlight).csproj @@ -0,0 +1,162 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {7E4E681E-5D09-43FB-8D9E-35A454730A85} + Library + Properties + Google.ProtocolBuffers + Google.ProtocolBuffers + v2.0 + 512 + true + ..\..\keys\Google.ProtocolBuffers.snk + 3.5 + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + v3.5 + false + true + true + v2.0 + + + true + full + false + bin\Debug_Silverlight\ + $(OutputPath)\$(AssemblyName).xml + 1591, 1570, 1571, 1572, 1573, 1574 + DEBUG;TRACE;SILVERLIGHT + prompt + 4 + true + + + pdbonly + true + bin\Release_Silverlight\ + $(OutputPath)\$(AssemblyName).xml + 1591, 1570, 1571, 1572, 1573, 1574 + TRACE;SILVERLIGHT + prompt + 4 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffers.csproj b/src/ProtocolBuffers/ProtocolBuffers.csproj index 6edab53e27..e473f8b5fd 100644 --- a/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -14,27 +14,7 @@ 512 true ..\..\keys\Google.ProtocolBuffers.snk - - - - 3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v2.0 true @@ -47,7 +27,6 @@ prompt 4 true - AllRules.ruleset pdbonly @@ -59,32 +38,6 @@ prompt 4 true - AllRules.ruleset - - - true - full - false - bin\Debug_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;SILVERLIGHT - prompt - 4 - true - AllRules.ruleset - - - pdbonly - true - bin\Release_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;SILVERLIGHT - prompt - 4 - true - AllRules.ruleset @@ -93,13 +46,9 @@ - - Code - + - - Code - + @@ -140,9 +89,7 @@ - - Code - + @@ -164,9 +111,7 @@ - - Code - + @@ -193,27 +138,7 @@ - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.csproj index 0162d6f1dc..4773c5ad0c 100644 --- a/src/ProtocolBuffers/ProtocolBuffersLite.csproj +++ b/src/ProtocolBuffers/ProtocolBuffersLite.csproj @@ -14,11 +14,7 @@ 512 true ..\..\keys\Google.ProtocolBuffers.snk - - 3.5 - - v2.0 true @@ -27,7 +23,7 @@ bin\Debug\ $(OutputPath)\$(AssemblyName).xml 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;DEBUG;LITE + DEBUG;TRACE;LITE prompt 4 true @@ -43,38 +39,11 @@ 4 true - - true - full - false - bin\Debug_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - DEBUG;TRACE;SILVERLIGHT;LITE - prompt - 4 - true - AllRules.ruleset - - - pdbonly - true - bin\Release_Silverlight\ - $(OutputPath)\$(AssemblyName).xml - 1591, 1570, 1571, 1572, 1573, 1574 - TRACE;SILVERLIGHT;LITE - prompt - 4 - true - AllRules.ruleset - - - @@ -106,19 +75,14 @@ - - Code - + - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj index b846ff1a3f..d10aac15ba 100644 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj +++ b/src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj @@ -39,9 +39,9 @@ true - + False - ..\..\lib\NUnit 2.2.8.0\nunit.framework.dll + ..\..\lib\NUnit\lib\nunit.framework.dll False @@ -53,6 +53,9 @@ + + Microsoft.VisualStudio.TestTools.cs + Properties\AssemblyInfo.cs @@ -73,6 +76,7 @@ + @@ -93,4 +97,10 @@ --> + + Program + $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe + /nologo /noshadow /labels /wait $(AssemblyName).dll + $(ProjectDir)$(OutputPath) + \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test(Silverlight).csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test(Silverlight).csproj new file mode 100644 index 0000000000..424ee70f96 --- /dev/null +++ b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test(Silverlight).csproj @@ -0,0 +1,142 @@ + + + Debug_Silverlight + AnyCPU + 9.0.30729 + 2.0 + {63B8D05E-4581-4B92-B8D5-77E702535C7F} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Google.ProtocolBuffers + Google.ProtocolBuffersLiteMixed.Test + v2.0 + true + + + true + true + Google.ProtocolBuffersLiteMixed.Test.xap + Properties\AppManifest.xml + Google.ProtocolBuffers.App + TestPage.html + true + false + false + + + 3.5 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + v2.0 + + + true + full + false + bin\Debug_Silverlight + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + 3021 + + + pdbonly + true + bin\Release_Silverlight + TRACE;SILVERLIGHT + true + true + prompt + 4 + 3021 + + + + False + ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll + + + False + ..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll + + + + + + + + + + + Properties\AssemblyInfo.cs + + + App.xaml + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + + + {7E4E681E-5D09-43FB-8D9E-35A454730A85} + ProtocolBuffers%28Silverlight%29 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj index d61d6651f2..b0a2b7c1ef 100644 --- a/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj +++ b/src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj @@ -39,9 +39,9 @@ 4 - + False - ..\..\lib\NUnit 2.2.8.0\nunit.framework.dll + ..\..\lib\NUnit\lib\nunit.framework.dll False @@ -53,6 +53,9 @@ + + Microsoft.VisualStudio.TestTools.cs + Properties\AssemblyInfo.cs @@ -71,6 +74,7 @@ + @@ -86,4 +90,10 @@ --> + + Program + $(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe + /nologo /noshadow /labels /wait $(AssemblyName).dll + $(ProjectDir)$(OutputPath) + \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/SerializableAttribute.cs b/src/ProtocolBuffersLite.Test/SerializableAttribute.cs new file mode 100644 index 0000000000..04fcdcbadd --- /dev/null +++ b/src/ProtocolBuffersLite.Test/SerializableAttribute.cs @@ -0,0 +1,12 @@ +#if SILVERLIGHT + +namespace System +{ + [AttributeUsage(AttributeTargets.Class)] + public class SerializableAttribute : Attribute + { + public SerializableAttribute () : base() { } + } +} + +#endif diff --git a/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs b/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs index 7c12ef4033..a688a909e0 100644 --- a/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs +++ b/src/ProtocolBuffersLite.Test/SerializableLiteTest.cs @@ -5,11 +5,11 @@ using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Text; using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class SerializableLiteTest { /// @@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers public static readonly ISerializable CompileTimeCheckSerializableMessage = TestRequiredLite.DefaultInstance; public static readonly ISerializable CompileTimeCheckSerializableBuilder = new TestRequiredLite.Builder(); - [Test] + [TestMethod] public void TestPlainMessage() { TestRequiredLite message = TestRequiredLite.CreateBuilder() @@ -34,7 +34,7 @@ namespace Google.ProtocolBuffers Assert.AreEqual(message, copy); } - [Test] + [TestMethod] public void TestPlainBuilder() { TestRequiredLite.Builder builder = TestRequiredLite.CreateBuilder() diff --git a/src/ProtocolBuffersLite.Test/TestLiteByApi.cs b/src/ProtocolBuffersLite.Test/TestLiteByApi.cs index 5fee2ecbc3..ce37302860 100644 --- a/src/ProtocolBuffersLite.Test/TestLiteByApi.cs +++ b/src/ProtocolBuffersLite.Test/TestLiteByApi.cs @@ -35,14 +35,14 @@ #endregion using Google.ProtocolBuffers.TestProtos; -using NUnit.Framework; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Google.ProtocolBuffers { - [TestFixture] + [TestClass] public class TestLiteByApi { - [Test] + [TestMethod] public void TestAllTypesEquality() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; @@ -57,7 +57,7 @@ namespace Google.ProtocolBuffers Assert.IsTrue(msg.Equals(copy)); } - [Test] + [TestMethod] public void TestEqualityOnExtensions() { TestAllExtensionsLite msg = TestAllExtensionsLite.DefaultInstance; @@ -72,13 +72,13 @@ namespace Google.ProtocolBuffers Assert.IsTrue(msg.Equals(copy)); } - [Test] + [TestMethod] public void TestAllTypesToString() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; TestAllTypesLite copy = msg.ToBuilder().Build(); Assert.AreEqual(msg.ToString(), copy.ToString()); - Assert.IsEmpty(msg.ToString()); + Assert.AreEqual(0, msg.ToString().Length); msg = msg.ToBuilder().SetOptionalInt32(-1).Build(); Assert.AreEqual("optional_int32: -1", msg.ToString().TrimEnd()); msg = msg.ToBuilder().SetOptionalString("abc123").Build(); @@ -86,16 +86,16 @@ namespace Google.ProtocolBuffers msg.ToString().Replace("\r", "").TrimEnd()); } - [Test] + [TestMethod] public void TestAllTypesDefaultedRoundTrip() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; Assert.IsTrue(msg.IsInitialized); TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); + TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); } - [Test] + [TestMethod] public void TestAllTypesModifiedRoundTrip() { TestAllTypesLite msg = TestAllTypesLite.DefaultInstance; @@ -115,7 +115,7 @@ namespace Google.ProtocolBuffers .AddRepeatedGroup(TestAllTypesLite.Types.RepeatedGroup.CreateBuilder().SetA('A').Build()) ; TestAllTypesLite copy = TestAllTypesLite.CreateBuilder().MergeFrom(msg.ToByteArray()).Build(); - Assert.AreEqual(msg.ToByteArray(), copy.ToByteArray()); + TestUtil.AssertBytesEqual(msg.ToByteArray(), copy.ToByteArray()); } } } \ No newline at end of file diff --git a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs index 25f488404c..535f21e6b2 100644 --- a/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs +++ b/src/ProtocolBuffersLite.Test/TestProtos/UnitTestRpcInteropLite.cs @@ -1319,7 +1319,7 @@ namespace Google.ProtocolBuffers.TestProtos { public SearchService(pb::IRpcDispatch dispatch) : this(dispatch, true) { } public SearchService(pb::IRpcDispatch dispatch, bool dispose) { - if (null == (this.dispatch = dispatch)) throw new global::System.ArgumentNullException(); + pb::ThrowHelper.ThrowIfNull(this.dispatch = dispatch, "dispatch"); this.dispose = dispose && dispatch is global::System.IDisposable; } @@ -1349,7 +1349,7 @@ namespace Google.ProtocolBuffers.TestProtos { public Dispatch(ISearchService implementation) : this(implementation, true) { } public Dispatch(ISearchService implementation, bool dispose) { - if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException(); + pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); this.dispose = dispose && implementation is global::System.IDisposable; } @@ -1363,7 +1363,7 @@ namespace Google.ProtocolBuffers.TestProtos { switch(methodName) { case "Search": return response.MergeFrom(implementation.Search((global::Google.ProtocolBuffers.TestProtos.SearchRequest)request)).Build(); case "RefineSearch": return response.MergeFrom(implementation.RefineSearch((global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest)request)).Build(); - default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName); + default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); } } } @@ -1381,7 +1381,7 @@ namespace Google.ProtocolBuffers.TestProtos { public ServerStub(pb::IRpcDispatch implementation) : this(implementation, true) { } public ServerStub(pb::IRpcDispatch implementation, bool dispose) { - if (null == (this.implementation = implementation)) throw new global::System.ArgumentNullException(); + pb::ThrowHelper.ThrowIfNull(this.implementation = implementation, "implementation"); this.dispose = dispose && implementation is global::System.IDisposable; } @@ -1393,7 +1393,7 @@ namespace Google.ProtocolBuffers.TestProtos { switch(methodName) { case "Search": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.SearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); case "RefineSearch": return implementation.CallMethod(methodName, global::Google.ProtocolBuffers.TestProtos.RefineSearchRequest.ParseFrom(input, registry), global::Google.ProtocolBuffers.TestProtos.SearchResponse.CreateBuilder()); - default: throw new global::System.MissingMethodException(typeof(ISearchService).FullName, methodName); + default: throw pb::ThrowHelper.CreateMissingMethod(typeof(ISearchService), methodName); } } } diff --git a/src/ProtocolBuffersLite.Test/TestUtil.cs b/src/ProtocolBuffersLite.Test/TestUtil.cs new file mode 100644 index 0000000000..44c09b9c53 --- /dev/null +++ b/src/ProtocolBuffersLite.Test/TestUtil.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Google.ProtocolBuffers +{ + class TestUtil + { + internal static void AssertBytesEqual(byte[] a, byte[] b) + { + if (a == null || b == null) + { + Assert.AreEqual(a, b); + } + else + { + Assert.AreEqual(a.Length, b.Length, "The byte[] is not of the expected length."); + + for (int i = 0; i < a.Length; i++) + { + if (a[i] != b[i]) + { + Assert.AreEqual(a[i], b[i], "Byte[] differs at index " + i); + } + } + } + } + + } +}