http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/culture.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/culture.html b/lib/NUnit.org/NUnit/2.5.9/doc/culture.html deleted file mode 100644 index 07b3f07..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/culture.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - -NUnit - Culture - - - - - - - - - - - - - -
- - - - - -

CultureAttribute (NUnit 2.4.2)

-

The Culture attribute is used to specify cultures for which a test or fixture - should be run. It does not affect the culture setting, but merely uses it to - determine whether to run the test. If you wish to change the culture when - running a test, use the SetCulture attribute instead.

- -

If the specified culture requirements for a test are not met it is skipped. - In the gui, the tree node for the test remains gray and the status bar color is - not affected.

- -

One use of the Culture attribute is to provide alternative tests under different -cultures. You may specify either specific cultures, like "en-GB" or neutral -cultures like "de".

- -

Test Fixture Syntax

- -
- -
- Language Filter - -
- -
namespace NUnit.Tests
-{
-  using System;
-  using NUnit.Framework;
-
-  [TestFixture]
-  [Culture("fr-FR")]
-  public class FrenchCultureTests
-  {
-    // ...
-  }
-}
-
- -
Imports System
-Imports Nunit.Framework
-
-Namespace Nunit.Tests
-
-  <TestFixture(), Culture("fr-FR")>
-  Public Class FrenchCultureTests
-    ' ...
-  End Class
-End Namespace
-
- -
#using <Nunit.Framework.dll>
-using namespace System;
-using namespace NUnit::Framework;
-
-namespace NUnitTests
-{
-  [TestFixture]
-  [Culture("fr-FR")]
-  public __gc class FrenchCultureTests
-  {
-    // ...
-  };
-}
-
-#include "cppsample.h"
-
-namespace NUnitTests {
-  // ...
-}
-
- -
package NUnit.Tests;
-
-import System.*;
-import NUnit.Framework.TestFixture;
-
-
-/** @attribute NUnit.Framework.TestFixture() */
-/** @attribute NUnit.Framework.Culture("fr-FR") */
-public class FrenchCultureTests
-{
-  // ...
-}
-
-
-

Test Syntax

-
- -
- Language Filter - -
- -
namespace NUnit.Tests
-{
-  using System;
-  using NUnit.Framework;
-
-  [TestFixture]
-  public class SuccessTests
-  {
-    [Test]
-    [Culture(Exclude="en,de")]
-    public void SomeTest()
-    { /* ... */ }
-}
-
- -
Imports System
-Imports Nunit.Framework
-
-Namespace Nunit.Tests
-
-  <TestFixture()>
-  Public Class SuccessTests
-    <Test(), Culture(Exclude="en,de")> Public Sub SomeTest()
-      ' ...
-    End Sub
-  End Class
-End Namespace
-
- -
#using <Nunit.Framework.dll>
-using namespace System;
-using namespace NUnit::Framework;
-
-namespace NUnitTests
-{
-  [TestFixture]
-  public __gc class SuccessTests
-  {
-    [Test][Culture(Exclude="en,de")] void SomeTest();
-  };
-}
-
-#include "cppsample.h"
-
-namespace NUnitTests {
-  // ...
-}
-
- -
package NUnit.Tests;
-
-import System.*;
-import NUnit.Framework.TestFixture;
-
-
-/** @attribute NUnit.Framework.TestFixture() */
-public class SuccessTests
-{
-  /** @attribute NUnit.Framework.Test() */
-  /** @attribute NUnit.Framework.Culture(Exclude=en,de") */
-  public void SomeTest()
-  { /* ... */ }
-}
-
- -
- -

See also...

- - - -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/customConstraints.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/customConstraints.html b/lib/NUnit.org/NUnit/2.5.9/doc/customConstraints.html deleted file mode 100644 index 7c5baab..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/customConstraints.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -NUnit - CustomConstraints - - - - - - - - - - - - - -
- -

Custom Constraints (NUnit 2.4 / 2.5)

- -

You can implement your own custom constraints by creating a class that -inherits from the Constraint abstract class, which supports performing a -test on an actual value and generating appropriate messages. The class includes -two abstract methods, which you must override and four virtual methods with -default implementation that may be overridden as needed: - -

-
public abstract class Constraint
-{
- 	...
-    public abstract bool Matches( object actual );
-    public virtual bool Matches( ActualValueDelegate del );
-    public virtual bool Matches<T>( ref T actual );
-    public abstract void WriteDescriptionTo( MessageWriter writer );
-    public virtual void WriteMessageTo( MessageWriter writer );
-    public virtual void WriteActualValueTo( MessageWriter writer );
-	...
-}
-
- -

Your derived class should save the actual argument to Matches in the protected -field actual for later use. - -

The MessageWriter abstract class is implemented in the framework by -TextMessageWriter. Examining the source for some of the builtin constraints -should give you a good idea of how to use it if you have special formatting -requirements for error messages. - -

Custom Constraint Syntax

- -

NUnit includes classes that implement a special constraint syntax, -allowing you to write things like... - -

-
Assert.That( myArray, Is.All.InRange(1,100) );
-
- -

Of course, the NUnit constraint syntax will not be aware of your -custom constraint unless you modify NUnit itself. As an alternative, -you may use the Matches(Constraint) syntactic element in order -to write code like... - -

-
MyConstraint myConstraint = new MyConstraint();
-Assert.That( myArray, Has.Some.Matches(myConstraint) );
-
- - - -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/datapoint.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/datapoint.html b/lib/NUnit.org/NUnit/2.5.9/doc/datapoint.html deleted file mode 100644 index 5a5e25d..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/datapoint.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - -NUnit - Datapoint - - - - - - - - - - - - - -
- -

DatapointAttribute / DatapointsAttribute (NUnit 2.5) (Experimental)

- -

The Datapoint and Datapoints attributes are used - to provide data for Theories and are ignored for ordinary - tests - including tests with parameters. - -

DataPointAttribute

- -

When a Theory is loaded, NUnit creates arguments for each - of its parameters by using any fields of the same type - as the parameter annotated with the DatapointAttribute. - Fields must be members of the class containing the Theory - and their Type must exactly match the argument for which - data is being supplied. - -

DataPointsAttribute

- -

In addition to specifying individual datapoints, collections of - datapoints may be provided by use of the DatapointsAttribute - - note the spelling. This attribute may be placed on methods or - properties in addition to fields. The returned value must be - either an array of the required type or (beginning with NUnit - 2.5.5) an IEnumerable<T> returning an enumeration - of the required type. The data Type must exactly match the argument - for which data is being supplied. - -

Automatically Supplied Datapoints

- -

It is normally not necessary to specify datapoints for - boolean or enum arguments. Beginning with - version 2.5.4, NUnit automatically supplies values of true - and false for boolean arguments and will supply all - defined values of any enumeration. - -

If for some reason you don't wish to use all possible values, you - can override this behavior by supplying your own datapoints. If you - supply any datapoints for an argument, automatic datapoint generation - is suppressed. - -

Example

- -

For an example of use, see TheoryAttribute. - -

See also...

- - - - -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/datapointProviders.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/datapointProviders.html b/lib/NUnit.org/NUnit/2.5.9/doc/datapointProviders.html deleted file mode 100644 index 3d8d069..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/datapointProviders.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - -NUnit - DatapointProviders - - - - - - - - - - - - - -
- -

DataPointProviders (NUnit 2.5)

- -

Purpose

-

DataPointProviders are used to supply data for an individual parameter -of a parameterized test method. - -

Extension Point

-

Addins use the host to access this extension point by name: - -

-	IExtensionPoint listeners = host.GetExtensionPoint( "DataPointProviders" );
- -

Interface

-

The extension object passed to Install must implement either the - IDataPointProvider or the IDataPointProvider2 interface: - -

-	public interface IDataPointProvider
-	{
-		bool HasDataFor( ParameterInfo parameter );
-		IEnumerable GetDataFor( ParameterInfo parameter );
-	}
-	
-	public interface IDataPointProvider2 : IDatapointProvider
-	{
-		bool HasDataFor( ParameterInfo parameter, Test parentSuite );
-		IEnumerable GetDataFor( ParameterInfo parameter, Test parentSuite );
-	}
-
- -

NUnit will call IDataPointProvider2 if it is available. Otherwise - IDataPointProvider will be used. - -

The HasDataFor method should return true if the provider is able to - supply data for the specified parameter. If a provider only wants to be used - on certain types of tests, it can examine the supplied ParameterInfo and - its associated MethodInfo and Type and/or the parent test suite. - -

The GetDataFor method should return a list of individual values to - use for the supplied parameter in running the test. - -

Notes:

- -
    -
  1. Most providers will delegate one of the interface implementations - to the other if they implement both. -
  2. DataPointProviders that use data from the fixture class should use - IDataPointProvider2 interface so that they are able to access any - arguments supplied for constructing the fixture object. -
  3. Providers that acquire data from outside the fixture will usually - be able to work with IDataPointProvider alone. -
  4. The IDataPointProvider2 interface was added in the NUnit 2.5.1 release. -
- - -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/delayedConstraint.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/delayedConstraint.html b/lib/NUnit.org/NUnit/2.5.9/doc/delayedConstraint.html deleted file mode 100644 index 7a1887e..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/delayedConstraint.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - -NUnit - DelayedConstraint - - - - - - - - - - - - - -
- -

Delayed Constraint (NUnit 2.5)

- -

DelayedConstraint delays the application of another constraint until a certain - amount of time has passed. In it's simplest form, it replaces use of a Sleep - in the code but it also supports polling, which may allow use of a longer - maximum time while still keeping the tests as fast as possible. - -

The After modifier is permitted on any constraint, and the delay applies to - the entire expression up to the point where After appears. - -

Use of a DelayedConstraint with a value argument makes no sense, since - the value will be extracted at the point of call. It's intended use is with - delegates and references. If a delegate is used with polling, it may be called - multiple times so only methods without side effects should be used in this way. - - - - - -
Syntax HelperConstructorOperation
After(int)DelayedConstraint(Constraint, int)tests that a constraint is satisfied after a delay.
After(int, int)DelayedConstraint(Constraint, int, int)tests that a constraint is satisfied after a delay using polling.
- - -

- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/description.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/description.html b/lib/NUnit.org/NUnit/2.5.9/doc/description.html deleted file mode 100644 index 8b4e9b0..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/description.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - -NUnit - Description - - - - - - - - - - - - - -
- - - -

Description (NUnit 2.4)

- -

The Description attribute is used to apply descriptive text to a Test, -TestFixture or Assembly. The text appears in the XML output file and is -shown in the Test Properties dialog.

- -

Example:

- -
- -
- Language Filter - -
- -
[assembly: Description("Assembly description here")]
-
-namespace NUnit.Tests
-{
-  using System;
-  using NUnit.Framework;
-
-  [TestFixture, Description("Fixture description here")]
-  public class SomeTests
-  {
-    [Test, Description("Test description here")] 
-    public void OneTest()
-    { /* ... */ }
-  }
-}
-
-
<assembly: Description("Assembly description here")>
-
-Imports System
-Imports Nunit.Framework
-
-Namespace Nunit.Tests
-
-  <TestFixture(), Description("Fixture description here")>_
-  Public Class SomeTests
-    <Test(), Description("Test description here")>_
-    Public Sub OneTest()
-    ' ...
-    End Sub
-  End Class
-End Namespace
-
-
[assembly:Description("Assembly description here")]
-
-#using <Nunit.Framework.dll>
-using namespace System;
-using namespace NUnit::Framework;
-
-namespace NUnitTests
-{
-  [TestFixture, Description("Fixture description here")]
-  public __gc class SomeTests
-  {
-    [Test, Description("Test description here")]
-    void OneTest();
-  };
-}
-
-#include "cppsample.h"
-
-namespace NUnitTests {
-  // ...
-}
-
- -
/** @assembly NUnit.Framework.Description("Assembly description here") */
-
-package NUnit.Tests;
-
-import System.*;
-import NUnit.Framework.TestFixture;
-
-
-/** @attribute NUnit.Framework.TestFixture() */
-/** @attribute NUnit.Framework.Description("Fixture description here") */
-public class SomeTests
-{
-  /** @attribute NUnit.Framework.Test() */
-  /** @attribute NUnit.Framework.Description("Test description here") */
-  public void OneTest()
-  { /* ... */ }
-}
-
-
- -

Note: The Test and TestFixture attributes continue to support an -optional Description property. The Description attribute should be used for -new applciations. If both are used, the Description attribute takes precedence.

- - - -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/directoryAssert.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/directoryAssert.html b/lib/NUnit.org/NUnit/2.5.9/doc/directoryAssert.html deleted file mode 100644 index 8fa5551..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/directoryAssert.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - -NUnit - DirectoryAssert - - - - - - - - - - - - - -
- -

DirectoryAssert (NUnit 2.5)

-

The DirectoryAssert class provides methods for making asserts about -file system directories, which may be provided as DirectoryInfos or as strings -giving the path to each directory.

- -

DirectoryAssert.AreEqual() and DirectoryAssert.AreNotEqual() -compare two directories for equality. Directories are considered equal if -they have the same FullName, Attributes, CreationTime and LastAccessTime. - -

Note: Two different directories containing the same files are not -considered to be equal. - -

-
-DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual );
-DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual, 
-                string message );
-DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual,
-                string message, params object[] args );
-
-DirectoryAssert.AreEqual( string expected, string actual );
-DirectoryAssert.AreEqual( string expected, string actual, 
-                string message );
-DirectoryAssert.AreEqual( string expected, string actual,
-                string message, params object[] args );
-
-DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual );
-DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual, 
-                string message );
-DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual,
-                string message, params object[] args );
-
-DirectoryAssert.AreNotEqual( string expected, string actual );
-DirectoryAssert.AreNotEqual( string expected, string actual, 
-                string message );
-DirectoryAssert.AreNotEqual( string expected, string actual,
-                string message, params object[] args );
-
-
- -

DirectoryAssert.IsEmpty() and DirectoryAssert.IsNotEmpty() -test whether the specified directory is empty. - -

-
-DirectoryAssert.IsEmpty( DirectoryInfo directory );
-DirectoryAssert.IsEmpty( DirectoryInfo directory, string message );
-DirectoryAssert.IsEmpty( DirectoryInfo directory,
-                string message, params object[] args );
-
-DirectoryAssert.IsEmpty( string directory );
-DirectoryAssert.IsEmpty( string directory, string message );
-DirectoryAssert.IsEmpty( string directory,
-                string message, params object[] args );
-
-DirectoryAssert.IsNotEmpty( DirectoryInfo directory );
-DirectoryAssert.IsNotEmpty( DirectoryInfo directory, string message );
-DirectoryAssert.IsNotEmpty( DirectoryInfo directory,
-                string message, params object[] args );
-
-DirectoryAssert.IsNotEmpty( string directory );
-DirectoryAssert.IsNotEmpty( string directory, string message );
-DirectoryAssert.IsNotEmpty( string directory,
-                string message, params object[] args );
-
-
- -

DirectoryAssert.IsWithin() and DirectoryAssert.IsNotWithin() -test whether the second directory is a direct or indirect subdirectory -of the first directory. - -

-
-DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual );
-DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual,
-                string message );
-DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual,
-                string message, params object[] args );
-
-DirectoryAssert.IsWithin( string expected, string actual );
-DirectoryAssert.IsWithin( string expected, string actual,
-                string message );
-DirectoryAssert.IsWithin( string expected, string actual,
-                string message, params object[] args );
-
-DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual );
-DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual,
-                string message );
-DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual,
-                string message, params object[] args );
-
-DirectoryAssert.IsNotWithin( string expected, string actual );
-DirectoryAssert.IsNotWithin( string expected, string actual,
-                string message );
-DirectoryAssert.IsNotWithin( string expected, string actual,
-                string message, params object[] args );
-
-
- -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/equalConstraint.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/equalConstraint.html b/lib/NUnit.org/NUnit/2.5.9/doc/equalConstraint.html deleted file mode 100644 index 7be1359..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/equalConstraint.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - -NUnit - EqualConstraint - - - - - - - - - - - - - -
- -

Equal Constraint (NUnit 2.4 / 2.5)

- -

An EqualConstraint is used to test whether an actual value - is equal to the expected value supplied in its constructor, - optionally within a specified tolerance. - -

Constructor

-
-EqualConstraint(object expected )
-
- -

Syntax

-
-Is.EqualTo( object expected )
-
- -

Modifiers

-
-...IgnoreCase
-...AsCollection
-...NoClip
-...Within(object tolerance)
-      .Ulps
-      .Percent
-      .Days
-      .Hours
-      .Minutes
-      .Seconds
-      .Milliseconds
-      .Ticks
-...Using(IEqualityComparer comparer)
-...Using(IEqualityComparer<T> comparer)
-...Using(IComparer comparer)
-...Using(IComparer<T> comparer)
-...Using(Comparison<T> comparer)
-
- -

Comparing Numerics

-

Numerics are compared based on their values. Different types - may be compared successfully if their values are equal. - -

Using the Within modifier, numerics may be tested -for equality within a fixed or percent tolerance. - -

-Assert.That(2 + 2, Is.EqualTo(4.0));
-Assert.That(2 + 2 == 4);
-Assert.That(2 + 2, Is.Not.EqualTo(5));
-Assert.That(2 + 2 != 5);
-Assert.That( 5.0, Is.EqualTo( 5 );
-Assert.That( 5.5, Is.EqualTo( 5 ).Within(0.075);
-Assert.That( 5.5, Is.EqualTo( 5 ).Within(1.5).Percent;
-
- -

Comparing Floating Point Values

-

Values of type float and double are normally compared using a tolerance -specified by the Within modifier. The special values PositiveInfinity, -NegativeInfinity and NaN compare -as equal to themselves. - -

With version 2.5, floating-point values may be compared using a tolerance -in "Units in the Last Place" or ULPs. For certain types of numerical work, -this is safer than a fixed tolerance because it automatically compensates -for the added inaccuracy of larger numbers. - -

-Assert.That( 2.1 + 1.2, Is.EqualTo( 3.3 ).Within( .0005 );
-Assert.That( double.PositiveInfinity, Is.EqualTo( double.PositiveInfinity ) );
-Assert.That( double.NegativeInfinity, Is.EqualTo( double.NegativeInfinity ) );
-Assert.That( double.NaN, Is.EqualTo( double.NaN ) );
-Assert.That( 20000000000000004.0, Is.EqualTo(20000000000000000.0).Within(1).Ulps);
-
- -

Comparing Strings

- -

String comparisons normally respect case. The IgnoreCase modifier - causes the comparison to be case-insensitive. It may also be used when - comparing arrays or collections of strings. - -

-Assert.That( "Hello!", Is.Not.EqualTo( "HELLO!" ) );
-Assert.That( "Hello!", Is.EqualTo( "HELLO!" ).IgnoreCase );
-
-string[] expected = new string[] { "Hello", World" };
-string[] actual = new string[] { "HELLO", "world" };
-Assert.That( actual, Is.EqualTo( expected ).IgnoreCase;
-
- -

Comparing DateTimes and TimeSpans

- -

DateTimes and TimeSpans may be compared either with or without - a tolerance. A tolerance is specified using Within with either a - TimeSpan as an argument or with a numeric value followed by a one of - the time conversion modifiers: Days, Hours, Minutes, - Seconds, Milliseconds or Ticks. - -

-DateTime now = DateTime.Now;
-DateTime later = now + TimeSpan.FromHours(1.0);
-
-Assert.That( now, Is.EqualTo(now) );
-Assert.That( later. Is.EqualTo(now).Within(TimeSpan.FromHours(3.0);
-Assert.That( later, Is.EqualTo(now).Within(3).Hours;
-
- -

Comparing Arrays and Collections

- -

Since version 2.2, NUnit has been able to compare two single-dimensioned arrays. - Beginning with version 2.4, multi-dimensioned arrays, nested arrays (arrays of arrays) - and collections may be compared. With version 2.5, any IEnumerable is supported. - Two arrays, collections or IEnumerables are considered equal if they have the - the same dimensions and if each of the corresponding elements is equal.

- -

If you want to treat two arrays of different shapes as simple collections - for purposes of comparison, use the AsCollection modifier, which causes - the comparison to be made element by element, without regard for the rank or - dimensions of the array. Note that jagged arrays (arrays of arrays) do not - have a single underlying collection. The modifier would be applied - to each array separately, which has no effect in most cases. - -

-int[] i3 = new int[] { 1, 2, 3 };
-double[] d3 = new double[] { 1.0, 2.0, 3.0 };
-int[] iunequal = new int[] { 1, 3, 2 };
-Assert.That(i3, Is.EqualTo(d3));
-Assert.That(i3, Is.Not.EqualTo(iunequal));
-
-int array2x2 = new int[,] { { 1, 2 } { 3, 4 } };
-int array4 = new int[] { 1, 2, 3, 4 };		
-Assert.That( array2x2, Is.Not.EqualTo( array4 ) );
-Assert.That( array2x2, Is.EqualTo( array4 ).AsCollection );
-
- -

Comparing Dictionaries

- -

Dictionaries implement ICollection, and NUnit has treated -them as collections since version 2.4. However, this did not -give useful results, since the dictionary entries had to be -in the same order for the comparison to succeed and the -underlying implementation had to be the same. - -

Beginning with NUnit 2.5.6, NUnit has specific code for -comparing dictionaries. Two dictionaries are considered equal if - -

    -
  1. The list of keys is the same - without regard to ordering. -
  2. The values associated with each key are equal. -
- -

You can use this capability to compare any two objects implementing -IDictionary. Generic and non-generic dictionaries (Hashtables) -may be successfully compared. - -

User-Specified Comparers

- -

If the default NUnit or .NET behavior for testing equality doesn't -meet your needs, you can supply a comparer of your own through the -Using modifier. When used with EqualConstraint, you -may supply an IEqualityComparer, IEqualityComparer<T>, -IComparer, IComparer<T>; or Comparison<T> -as the argument to Using. - -

-Assert.That( myObj1, Is.EqualTo( myObj2 ).Using( myComparer ) );
-
- -

Notes

-
    -
  1. When checking the equality of user-defined classes, NUnit makes use - of the Equals override on the expected object. If you neglect to - override Equals, you can expect failures non-identical objects. - In particular, overriding operator== without overriding Equals - has no effect. -

  2. The Within modifier was originally designed for use with floating point - values only. Beginning with NUnit 2.4, comparisons of DateTime values - may use a TimeSpan as a tolerance. Beginning with NUnit 2.4.2, - non-float numeric comparisons may also specify a tolerance. -

  3. Beginning with NUnit 2.4.4, float and double comparisons for which no - tolerance is specified use a default, use the value of - GlobalSettings.DefaultFloatingPointTolerance. If this is not - set, a tolerance of 0.0d is used. -

  4. Prior to NUnit 2.2.3, comparison of two NaN values would always fail, - as specified by IEEE floating point standards. The new behavior, was - introduced after some discussion becuase it seems more useful in tests. - To avoid confusion, consider using Is.NaN where appropriate. -

  5. When an equality test between two strings fails, the relevant portion of - of both strings is displayed in the error message, clipping the strings to - fit the length of the line as needed. Beginning with 2.4.4, this behavior - may be modified by use of the NoClip modifier on the constraint. In - addition, the maximum line length may be modified for all tests by setting - the value of TextMessageWriter.MaximumLineLength in the appropriate - level of setup. -

  6. When used with arrays, collections or dictionaries, EqualConstraint - operates recursively. Any modifiers are saved and used as they apply to - individual items. -

  7. A user-specified comparer will not be called by EqualConstraint - if either or both arguments are null. If both are null, the Constraint - succeeds. If only one is null, it fails. -

  8. NUnit has special semantics for comparing Streams and -DirectoryInfos. For a Stream, the contents are compared. -For a DirectoryInfo, the first-level directory contents are compared. -

- -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/equalityAsserts.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/equalityAsserts.html b/lib/NUnit.org/NUnit/2.5.9/doc/equalityAsserts.html deleted file mode 100644 index 89d5e3d..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/equalityAsserts.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - -NUnit - EqualityAsserts - - - - - - - - - - - - - -
- -

Equality Asserts

- -

These methods test whether the two arguments are equal. Overloaded -methods are provided for common value types so that languages that don't -automatically box values can use them directly.

- -
-
Assert.AreEqual( int expected, int actual );
-Assert.AreEqual( int expected, int actual, string message );
-Assert.AreEqual( int expected, int actual, string message, 
-                 params object[] parms );
-				 
-Assert.AreEqual( uint expected, uint actual );
-Assert.AreEqual( uint expected, uint actual, string message );
-Assert.AreEqual( uint expected, uint actual, string message, 
-                 params object[] parms );
-
-Assert.AreEqual( decimal expected, decimal actual );
-Assert.AreEqual( decimal expected, decimal actual, string message );
-Assert.AreEqual( decimal expected, decimal actual, string message, 
-                 params object[] parms );
-
-Assert.AreEqual( float expected, float actual, float tolerance );
-Assert.AreEqual( float expected, float actual, float tolerance,
-                 string message );
-Assert.AreEqual( float expected, float actual, float tolerance,
-                 string message, params object[] parms );
-
-Assert.AreEqual( double expected, double actual, double tolerance );
-Assert.AreEqual( double expected, double actual, double tolerance,
-                 string message );
-Assert.AreEqual( double expected, double actual, double tolerance,
-                 string message, params object[] parms );
-
-Assert.AreEqual( object expected, object actual );
-Assert.AreEqual( object expected, object actual, string message );
-Assert.AreEqual( object expected, object actual, string message, 
-                 params object[] parms );
-
-Assert.AreNotEqual( int expected, int actual );
-Assert.AreNotEqual( int expected, int actual, string message );
-Assert.AreNotEqual( int expected, int actual, string message,
-                 params object[] parms );
-
-Assert.AreNotEqual( long expected, long actual );
-Assert.AreNotEqual( long expected, long actual, string message );
-Assert.AreNotEqual( long expected, long actual, string message,
-                 params object[] parms );
-
-Assert.AreNotEqual( uint expected, uint actual );
-Assert.AreNotEqual( uint expected, uint actual, string message );
-Assert.AreNotEqual( uint expected, uint actual, string message,
-                 params object[] parms );
-
-Assert.AreNotEqual( ulong expected, ulong actual );
-Assert.AreNotEqual( ulong expected, ulong actual, string message );
-Assert.AreNotEqual( ulong expected, ulong actual, string message,
-                 params object[] parms );
-
-Assert.AreNotEqual( decimal expected, decimal actual );
-Assert.AreNotEqual( decimal expected, decimal actual, string message );
-Assert.AreNotEqual( decimal expected, decimal actual, string message,
-                 params object[] parms );
-
-Assert.AreNotEqual( float expected, float actual );
-Assert.AreNotEqual( float expected, float actual, string message );
-Assert.AreNotEqual( float expected, float actual, string message,
-                 params object[] parms );
-
-Assert.AreNotEqual( double expected, double actual );
-Assert.AreNotEqual( double expected, double actual, string message );
-Assert.AreNotEqual( double expected, double actual, string message,
-                 params object[] parms );
-
-Assert.AreNotEqual( object expected, object actual );
-Assert.AreNotEqual( object expected, object actual, string message );
-Assert.AreNotEqual( object expected, object actual, string message,
-                 params object[] parms );
-
- -

Comparing Numerics of Different Types

- -

The method overloads that compare two objects make special provision so that numeric - values of different types compare as expected. This assert succeeds: -

        Assert.AreEqual( 5, 5.0 );
-

- -

Comparing Floating Point Values

- -

Values of type float and double are normally compared using an additional -argument that indicates a tolerance within which they will be considered -as equal. Beginning with NUnit 2.4.4, the value of -GlobalSettings.DefaultFloatingPointTolerance is used if a third argument -is not provided. In earlier versions, or if the default has not been set, -values are tested for exact equality. - -

Special values are handled so that the following Asserts succeed:

- -
        Assert.AreEqual( double.PositiveInfinity, double.PositiveInfinity );
-        Assert.AreEqual( double.NegativeInfinity, double.NegativeInfinity );
-        Assert.AreEqual( double.NaN, double.NaN );
- -
Note: The last example above represents a change with NUnit 2.2.3. - In earlier releases, the test would fail. We have made this change - because the new behavior seems to be more useful in tests. To avoid confusion, - we suggest using the new Assert.IsNaN method where appropriate.
- -

Comparing Arrays and Collections

- -

Since version 2.2, NUnit has been able to compare two single-dimensioned arrays. - Beginning with version 2.4, multi-dimensioned arrays, nested arrays (arrays of arrays) - and collections may be compared. Two arrays or collections will be treated as equal - by Assert.AreEqual if they have the same dimensions and if each of the corresponding - elements is equal.

- -
- - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/eventListeners.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/eventListeners.html b/lib/NUnit.org/NUnit/2.5.9/doc/eventListeners.html deleted file mode 100644 index 33ca5bb..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/eventListeners.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - -NUnit - EventListeners - - - - - - - - - - - - - -
- -

EventListeners (NUnit 2.4.4)

- -

Purpose

-

EventListeners are able to respond to events that occur in the course -of a test run, usually by recording information of some kind. Note that -EventListeners called asynchronously with respect to test execution and -are not able to affect the actual execution of the test. - -

Extension Point

-

Addins use the host to access this extension point by name: - -

-	IExtensionPoint listeners = host.GetExtensionPoint( "EventListeners" );
- -

Interface

-

The extension object passed to Install must implement the EventListener interface: - -

-	public interface EventListener
-	{
-		void RunStarted( string name, int testCount );
-		void RunFinished( TestResult result );
-		void RunFinished( Exception exception );
-		void TestStarted(TestName testName);
-		void TestFinished(TestResult result);
-		void SuiteStarted(TestName testName);
-		void SuiteFinished(TestResult result);
-		void UnhandledException( Exception exception );
-		void TestOutput(TestOutput testOutput);
-	}
-
- -

You must provide all the methods, but the body may be empty for any -that you have no need of. - - -

- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/exception.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/exception.html b/lib/NUnit.org/NUnit/2.5.9/doc/exception.html deleted file mode 100644 index e7d865f..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/exception.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - -NUnit - Exception - - - - - - - - - - - - - -
- - - -

ExpectedExceptionAttribute (NUnit 2.0 plus Updates)

- -

This is the way to specify that the execution of a test will throw an - exception. This attribute has a number of positional and - named parameters, which we will discuss in separate sections - according to the purpose they serve.

- -

Specifying the Expected Exception Type

- -

The original attribute, introduced with NUnit 2.0 took a single -argument giving the exact type of the expected exception. For example...

- - -
[ExpectedException( typeof( ArgumentException ) )]
-public void TestMethod()
-{
-...
- -

Beginning with NUnit 2.2.4, it became possible to specify the type -of exception as a string, avoiding the need for a reference to the -defining assembly...

- -
[ExpectedException( "System.ArgumentException" ) )]
-public void TestMethod()
-{
-...
- -

The above two examples function identically: the test only succeeds if a -System.Argument exception is thrown.

- -

Specifying the Expected Message

- -

NUnit 2.1 introduced a constructor with a second argument, specifying the -exact text of the message property of the exception. After NUnit 2.2.4, the -same extension was made to the constructor taking a string argument. With -NUnit 2.4, these arguments are marked obsolete, and a named parameter -is provided instead...

- -
// Obsolete form:
-[ExpectedException( typeof( ArgumentException ), "expected message" )]
-[ExpectedException( "System.ArgumentException", "expected message" )]
-
-// Prefered form:
-[ExpectedException( typeof( ArgumentException ), ExpectedMessage="expected message" )]
-[ExpectedException( "System.ArgumentException", ExpectedMessage="expected message" )]
- -

With NUnit 2.4, it is possible to specify additional tests on the -exception message, beyond a simple exact match. This is done using the -MatchType named parameter, whose argument is an enumeration, defined as -follows:

- -
-
public enum MessageMatch
-{
-    /// Expect an exact match
-    Exact,	
-    /// Expect a message containing the parameter string
-    Contains,
-    /// Match the regular expression provided as a parameter
-    Regex,
-    /// Expect a message starting with the parameter string
-    StartsWith
-}
- -

The following example is for a test that passes only if an ArgumentException -with a message containing "unspecified" is received.

- -
-
[ExpectedException( typeof( ArgumentException), ExpectedMessage="unspecified", MatchType=MessageMatch.Contains )]
-public void TestMethod()
-{
-...
- -

If MatchType is not specified, an exact match is used as before.

- -

Specifying a Custom Error Message

- -

With NUnit 2.4, it is possible to specify a custom message to be -displayed if the ExpectedException attribute is not satisfied. This -is done through the UserMessage named parameter...

- -
-
[ExpectedException( typeof( ArgumentException ), UserMessage="Custom message" )]
-public void TestMethod()
-{
-...
-
- -

Handling the Exception in Code

- -

If the processing required for an exception is too complex to express -in the attribute declaration, the normal practice is to process it in the -test code using a try/catch block. As an alternative, NUnit 2.4 allows -designating a method that will be called to process the exception. This -is particularly useful when multiple exceptions need to be processed -in the same way.

- -

An common exception handler may be designated by implementing the -IExpectExceptionInterface, which is defined as follows...

- -
-
public interface IExpectException
-{
-    void HandleException( System.Exception ex );
-}
-
- -

The exception handler is only called for methods marked with -the ExpectedException attribute. If all checks - including -the type of the exception - are to be performed in code, the -attribute may be specified without any arguments in order to -indicate that an exception is expected.

- -

An handler may be designated for a particular method -using the Handler named parameter.

- -
[ExpectedException( Handler="HandlerMethod" )]
-public void TestMethod()
-{
-...
-}
-
-public void HandlerMethod( System.Exception ex )
-{
-...
-}
- -

This technique may be -used without implementing IExpectException or in -combination with it. In the latter case, the designated handler -applies to any method that specifies it, while the normal -exception handler applies to any other methods that specify -an ExpectedException.

- -

However it is specified, the handler method should examine the exception and -Assert on whatever properties are relevant. Any resulting failure message -will then be consistent in format with other assertions performed in the tests.

- - -

Example:

- -
- -
- Language Filter - -
- -
namespace NUnit.Tests
-{
-  using System;
-  using NUnit.Framework;
-
-  [TestFixture]
-  public class SuccessTests
-  {
-    [Test]
-    [ExpectedException(typeof(InvalidOperationException))]
-    public void ExpectAnExceptionByType()
-    { /* ... */ }
-
-    [Test]
-    [ExpectedException("System.InvalidOperationException")]
-    public void ExpectAnExceptionByName()
-    { /* ... */ }
-  }
-}
-
- -
Imports System
-Imports Nunit.Framework
-
-Namespace Nunit.Tests
-
-  <TestFixture()> Public Class SuccessTests
-    <Test(), ExpectedException(GetType(Exception))>
-      Public Sub ExpectAnExceptionByType()
-    ' ...
-    End Sub
-
-  <TestFixture()> Public Class SuccessTests
-    <Test(), ExpectedException("System.Exception")>
-      Public Sub ExpectAnExceptionByName()
-    ' ...
-    End Sub
-  End Class
-End Namespace
-
- -
#using <Nunit.Framework.dll>
-using namespace System;
-using namespace NUnit::Framework;
-
-namespace NUnitTests
-{
-  [TestFixture]
-  public __gc class SuccessTests
-  {
-    [Test]
-    [ExpectedException(__typeof(InvalidOperationException))]
-    void ExpectAnExceptionByType();
-
-    [Test]
-    [ExpectedException(S"SystemInvalidOperationException")]
-    void ExpectAnExceptionByName();
-  };
-}
-
-#include "cppsample.h"
-
-namespace NUnitTests {
-  // ...
-}
-
- -
- -
- - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1da1cb5b/lib/NUnit.org/NUnit/2.5.9/doc/exceptionAsserts.html ---------------------------------------------------------------------- diff --git a/lib/NUnit.org/NUnit/2.5.9/doc/exceptionAsserts.html b/lib/NUnit.org/NUnit/2.5.9/doc/exceptionAsserts.html deleted file mode 100644 index b6da660..0000000 --- a/lib/NUnit.org/NUnit/2.5.9/doc/exceptionAsserts.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - -NUnit - ExceptionAsserts - - - - - - - - - - - - - -
- -

Exception Asserts (NUnit 2.5)

- -

The Assert.Throws method is pretty much in a class by itself. Rather than - comparing values, it attempts to invoke a code snippet, represented as - a delegate, in order to verify that it throws a particular exception. - -

It's also in a class by itself in that it returns an Exception, rather - than void, if the Assert is successful. See the example below for - a few ways to use this. - -

Assert.Throws may be used with a constraint argument, which is applied - to the actual exception thrown, or with the Type of exception expected. - The Type format is available in both both a non-generic and (in the .NET 2.0 version) - generic form. - -

Assert.DoesNotThrow simply verifies that the delegate does not throw - an exception. - -

Assert.Catch is similar to Assert.Throws but will pass for an exception - that is derived from the one specified. - -

-Exception Assert.Throws( Type expectedExceptionType, TestDelegate code );
-Exception Assert.Throws( Type expectedExceptionType, TestDelegate code, 
-		string message );
-Exception Assert.Throws( Type expectedExceptionType, TestDelegate code, 
-		string message, params object[] parms);
-
-Exception Assert.Throws( IResolveConstraint constraint, TestDelegate code );
-Exception Assert.Throws( IResolveConstraint constraint, TestDelegate code, 
-		string message );
-Exception Assert.Throws( IResolveConstraint constraint, TestDelegate code, 
-		string message, params object[] parms);
-
-T Assert.Throws<T>( TestDelegate code );
-T Assert.Throws<T>( TestDelegate code, string message );
-T Assert.Throws<T>( TestDelegate code, string message, 
-		params object[] parms);
-		
-void Assert.DoesNotThrow( TestDelegate code );
-void Assert.DoesNotThrow( TestDelegate code, string message );
-void Assert.DoesNotThrow( TestDelegate code, string message, 
-        params object[] parms);
-
-Exception Assert.Catch( TestDelegate code );
-Exception Assert.Catch( TestDelegate code, string message );
-Exception Assert.Catch( TestDelegate code, string message, 
-        params object[] parms);
-
-Exception Assert.Catch( Type expectedExceptionType, TestDelegate code );
-Exception Assert.Catch( Type expectedExceptionType, TestDelegate code, 
-		string message );
-Exception Assert.Catch( Type expectedExceptionType, TestDelegate code, 
-		string message, params object[] parms);
-
-T Assert.Catch<T>( TestDelegate code );
-T Assert.Catch<T>( TestDelegate code, string message );
-T Assert.Catch<T>( TestDelegate code, string message, 
-		params object[] parms);
-
- -

In the above code TestDelegate is a delegate of the form -void TestDelegate(), which is used to execute the code -in question. Under .NET 2.0, this may be an anonymous delegate. -If compiling under C# 3.0, it may be a lambda expression. - -

The following example shows different ways of writing the -same test. - -

-[TestFixture]
-public class AssertThrowsTests
-{
-  [Test]
-  public void Tests()
-  {
-    // .NET 1.x
-    Assert.Throws( typeof(ArgumentException),
-      new TestDelegate(MethodThatThrows) );
-	  
-    // .NET 2.0
-    Assert.Throws<ArgumentException>( MethodThatThrows() );
-
-    Assert.Throws<ArgumentException>(
-	  delegate { throw new ArgumentException(); } );
-
-    // Using C# 3.0	  
-    Assert.Throws<ArgumentException>(
-      () => throw new ArgumentException(); } );
-  }
-  
-  void MethodThatThrows()
-  {
-    throw new ArgumentException();
-  }
-
-
- -

This example shows use of the return value to perform -additional verification of the exception. - -

-[TestFixture]
-public class UsingReturnValue
-{
-  [Test]
-  public void TestException()
-  {
-    MyException ex = Assert.Throws<MyException>(
-      delegate { throw new MyException( "message", 42 ); } );
-    Assert.That( ex.Message, Is.EqualTo( "message" ) );
-    Assert.That( ex.MyParam, Is.EqualTo( 42 ) ); 
-  }
-
- -

This example does the same thing -using the overload that includes a constraint. - -

-[TestFixture]
-public class UsingConstraint
-{
-  [Test]
-  public void TestException()
-  {
-    Assert.Throws( Is.Typeof<MyException>()
-                 .And.Message.EqualTo( "message" )
-                 .And.Property( "MyParam" ).EqualTo( 42 ),
-      delegate { throw new MyException( "message", 42 ); } );
-  }
-
- -

Use the form that matches your style of coding. - -

Exact Versus Derived Types

- -

When used with a Type argument, Assert.Throws requires -that exact type to be thrown. If you want to test for any -derived Type, use one of the forms that allows specifying -a constraint. Alternatively, you may use Assert.Catch, -which differs from Assert.Throws in allowing derived -types. See the following code for examples: - -

-
-// Require an ApplicationException - derived types fail!
-Assert.Throws( typeof(ApplicationException), code );
-Assert.Throws<ApplicationException>()( code );
-
-// Allow both ApplicationException and any derived type
-Assert.Throws( Is.InstanceOf( typeof(ApplicationException), code );
-Assert.Throws( Is.InstanceOf<ApplicationException>(), code );
-
-// Allow both ApplicationException and any derived type
-Assert.Catch<ApplicationException>( code );
-
-// Allow any kind of exception
-Assert.Catch( code );
-
-
- -

See also...

- - -
- - - - - - - - - - - -