- The 1-based column number, or 0 if unspecified.
diff --git a/lib/Gallio_3.2.517.0/Gallio.Navigator.exe b/lib/Gallio_3.2.517.0/Gallio.Navigator.exe
new file mode 100644
index 00000000..f0cf06fb
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.Navigator.exe differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.Navigator.exe.config b/lib/Gallio_3.2.517.0/Gallio.Navigator.exe.config
new file mode 100644
index 00000000..87084015
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.Navigator.exe.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.Navigator.plugin b/lib/Gallio_3.2.517.0/Gallio.Navigator.plugin
new file mode 100644
index 00000000..031e0a72
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.Navigator.plugin
@@ -0,0 +1,22 @@
+
+
+
+ Gallio Navigator
+ 3.2.0.0
+ .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.dll b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.dll
new file mode 100644
index 00000000..131a41aa
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.dll-Help.xml b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.dll-Help.xml
new file mode 100644
index 00000000..3181c3ab
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.dll-Help.xml
@@ -0,0 +1,404 @@
+
+
+
+
+
+
+
+ Run-Gallio
+
+
+ Runs tests using Gallio.
+
+
+ Copyright © 2005-2009 Gallio Project - http://www.gallio.org/
+
+ Run
+ Gallio
+
+
+
+ The Run-Gallio cmdlet runs tests using Gallio.
+
+
+
+
+
+
+
+
+ ApplicationBaseDirectory
+
+ The relative or absolute path of the application base directory to use during test execution instead of the default.
+
+ String.Empty
+
+
+ Run-Gallio
+
+ Files
+
+ The list of comma-separated, relative or absolute paths of test files, projects and assemblies to execute. Wildcards may be used.
+
+
+
+
+ DoNotRun
+
+ Sets whether to load the tests but not run them. This option may be used to produce a report that contains test metadata for consumption by other tools.
+
+ false
+
+
+
+ Filter
+
+
+ Sets the filter set to apply, which consists of a sequence of one or more inclusion
+ or exclusion filter rules prefixed using 'include' (optional) or 'exclude'.
+ A filter rule consists of zero or more filter expressions
+ that may be combined using 'and', 'or', and 'not' and grouped with
+ parentheses. A filter expression consists of a filter key followed by one or
+ more comma-delimited matching values in the form 'key: value, "quoted value",
+ /regular expression/'.
+
+
+ *
+
+
+
+ HintDirectories
+
+ The list of directories used for loading referenced assemblies and other dependent resources.
+
+
+
+
+ NoEchoResults
+
+ Sets whether to echo results to the screen as tests finish. If this option is specified only the final summary statistics are displayed. Otherwise test results are echoed to the console in varying detail depending on the current verbosity level.
+
+ false
+
+
+
+ NoProgress
+
+ Sets whether progress information is shown during the execution. If this option is specified, the execution is silent and no progress information is displayed.
+
+ false
+
+
+
+ PluginDirectories
+
+ Additional Gallio plugin directories to search recursively.
+
+
+
+
+ ReportDirectory
+
+ Sets the name of the directory where the reports will be put.
+
+ "Reports"
+
+
+
+ ReportNameFormat
+
+ Sets the format string to use to generate the reports filenames.
+
+ test-report-{0}-{1}
+
+
+
+ ReportArchive
+
+ Indicates whether to enclose the resulting test report in a compressed archive file.
+
+ false
+
+
+
+ ReportTypes
+
+ A list of the types of reports to generate, separated by semicolons.
+
+ String.Empty
+
+
+
+ RunnerType
+
+ Sets the type of test runner to use (LocalAppDomain, IsolatedAppDomain or IsolatedProcess, but more could be available as plugins).
+
+ IsolatedProcess
+
+
+
+ ShadowCopy
+
+
+ Enables shadow copying when set to true. Shadow copying allows the original assemblies to be modified while the tests are running. However, shadow copying may occasionally cause some tests to fail if they depend on their original location.
+
+
+ false
+
+
+
+ DebugTests
+
+
+ Attaches the debugger to the test process.
+
+
+ false
+
+
+
+ ShowReports
+
+ Sets whether to open the generated reports once execution has finished.
+
+ false
+
+
+
+ WorkingDirectory
+
+
+ The relative or absolute path of the working directory to use during test execution instead of the default.
+
+
+ String.Empty
+
+
+
+ RuntimeVersion
+
+ The version of the .Net runtime to use for running tests. For the CLR, this must be the name of one of the framework directories in %SystemRoot%\Microsoft.Net\Framework. eg. 'v2.0.50727'. The default is null which uses the most recent installed and supported framework.
+
+
+
+
+
+
+
+
+
+
+ ApplicationBaseDirectory
+
+ The relative or absolute path of the application base directory.
+
+ String.Empty
+
+
+ Run-Gallio
+
+ Files
+
+ The list of comma-separated, relative or absolute paths of test files, projects and assemblies to execute. Wildcards may be used.
+
+
+
+
+ DoNotRun
+
+ Sets whether to load the tests but not run them. This option may be used to produce a report that contains test metadata for consumption by other tools.
+
+ false
+
+
+
+ Filter
+
+
+ Sets the filter set to apply, which consists of a sequence of one or more inclusion
+ or exclusion filter rules prefixed using 'include' (optional) or 'exclude'.
+ A filter rule consists of zero or more filter expressions
+ that may be combined using 'and', 'or', and 'not' and grouped with
+ parentheses. A filter expression consists of a filter key followed by one or
+ more comma-delimited matching values in the form 'key: value, "quoted value",
+ /regular expression/'.
+
+
+ *
+
+
+
+ HintDirectories
+
+ The list of directories used for loading referenced assemblies and other dependent resources.
+
+
+
+
+ NoEchoResults
+
+ Sets whether to echo results to the screen as tests finish. If this option is specified only the final summary statistics are displayed. Otherwise test results are echoed to the console in varying detail depending on the current verbosity level.
+
+ false
+
+
+
+ NoProgress
+
+ Sets whether progress information is shown during the execution. If this option is specified, the execution is silent and no progress information is displayed.
+
+ false
+
+
+
+ PluginDirectories
+
+ Additional Gallio plugin directories to search recursively.
+
+
+
+
+ ReportDirectory
+
+ Sets the name of the directory where the reports will be put.
+
+ "Reports"
+
+
+
+ ReportNameFormat
+
+ Sets the format string to use to generate the reports filenames.
+
+ test-report-{0}-{1}
+
+
+
+ ReportArchive
+
+ Indicates whether to enclose the resulting test report in a compressed archive file.
+
+ false
+
+
+
+ ReportTypes
+
+ A list of the types of reports to generate, separated by semicolons.
+
+ String.Empty
+
+
+
+ RunnerType
+
+ Sets the type of test runner to use: Local, IsolatedAppDomain, IsolatedProcess, or others that may be provided by plugins.
+
+ IsolatedProcess
+
+
+
+ RunnerExtensions
+
+ Specifies the type, assembly, and parameters of custom test runner extensions to use during the test run in the form: '[Namespace.]Type,Assembly[;Parameters]. eg. 'FancyLogger,MyExtensions.dll;ColorOutput,FancyIndenting'
+
+
+
+
+ ShadowCopy
+
+
+ Enables shadow copying when set to true. Shadow copying allows the original assemblies to be modified while the tests are running. However, shadow copying may occasionally cause some tests to fail if they depend on their original location.
+
+
+ false
+
+
+
+ DebugTests
+
+
+ Attaches the debugger to the test process.
+
+
+ false
+
+
+
+ ShowReports
+
+ Sets whether to open the generated reports once execution has finished.
+
+ false
+
+
+
+ WorkingDirectory
+
+
+ The relative or absolute path of the working directory. If relative, the path is based on the current working directory, so a value of "" (an empty string) causes the current working directory to be used.
+
+
+ String.Empty
+
+
+
+ RuntimeVersion
+
+ The version of the .Net runtime to use for running tests. For the CLR, this must be the name of one of the framework directories in %SystemRoot%\Microsoft.Net\Framework. eg. 'v2.0.50727'. The default is null which uses the most recent installed and supported framework.
+
+
+
+
+
+
+ # Makes the Gallio commands available
+ Add-PSSnapIn Gallio
+ # Runs TestAssembly1.dll
+ Run-Gallio "[Path-to-assembly1]\TestAssembly1.dll","[Path-to-assembly2]\TestAssembly2.dll","[Path-to-test-script1]/TestScript1_spec.rb","[Path-to-test-script2]/TestScript2.xml" -f Category:UnitTests -rd C:\build\reports -rf html -ra
+
+
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.plugin b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.plugin
new file mode 100644
index 00000000..971300f2
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.plugin
@@ -0,0 +1,21 @@
+
+
+
+ Gallio PowerShell Commands
+ 3.2.0.0
+ Provides PowerShell cmdlets for running tests with Gallio.
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.xml b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.xml
new file mode 100644
index 00000000..f3fe517c
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.PowerShellCommands.xml
@@ -0,0 +1,660 @@
+
+
+
+ Gallio.PowerShellCommands
+
+
+
+
+
+ Abstract base class for PowerShell commands.
+ Provides some useful runtime support.
+
+
+
+
+ Posts an action to perform later within the message loop.
+
+ The action to perform.
+
+
+
+
+ Starts a message pump running on the current thread and performs the
+ specified action in another thread. The action can asynchronously communicate back to the
+ cmdlet using on the current thread.
+
+ The action to perform.
+
+
+
+ Aborts the processing of the command.
+
+
+
+
+ The event dispatches when the command is asynchronously being stopped
+ via .
+
+
+
+
+ Gets the logger for the cmdlet.
+
+
+
+
+ Sets whether progress information is shown during the execution. If this option is specified,
+ the execution is silent and no progress information is displayed.
+
+
+
+ - This parameter takes the value true if present and false if not. No
+ value has to be specified.
+
+
+
+
+ # Shows progress information
+ Run-Gallio SomeAssembly.dll
+ # Hides progress information
+ Run-Gallio SomeAssembly.dll -np
+
+
+
+
+
+ Gets the progress monitor provider for the cmdlet.
+
+
+
+
+
+
+
+
+
+
+ The Gallio.PowerShellCommands namespace contains Powershell cmdlets for Gallio.
+
+
+
+
+ A PowerShell Cmdlet for running Gallio.
+
+
+ Only the parameter is required.
+
+
+ There are severals ways to run this cmdlet:
+
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+
+ Provided so that the unit tests can override test execution behavior.
+
+
+
+
+ The list of relative or absolute paths of test files, projects and assemblies to execute.
+ Wildcards may be used. This is required.
+
+
+ There are severals ways to pass the test files to the cmdlet:
+ Run-Gallio
+
+ cmdlet Run-Gallio at command pipeline position
+ Supply values for the following parameters:
+ Files[0]:
+ ]]>
+
+
+
+
+ The list of directories used for loading referenced assemblies and other dependent resources.
+
+
+ The following example shows how to specify the hint directories:
+
+ See the property for more ways of passing list of parameters to the cmdlet.
+
+
+
+
+ Additional Gallio plugin directories to search recursively.
+
+
+ The following example shows how to specify the plugin directories:
+
+ See the property for more ways of passing list of parameters to
+ the cmdlet.
+
+
+
+
+ Gets or sets the relative or absolute path of the application base directory,
+ or null to use a default value selected by the consumer.
+
+
+
+ If relative, the path is based on the current working directory,
+ so a value of "" causes the current working directory to be used.
+
+
+ The default is null.
+
+
+
+
+
+ Gets or sets the relative or absolute path of the working directory
+ or null to use a default value selected by the consumer.
+
+
+
+ If relative, the path is based on the current working directory,
+ so a value of "" causes the current working directory to be used.
+
+
+ The default is null.
+
+
+
+
+
+ Enables shadow copying when set to true.
+
+
+
+ Shadow copying allows the original assemblies to be modified while the tests are running.
+ However, shadow copying may occasionally cause some tests to fail if they depend on their original location.
+
+
+ The default is false.
+
+
+
+
+
+ Attaches the debugger to the test process when set to true.
+
+
+
+ The default is false.
+
+
+
+
+
+ Gets or sets the version of the .Net runtime to use for running tests.
+
+
+
+ For the CLR, this must be the name of one of the framework directories in %SystemRoot%\Microsoft.Net\Framework. eg. 'v2.0.50727'.
+
+
+ The default is null which uses the most recent installed and supported framework.
+
+
+
+
+
+ A list of the types of reports to generate, separated by semicolons.
+
+
+
+ - The types supported "out of the box" are: Html, Html-Inline, Text, XHtml,
+ XHtml-Inline, Xml, and Xml-Inline, but more types could be available as plugins.
+ - The report types are not case sensitives.
+
+
+
+ In the following example reports will be generated in both HTML and XML format:
+
+ See the property for more ways of passing list of parameters to
+ the cmdlet.
+
+
+
+
+ Sets the format string to use to generate the reports filenames.
+
+
+
+ Any occurence of {0} will be replaced by the date, and any occurrence of {1} by the time.
+
+
+ The default format string is test-report-{0}-{1} .
+
+
+
+
+
+ Sets the name of the directory where the reports will be put.
+
+
+
+ The directory will be created if it doesn't exist. Existing files will be overwritten.
+ The default report directory is "Reports".
+
+
+
+
+
+ Specifies to enclose the resulting reports into a compressed archive file (zip).
+
+
+
+
+
+ Sets the filter set to apply, which consists of a sequence of one or more inclusion
+ or exclusion filter rules prefixed using 'include' (optional) or 'exclude'.
+
+
+
+
+ A filter rule consists of zero or more filter expressions
+ that may be combined using 'and', 'or', and 'not' and grouped with
+ parentheses. A filter expression consists of a filter key followed by one or
+ more comma-delimited matching values in the form 'key: value, "quoted value",
+ /regular expression/'.
+
+ The filter grammar is defined as follows:
+
+ ::= [^:,*()/\"']+
+
+ ::= '"' .* '"' # String delimited by double quotation marks
+ | "'" .* "'" # String delimited by single quotation marks
+
+ ::=
+ |
+
+ ::= "/" .* "/" # Regular expression
+ | "/" .* "/i" # Case-insensitive regular expression
+
+ ::=
+
+ ::= # Value specified by exact string
+ | # Value specified by regular expression
+
+ ::= (',' )* # One or more comma-separated values
+
+ ::= "*" # "Any"
+ | ":" matchSeq>
+ | OR filterExpr> # Combine filter expressions with OR
+ | AND filterExpr> # Combine filter expressions with AND
+ | NOT # Negate filter expression
+ | "(" ")" # Grouping filter expression
+
+ ::= # Inclusion rule (default case)
+ | INCLUDE # Inclusion rule
+ | EXCLUDE # Exclusion rule
+
+ ::= # Filter set consists of at least one filter rule.
+ | # But may be a sequence of rules.
+ ]]>
+
+ - By default this property takes the value "*", which means the "Any" filter will be applied.
+ -
+ The operator precedence is, from highest to lowest: NOT, AND, and OR. All these operators are
+ left-associative.
+
+ -
+ The commas used to separate the values are interpreted as OR operators, so "Type:Fixture1,Fixture2"
+ is equivalent to "Type:Fixture1 or Type:Fixture2".
+
+ -
+ White-space is ignored outside quoted strings, so "Type:Fixture1|Type:Fixture2" is equivalent
+ to "Type : Fixture1 | Type : Fixture2".
+
+ -
+ Commas, colons, slashes, backslashes and quotation marks can be escaped with a backslash. For
+ example, \' will be interpreted as '. Using a single backslash in front of any other character
+ is invalid.
+
+ -
+ Currently the following filter keys are recognized:
+
+ - Id: Filter by id.
+ - Name: Filter by name.
+ - Assembly: Filter by assembly name.
+ - Namespace: Filter by namespace name.
+ - Type: Filter by type name, including inherited types.
+ - ExactType: Filter by type name, excluding inherited types.
+ - Member: Filter by member name.
+ -
+ *: All other names are assumed to correspond to metadata keys. See
for standard metadata keys. Common keys are: AuthorName, Category, Description, Importance, TestsOn.
+
+
+
+
+
+
+
+ Assuming the following fixtures have been defined:
+ The following filters could be applied:
+ -
+
Type: Fixture1
+ All the tests within Fixture1 will be run.
+
+
+ -
+
Member: Test1
+ Only Fixture1.Test1 and Fixture2.Test1 will be run.
+
+
+ -
+
Type: Fixture1, Fixture2
+ All the tests within Fixture1 or Fixture2 will be run.
+
+
+ -
+
Type:Fixture1 or Type:Fixture2
+ All the tests within Fixture1 or Fixture2 will be run.
+
+
+ -
+
Type:Fixture1, Fixture2 and Member:Test2
+ Only Fixture1.Test2 and Fixture2.Test2 will be run.
+
+
+ -
+
Type:/Fixture*/ and Member:Test2
+ Only Fixture1.Test2 and Fixture2.Test2 will be run.
+
+
+ -
+
AuthorName:AlbertEinstein
+ All the tests within Fixture1 will be run because its author attribute is set to "AlbertEinstein".
+
+
+ -
+
Category: IntegrationTest
+ All the tests within Fixture2 will be run because its category attribute is set to "IntegrationTest".
+
+
+ -
+
("Type": 'Fixture1' and "Member":/Test*/) or (Type : Fixture2 and Member: /Test*/)
+ All the tests will be run. This example also shows that you can enclose key and
+ values with quotation marks, and group expressions with parentheses.
+
+
+ -
+
exclude AuthorName: AlbertEinstein
+ All the tests within Fixture2 will be run because its author attribute is not set to "AlbertEinstein".
+
+
+ -
+
exclude Type: Fixture2 include Member: Test2
+ Only Fixture1.Test2 will be run because Fixture2 was excluded from consideration before the inclusion rule was applied.
+
+
+
+
+
+
+ Sets whether to open the generated reports once execution has finished.
+
+
+
+ - This parameter takes the value true if present and false if not. No
+ value has to be specified.
+ -
+ The reports are opened in a window using the default system application
+ registered to the report file type.
+
+
+
+
+
+
+
+
+
+ Sets the type of test runner to use.
+
+
+
+ - The types supported "out of the box" are:
Local , IsolatedAppDomain
+ and IsolatedProcess (default), but more types could be available as plugins.
+ - The runner types are not case sensitive.
+
+
+
+
+
+ Specifies the type, assembly, and parameters of custom test runner
+ extensions to use during the test run.
+
+
+
+ The value must be in the form '[Namespace.]Type,Assembly[;Parameters]' .
+
+
+
+ The following example runs tests using a custom logger extension:
+
+
+
+
+
+ Specifies option property key/value pairs for the test runner.
+
+
+ The following example specifies some extra NCover arguments.
+
+
+
+
+
+ Specifies option property key/value pairs for the report formatter.
+
+
+ The following example changes the default attachment content disposition for the reports.
+
+
+
+
+
+ Sets whether to load the tests but not run them.
+
+
+
+ This option may be used to produce a report that contains test metadata for consumption by other tools.
+
+
+
+
+
+ Sets whether to ignore annotations when determining the result code.
+
+
+
+ If false (default), then error annotations, usually indicative of broken tests, will cause
+ a failure result to be generated.
+
+
+
+
+
+ Sets whether to echo results to the screen as tests finish.
+
+
+
+ If this option is specified only the final summary statistics are displayed. Otherwise test results are echoed to the
+ console in varying detail depending on the current verbosity level.
+
+
+
+
+
+ Sets the maximum amount of time (in seconds) the tests can run
+ before they are canceled. The default is an infinite time to run.
+
+
+
+
+
+ A PowerShell SnapIn that registers the Gallio Cmdlets.
+
+
+
+
+ Gets the description of the snap-in.
+
+
+
+
+ Gets the name of the snap-in.
+
+
+
+
+ Gets the vendor of the snap-in.
+
+
+
+
+
+ Logs messages using a 's logging functions.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The instance to channel
+ log messages to.
+
+
+
+ Logs a message.
+
+ The log message severity.
+ The message to log.
+ The exception to log (it can be null).
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ Looks up a localized string similar to Gallio PowerShell Cmdlet - Version {0}.{1} build {2}.
+
+
+
+
+ Looks up a localized string similar to test-report-{0}-{1}.
+
+
+
+
+ Looks up a localized string similar to An unexpected error occurred during execution of the Gallio task..
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.Reports.dll b/lib/Gallio_3.2.517.0/Gallio.Reports.dll
new file mode 100644
index 00000000..5822544b
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.Reports.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.Reports.plugin b/lib/Gallio_3.2.517.0/Gallio.Reports.plugin
new file mode 100644
index 00000000..aebe29b7
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.Reports.plugin
@@ -0,0 +1,241 @@
+
+
+
+ Gallio Reports Library
+ 3.2.0.0
+ Provides several common report formats including Xml, Html, XHtml, MHtml and Text.
+ plugin://Gallio/Resources/Gallio.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Link
+
+
+ Xml
+
+ Generates XML reports with linked attachment files.
+
+ Supported report formatter properties:
+ - AttachmentContentDisposition: Specifies how attachments should be stored. "Absent", "Link" or "Inline". Default is "Link".
+
+
+
+
+
+
+ Inline
+
+
+ Xml-Inline
+ Generates XML reports with inline encoded attachments.
+
+
+
+
+
+ txt
+ text/plain
+ Absent
+ plugin://Gallio.Reports/Resources/
+ xsl/Gallio-Report.txt.xsl
+
+
+
+ Text
+ Generates plain text reports.
+
+
+
+
+
+ txt
+ text/plain
+ Absent
+ plugin://Gallio.Reports/Resources/
+ xsl/Gallio-Report.txt-condensed.xsl
+
+
+
+ Text-Condensed
+ Generates plain text reports without passing tests.
+
+
+
+
+
+ html
+ text/html
+ Link
+ plugin://Gallio.Reports/Resources/
+ xsl/Gallio-Report.html.xsl
+ css;js;img
+
+
+ Html
+
+ Generates HTML reports.
+
+ Supported report formatter properties:
+ - AttachmentContentDisposition: Specifies how attachments should be stored. "Absent", "Link" or "Inline". Default is "Link".
+
+
+
+
+
+
+ html
+ text/html
+ Link
+ plugin://Gallio.Reports/Resources/
+ xsl/Gallio-Report.html-condensed.xsl
+ css;js;img
+
+
+ Html-Condensed
+
+ Generates HTML reports that omit passing tests.
+
+ Supported report formatter properties:
+ - AttachmentContentDisposition: Specifies how attachments should be stored. "Absent", "Link" or "Inline". Default is "Link".
+
+
+
+
+
+
+ xhtml
+ text/xhtml+xml
+ Link
+ plugin://Gallio.Reports/Resources/
+ xsl/Gallio-Report.xhtml.xsl
+ css;js;img
+
+
+ XHtml
+
+ Generates XHTML reports.
+
+ Supported report formatter properties:
+ - AttachmentContentDisposition: Specifies how attachments should be stored. "Absent", "Link" or "Inline". Default is "Link".
+
+
+
+
+
+
+ xhtml
+ text/xhtml+xml
+ Link
+ plugin://Gallio.Reports/Resources/
+ xsl/Gallio-Report.xhtml-condensed.xsl
+ css;js;img
+
+
+ XHtml-Condensed
+
+ Generates XHTML reports that omit passing tests.
+
+ Supported report formatter properties:
+ - AttachmentContentDisposition: Specifies how attachments should be stored. "Absent", "Link" or "Inline". Default is "Link".
+
+
+
+
+
+
+ ${ReportFormatter.Html}
+
+
+ MHtml
+ Generates MHTML reports.
+
+
+
+
+
+ ${ReportFormatter.Html-Condensed}
+
+
+ MHtml-Condensed
+ Generates MHTML reports that omit passing tests.
+
+
+
+
+
+ plugin://Gallio.Reports/Resources/img/testkinds/
+ plugin://Gallio.Reports/Resources/css/Gallio-Report.Generated.css
+
+
+ true
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.Reports.xml b/lib/Gallio_3.2.517.0/Gallio.Reports.xml
new file mode 100644
index 00000000..fef2cb6d
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.Reports.xml
@@ -0,0 +1,229 @@
+
+
+
+ Gallio.Reports
+
+
+
+
+ Abstract base class for report formatters.
+
+
+
+
+ Gets the name of the option that how attachments are saved.
+
+
+
+
+ Creates a report formatter.
+
+
+
+
+ Gets the attachment content disposition.
+
+ The formatter options.
+ The attachment content disposition.
+
+
+
+
+
+
+ Gets or sets the default attachment content disposition.
+ Defaults to .
+
+
+
+
+
+ Formats MIME HTML archive reports similar to the web archives generated by Internet Explorer.
+ The report can then be sent to recipients as a single file.
+
+
+ Unfortunately the format is non-standard and cannot be read by most other browsers.
+
+
+
+
+
+ Creates a report formatter.
+
+ The HTML report formatter.
+ Thrown if is null.
+
+
+
+
+
+
+ A report container that saves a report as a multipart mime archive in a single file
+ within another container.
+
+
+ This is currently specialized for saving HTML reports.
+ It does not support loading reports.
+
+
+
+
+ Creates the multipart mime report container.
+
+ The container to which the archived report should be saved.
+ Thrown if is null.
+
+
+
+ Opens the archive within the inner container.
+
+ The path of the archive to create.
+ Thrown if is null.
+ Thrown if the archive has already been opened.
+
+
+
+ Finishes writing out the MIME archive and closes it.
+ Does nothing if the archive is not open.
+
+
+
+
+
+
+
+ The Gallio.Reports namespace provides report formatters for common Gallio test report types.
+
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ Installs derived resources for reports such as test framework icons.
+
+
+
+
+ Initializes the installer.
+
+ The test kind manager, not null.
+ The test kind image directory, not null.
+ The generated CSS file, not null.
+
+
+
+
+
+
+ Formats reports as Xml.
+
+
+
+ Recognizes the following options:
+
+
+ Option
+ Description
+
+ -
+
AttachmentContentDisposition
+ Overrides the default attachment content disposition for the format.
+ The content disposition may be "Absent" to exclude attachments, "Link" to
+ include attachments by reference to external files, or "Inline" to include attachments as
+ inline content within the formatted document. Different formats use different
+ default content dispositions.
+
+
+
+
+
+
+
+ Creates an Xml report formatter.
+
+
+
+
+
+
+
+
+ Generic XSLT report formatter.
+
+
+ Recognizes the following options:
+
+
+ Option
+ Description
+
+ -
+
AttachmentContentDisposition
+ Overrides the default attachment content disposition for the format.
+ The content disposition may be "Absent" to exclude attachments, "Link" to
+ include attachments by reference to external files, or "Inline" to include attachments as
+ inline content within the formatted document. Different formats use different
+ default content dispositions.
+
+
+
+
+
+
+
+ Creates an XSLT report formatter.
+
+ The preferred extension without a '.'
+ The content type of the main report document.
+ The resource directory.
+ The path of the XSLT relative to the resource directory.
+ The paths of the resources (such as images or CSS) to copy
+ to the report directory relative to the resource directory.
+ Thrown if any arguments are null.
+
+
+
+
+
+
+ Applies the transform to produce a report.
+
+
+
+
+ Copies additional resources to the content path within the report.
+
+
+
+
+ Populates the arguments for the XSL template processing.
+
+
+
+
+ Loads the XSL transform.
+
+ The full path of the XSLT.
+ The transform.
+
+
+
+ Gets the XSL transform.
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.UI.dll b/lib/Gallio_3.2.517.0/Gallio.UI.dll
new file mode 100644
index 00000000..bde35caa
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.UI.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.UI.plugin b/lib/Gallio_3.2.517.0/Gallio.UI.plugin
new file mode 100644
index 00000000..31ee4036
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.UI.plugin
@@ -0,0 +1,127 @@
+
+
+
+ Gallio UI Library
+ 3.2.0.0
+ Gallio UI components.
+ plugin://Gallio/Resources/Gallio.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Preferences
+ 0
+
+
+
+
+
+ Plugins
+ 100
+
+
+
+
+
+ Gallio
+ -100
+ plugin://Gallio/Resources/Gallio.ico
+
+
+
+
+
+ Gallio/Runtime
+ plugin://Gallio/Resources/Gallio.ico
+ Machine
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/Gallio.UI.xml b/lib/Gallio_3.2.517.0/Gallio.UI.xml
new file mode 100644
index 00000000..413c35b7
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.UI.xml
@@ -0,0 +1,1356 @@
+
+
+
+ Gallio.UI
+
+
+
+
+ Wrapper for static UnhandledExceptionPolicy
+ class (to improve testability).
+
+
+
+
+ Reports an unhandled exception.
+
+ A message to explain how the exception was intercepted.
+ The unhandled exception.
+ Thrown if or
+ is null.
+
+
+
+
+
+
+
+
+
+ Holder for the current sync context (e.g. the winforms current).
+
+
+
+
+ Wrapper for Send on the shared sync context.
+
+ The SendOrPostCallback delegate to call.
+ The object passed to the delegate.
+
+
+
+ Wrapper for Post on the shared sync context.
+
+ The SendOrPostCallback delegate to call.
+ The object passed to the delegate.
+
+
+
+ Returns a shared SynchronizationContext instance.
+
+
+ Usually used to stash a reference to the win forms synchronization
+ context (WindowsFormsSynchronizationContext.Current), used for
+ cross-thread data binding.
+
+
+
+
+ Presents the control panel dialog.
+
+
+
+
+ Presents the control panel dialog.
+
+
+
+
+ Shows the control panel dialog.
+
+ The dialog owner control.
+ The dialog result, either
+ or depending on how the dialog
+ was closed.
+
+
+
+ Creates a control panel presenter.
+
+ The preference page provider handles, not null.
+ The elevation manager, not null.
+
+
+
+
+
+
+ Base class for components that present control panel tabs.
+
+
+
+
+ Base class for user controls for editing settings with deferred application.
+
+
+
+
+ Applies pending settings changes.
+
+ An elevation context when
+ is true, otherwise null.
+ The progress monitor, not null.
+
+ The default implementation simply sets to false.
+
+
+
+
+ Raises the event.
+
+ The event arguments.
+
+
+
+ Raises the event.
+
+ The event arguments.
+
+
+
+ Event raised when the value of changes.
+
+
+
+
+ Event raised when the value of changes.
+
+
+
+
+ Gets or sets whether there are pending settings changes yet to be applied.
+
+
+
+
+ Gets or sets whether elevation will be required to apply pending modifications.
+
+
+
+
+ Creates a control panel tab.
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Describes the traits of a .
+
+
+
+
+ Creates a traits object for a control panel tab provider.
+
+ The control panel tab name.
+ Thrown if is null.
+ Thrown if is empty.
+
+
+
+ Gets the control panel tab name.
+
+
+
+
+ Gets or sets an integer index used to sort control panel tabs in ascending order.
+
+
+
+
+ Provides a preference pane to be incorporated into the Gallio control panel.
+
+
+
+
+ Creates a control panel tab to include in the control panel.
+
+ The control panel tab.
+
+
+
+ Presents a dialog with control panel options.
+
+
+
+
+ Creates a control panel dialog.
+
+
+
+
+ Adds a tab.
+
+ The tab name.
+ The tab factory.
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Gets or sets the elevation manager used to obtain an elevation context.
+
+
+
+
+ Gets or sets the progress monitor provider to use.
+
+
+
+
+ The Gallio.UI.ControlPanel.Plugins namespace contains types for a standard Control
+ Panel extension that displays installed plugins.
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ A control panel tab for managing installed plugins.
+
+
+
+
+ Creates a control panel tab for managing installed plugins.
+
+ The plugin registry, not null.
+
+
+
+
+
+
+ The Gallio.UI.ControlPanel namespace contains types for using and extending the
+ Preference Tab of the Gallio Control Panel UI.
+
+
+
+
+ Contains a preference pane and decorates it with a title.
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Gets or sets the preference pane, or null if none.
+
+
+
+
+ Gets or sets the preference pane title, or null if none.
+
+
+
+
+ Specifies the scope of the changes effected by a preference pane.
+
+
+
+
+ Changes affect the current user only.
+
+
+
+
+ Changes affect all users of the machine.
+
+
+
+
+ Applies changes made by the .
+
+
+
+
+
+
+
+ Base class for components that present preference panels.
+
+
+
+
+ Creates a preference pane.
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ A preference pane provider that is used as an empty placeholder for a
+ non-leaf node in the preference pane tree.
+
+
+
+
+ Provides a preference pane to be incorporated into the Gallio control panel.
+
+
+
+
+ Creates a preference pane to include in the control panel.
+
+ The preference pane.
+
+
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Provides the preference pane for the Gallio runtime paths.
+
+
+
+
+
+
+
+ Adds a preference pane.
+
+ The preference pane path consisting of slash-delimited name segments
+ specifying tree nodes.
+ The preference pane icon, or null if none.
+ The preference pane scope, or null if none.
+ The preference pane factory.
+
+
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Provides the preferences control panel tab.
+
+
+
+
+ Creates a control panel tab provider for preference panes.
+
+ The preference page provider handles, not null.
+
+
+
+
+
+
+ Describes the traits of a .
+
+
+
+
+ Creates a traits object for a preference pane provider.
+
+ The preference pane path consisting of slash-delimited name segments
+ specifying tree nodes.
+ Thrown if is null.
+ Thrown if is empty.
+
+
+
+ Gets the preference pane path consisting of slash-delimited name segments
+ specifying tree nodes.
+
+
+
+
+ Gets or sets an icon (16x16) for the preference pane, or null if none.
+
+
+
+
+ Gets or sets an integer index used to sort control panel tabs in ascending order.
+
+
+
+
+ Gets or sets a value that describes the scope of the changes effected by a preference pane.
+
+ The scope. by default.
+
+
+
+ The Gallio.UI.ControlPanel namespace contains types for using and extending the
+ Gallio Control Panel UI.
+
+
+
+
+ Extends the win forms ToolStripMenuItem to wrap a MenuCommand.
+
+
+
+
+ Constructor providing a menu command.
+
+
+ When clicked, the command will be run synchronously.
+
+ The command to use.
+
+
+
+ Constructor providing a command and task manager.
+
+
+ When clicked, the command will be queued with the
+ supplied task manager.
+
+ The command to use.
+ The task manager to use.
+
+
+
+ Constructor providing a command, task manager and keys parser.
+
+ The command to use.
+ The task manager to use.
+ The keys parser to use.
+
+
+
+ A menu item that truncates the text, using ellipses (...), if necessary.
+
+
+
+
+ Sub-class of ToolStripMenuItem ,
+ making databinding easier.
+
+
+
+
+ Gets or sets the collection of currency managers for the IBindableComponent.
+
+
+
+
+ Gets the collection of data-binding objects for this IBindableComponent.
+
+
+
+
+ Ctor.
+
+ The text for the menu item to display.
+ The full text will be the tooltip, but the display text
+ will be truncated if longer than specified.
+ The maximum length text to display.
+
+
+
+ Parses a string representation of a enum.
+
+
+
+
+ Parses a string representation of a enum.
+
+ The shortcut string to parse.
+ A enum.
+
+ For example, "Ctrl + S" would parse as Keys.Control | Keys.S
+
+
+
+
+
+
+
+
+
+
+ Sub-class of ToolStripButton ,
+ making databinding easier.
+
+
+
+
+ Gets or sets the collection of currency managers for the IBindableComponent.
+
+
+
+
+ Gets the collection of data-binding objects for this IBindableComponent.
+
+
+
+
+ Wrapper for a field, that implements INotifyPropertyChanged.
+
+ The type to wrap.
+
+ All credit to Ayende:
+ http://ayende.com/Blog/archive/2009/08/08/an-easier-way-to-manage-inotifypropertychanged.aspx
+
+
+
+
+ Default constructor.
+
+
+
+
+ Constructor initializing field.
+
+ The initial value to wrap.
+
+
+
+ Implicit operator allowing use of value.
+
+
+
+
+
+
+ The value being wrapped.
+
+
+
+
+ Event fired when the value changes.
+
+
+
+
+ List that raises an event when the contents are modified.
+
+ Wraps a List<T>.
+ The type of elements in the list.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Copies the elements of the list to a new array.
+
+ An array containing copies of the elements of the list.
+
+
+
+ Adds the elements of the specified collection to the end of the list.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Presents an error dialog consisting of a title, a message and a detailed message.
+
+
+
+
+ Creates the dialog.
+
+
+
+
+ Shows the error dialog.
+
+ The owner window, or null if none.
+ The error title.
+ The error message.
+ The error details.
+ Thrown if ,
+ or is null.
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Gets or sets the error title.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the error message.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the error details.
+
+ Thrown if is null.
+
+
+
+ Gets or sets whether the error details panel is visible.
+
+
+
+
+ The Gallio.UI.Controls namespace contains types for reusable Windows Forms custom controls.
+
+
+
+
+ An extension of the Button class that displays the "Shield" icon when
+ privilege elevation is required.
+
+
+
+
+ Creates a shield button.
+
+
+
+
+ Raises the event.
+
+ The event arguments.
+
+
+
+ An event raised when the value of has changed.
+
+
+
+
+ Gets or sets whether the shield icon should be displayed.
+
+
+
+
+ Installs an unhandled exception handler that displays an error dialog.
+
+
+
+
+ Installs the handler.
+
+
+
+ The handler is automatically removed when the form is disposed.
+
+
+ The owner window.
+ Thrown if is null.
+ Thrown if there is already a handler installed for a different owner.
+
+
+
+ Uninstalls the handler.
+
+
+
+
+ Runs an application
+
+ The main form.
+
+
+
+ Marker class for Events.
+
+
+
+
+
+
+
+ An event aggregator.
+ http://martinfowler.com/eaaDev/EventAggregator.html
+
+
+
+
+ Send an event to all interested parties (synchronous).
+
+ The message to send.
+ The type of event.
+
+
+
+ Ctor.
+
+ A service locator used to find registered handlers.
+
+
+
+
+
+
+ Proxy event handler.
+
+ The type of event.
+
+
+
+ Marker interface used by the EventAggregator to
+ locate classes interested in an event.
+
+ The type of event.
+
+
+
+ Handle an .
+
+ The event to handle.
+
+
+
+ Ctor.
+
+ The handler to proxy for.
+
+
+
+
+
+
+ Wraps an ICommand and provides
+ hints for the UI.
+
+
+ Inspired by the WPF Command pattern.
+ http://msdn.microsoft.com/en-us/library/system.windows.input.icommand.aspx
+
+
+
+
+ Default constructor.
+
+
+
+
+ The command that will be executed.
+
+
+
+
+ Whether the command can currently be executed, or not.
+
+
+ Defaults to true.
+
+
+
+
+ The text description of the command.
+
+
+
+
+ The shortcut to use for the command.
+
+
+
+
+ The image to use for the command.
+
+
+
+
+ A task queue, for use by the .
+
+
+
+
+ Adds a task to the specified queue.
+
+ The id of the queue to use.
+ An to queue.
+
+
+
+ Get the next task for the specified queue.
+
+ The id of the queue to use.
+ An , or null if the queue is empty.
+
+
+
+ Removes all tasks from the specified queue.
+
+ The id of the queue to use.
+
+
+
+ Takes care of running queued tasks.
+
+
+
+
+ Run the next task for a named queue, if there is one.
+
+ The id of the queue to use.
+
+
+
+ Event fired when a task is cancelled.
+
+
+
+
+ Ctor.
+
+ The id of the queue.
+
+
+
+ The id of the queue.
+
+
+
+
+ Event fired when a task is completed.
+
+
+
+
+ Ctor.
+
+ The id of the queue.
+
+
+
+ The id of the queue.
+
+
+
+
+ Manages multiple queues of tasks.
+
+
+ Queue id is an arbitrary string, used as a key.
+
+
+
+
+ Ctor.
+
+
+
+
+ Adds a task to the specified queue.
+
+ The id of the queue to use.
+ An to queue.
+
+
+
+ Get the next task for the specified queue.
+
+ The id of the queue to use.
+ An , or null if the queue is empty.
+
+
+
+ Removes all tasks from the specified queue.
+
+ The id of the queue to use.
+
+
+
+
+
+
+ Ctor.
+
+ The task queue to use.
+ An event aggregator.
+ An exception policy.
+
+
+
+
+
+
+ Command pattern.
+
+
+
+
+ Run a task (with progress information).
+
+ The progress monitor.
+
+
+
+ A task manager for UI applications.
+
+
+
+
+ Run a task as a background action (uses ThreadPool).
+ No progress information will be displayed.
+
+ The action to perform.
+
+
+
+ Empty the queue of tasks.
+
+
+
+
+
+
+
+ Add a task to the queue. If nothing is in the queue or
+ running, then the task will be executed.
+
+ The command to queue.
+
+
+
+
+
+
+ Progress dialog.
+
+
+
+
+ Default constructor.
+
+ The progress monitor to display information for.
+
+
+
+
+
+
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+
+
+
+ Default constructor.
+
+ A task queue.
+ A task runner.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Event fired when a task is started.
+
+
+
+
+ Ctor.
+
+ The queue id.
+ A progress monitor.
+
+
+
+ The id of the queue.
+
+
+
+
+ A progress monitor attached to the task.
+
+
+
+
+ Impl of a tool strip progress bar for Gallio progress monitoring.
+
+
+
+
+ Total work to do.
+
+
+
+
+ Total work to do.
+
+
+
+
+
+ An optimized HTML renderer for individual test step runs and their descendants.
+
+
+
+
+
+ Attempting to load flash content in a 64bit process on Windows is doomed to failure
+ because Adobe does not ship a 64bit version of the Flash plug-in at this time.
+ Unfortunately instead of failing gracefully, what happens is that Windows pops up a
+ warning dialog (when the browser is disposed) complaining about a missing flash.ocx.
+
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ The Gallio.UI.Reports namespace contains types for formatting reports for
+ display in a Windows Forms UI.
+
+
+
+
+
+ Displays a summary of a set of test step runs.
+
+
+ This control is optimized to display individual test run results to the user on
+ demand more quickly than could be done if we had to show the whole report at once.
+
+
+
+
+
+ Creates a test step run viewer.
+
+
+
+
+ Clears the contents of the report viewer and discards all cached content.
+
+
+
+
+ Displays information about a set of test step run.
+
+ The test step runs.
+
+
+
+ Displays information about a set of test step runs, using additional
+ information from the test model when available.
+
+ The test step runs.
+ The test model data, or null if not available.
+
+
+
+ Required designer variable.
+
+
+
+
+ Clean up any resources being used.
+
+ true if managed resources should be disposed; otherwise, false.
+
+
+
+ Required method for Designer support - do not modify
+ the contents of this method with the code editor.
+
+
+
+
+ Node check box.
+
+
+
+
+ Node check box.
+
+
+
+
+ Gets the value from the node.
+
+ The node.
+ The value.
+
+
+
+ Sets the check state of the node.
+
+ The node.
+ The value.
+
+
+
+ Gets the new check state.
+
+ The state.
+ The new check state.
+
+
+
+ A three-state node.
+
+
+
+
+ Default ctor.
+
+
+
+
+ Ctor.
+
+ The text to display.
+
+
+
+ Returns the 'combined' state for all siblings of a node.
+
+
+
+
+ Manages updating related child and parent nodes of this instance.
+
+
+
+
+ Recursively update child node's state based on the state of this node.
+
+
+
+
+ Allows inheriting classes to block cascading check state.
+
+ The child to evaluate.
+ The proposed check state.
+ True if the check state can be cascaded, otherwise false.
+
+
+
+ Recursively update parent node state based on the current state of this node.
+
+
+
+
+ The check state of the node
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.Utility.exe b/lib/Gallio_3.2.517.0/Gallio.Utility.exe
new file mode 100644
index 00000000..6bfe6b48
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.Utility.exe differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.Utility.exe.config b/lib/Gallio_3.2.517.0/Gallio.Utility.exe.config
new file mode 100644
index 00000000..8a56ceb1
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.Utility.exe.config
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.Utility.plugin b/lib/Gallio_3.2.517.0/Gallio.Utility.plugin
new file mode 100644
index 00000000..f85e0c44
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.Utility.plugin
@@ -0,0 +1,18 @@
+
+
+
+ Gallio Utility
+ 3.2.0.0
+ A command-line utility for performing maintenance tasks related to the Gallio installation.
+ plugin://Gallio.Utility/Resources/Gallio.Utility.ico
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/Gallio.VisualStudio.Interop.dll b/lib/Gallio_3.2.517.0/Gallio.VisualStudio.Interop.dll
new file mode 100644
index 00000000..11c95753
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.VisualStudio.Interop.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.VisualStudio.Interop.plugin b/lib/Gallio_3.2.517.0/Gallio.VisualStudio.Interop.plugin
new file mode 100644
index 00000000..3af8b371
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.VisualStudio.Interop.plugin
@@ -0,0 +1,28 @@
+
+
+
+ Visual Studio Interoperability Plugin
+ 3.2.0.0
+ Provides support for opening files in Visual Studio and launching the debugger.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/Gallio.XmlSerializers.dll b/lib/Gallio_3.2.517.0/Gallio.XmlSerializers.dll
new file mode 100644
index 00000000..e7c17aa4
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.XmlSerializers.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.dll b/lib/Gallio_3.2.517.0/Gallio.dll
new file mode 100644
index 00000000..2e235578
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.pdb b/lib/Gallio_3.2.517.0/Gallio.pdb
new file mode 100644
index 00000000..dc33a316
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio.pdb differ
diff --git a/lib/Gallio_3.2.517.0/Gallio.plugin b/lib/Gallio_3.2.517.0/Gallio.plugin
new file mode 100644
index 00000000..107ffe9c
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.plugin
@@ -0,0 +1,654 @@
+
+
+
+ Gallio
+ 3.2.0.0
+ The heart of Gallio.
+ plugin://Gallio/Resources/Gallio.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Fallback
+ plugin://Gallio/Resources/Gallio.ico
+
+
+
+
+
+ ${Gallio.FallbackTestFramework}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${Gallio.LocalTestIsolationProvider}
+
+
+ Local
+ Runs tests locally within the same process and AppDomain as the test runner application. Each test isolation context runs locally. This mode offers no isolation between tests and the test runner; it does not support loading test assembly configuration files or using a different runtime version or processor architecture.
+
+
+
+
+
+ ${Gallio.IsolatedAppDomainTestIsolationProvider}
+
+
+ IsolatedAppDomain
+ Runs tests within an isolated AppDomain of the same process as the test runner application. Each test isolation context runs in its own AppDomain. This mode provides lightweight but limited isolation between tests and the test runner; it does not support using different runtime version or processor architecture.
+
+
+
+
+
+ ${Gallio.IsolatedProcessTestIsolationProvider}
+
+
+ IsolatedProcess
+ Runs tests within an isolated process external to the test runner. Each test isolation context runs in its own process. This mode protects the test runner application from most faults that may occur during test execution; it supports all features.
+
+
+
+
+
+
+
+ ${Gallio.LocalHostFactory}
+
+
+
+
+
+ ${Gallio.IsolatedAppDomainHostFactory}
+
+
+
+
+
+ ${Gallio.IsolatedProcessHostFactory}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Project
+ A Gallio project file.
+ .*\.gallio
+
+
+
+
+
+ Executable
+ A library or program file.
+ .*\.(dll|exe)
+
+
+
+
+
+ Assembly
+ A .Net assembly.
+ Executable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ClearCurrentUserPluginCache
+ Clears the plugin cache of the current user.
+
+
+
+
+
+ FormatReport
+ Formats an existing XML test report. The command must be used with the following syntax:
+ "FormatReport {file} /ReportType:{type} [/ReportNameFormat:{format} /ReportOutput:{dir} /ReportArchive]"
+ - {file} is the relative or absolute path of the existing XML test report.
+ - ReportType (short form: /rt) specifies the type of the output report ('txt', 'txt-common', 'txt-condensed', 'html', 'html+xhtml', 'html-condensed', 'xhtml', 'xhtml-condensed', 'ccnet-details', or 'ccnet-details-condensed')
+ - ReportNameFormat (short form: /rnf) specifies the format of the output report (optional; if not specified, the same name is kept). The tags '{0}' and '{1}' are replaced respectively by the date and the time of the test run, or by the curent date/time if not applicable.
+ - ReportOutput (short form: /ro) specifies the output directory (optional; if not specified the current directory is used).
+ - ReportArchive (short form: /ra) compresses the output report in a file archive (zip).
+
+
+
+
+
+ VerifyInstallation
+ Checks for runtime installation errors.
+
+
+
+
+
+ Setup
+ Installs or uninstalls components.
+
+
+
+
+
+ ResetInstallationId
+ Resets the installation id. The plugin list will be refreshed the next time a Gallio application is started.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Root
+ The root node of the test tree.
+ plugin://Gallio/Resources/Assembly.ico
+
+
+
+
+
+ Assembly
+ A test assembly.
+ plugin://Gallio/Resources/Assembly.ico
+
+
+
+
+
+ File
+ A test file.
+ plugin://Gallio/Resources/Container.ico
+
+
+
+
+
+ Namespace
+ A test namespace.
+ plugin://Gallio/Resources/Container.ico
+
+
+
+
+
+ Group
+ A test group.
+ plugin://Gallio/Resources/Container.ico
+
+
+
+
+
+ Suite
+ A test suite.
+ plugin://Gallio/Resources/Container.ico
+
+
+
+
+
+ Fixture
+ A test fixture.
+ plugin://Gallio/Resources/Fixture.ico
+
+
+
+
+
+ Test
+ A test case.
+ plugin://Gallio/Resources/Test.ico
+
+
+
+
+
+ Unsupported
+ An unsupported test.
+ plugin://Gallio/Resources/Unsupported.ico
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio.xml b/lib/Gallio_3.2.517.0/Gallio.xml
new file mode 100644
index 00000000..a60f4129
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio.xml
@@ -0,0 +1,44319 @@
+
+
+
+ Gallio
+
+
+
+
+ Represents a method that returns a value of a specified type from the instance of an object.
+
+
+
+ It is usually used to represent the invocation of a type property.
+
+
+ The type of the object to get the value from.
+ The type of the returned value.
+ The object to get the value from.
+ The returned value.
+
+
+
+ An action with no arguments.
+
+
+
+
+ An action with two arguments.
+
+ The first argument type.
+ The second argument type.
+ The first argument.
+ The second argument.
+
+
+
+ An action with three arguments.
+
+ The first argument type.
+ The second argument type.
+ The third argument type.
+ The first argument.
+ The second argument.
+ The third argument.
+
+
+
+ An action with four arguments.
+
+ The first argument type.
+ The second argument type.
+ The third argument type.
+ The fourth argument type.
+ The first argument.
+ The second argument.
+ The third argument.
+ The fourth argument.
+
+
+
+ An action with five arguments.
+
+ The first argument type.
+ The second argument type.
+ The third argument type.
+ The fourth argument type.
+ The fifth argument type.
+ The first argument.
+ The second argument.
+ The third argument.
+ The fourth argument.
+ The fifth argument.
+
+
+
+ Encapsulates various strategies for counting the number of elements in a collection, an array, or
+ a simple enumerable type.
+
+
+
+
+ Constructor.
+
+ The collection, the array, or the simple enumerable object to count elements.
+ Thrown if is null.
+
+
+
+ Counts the number of elements in a collection, an array, or any other enumerable type, by
+ using the most appropriate strategies.
+
+ An enumeration of counting strategies applicable to the specified enumerable values.
+
+
+
+ Represents a strategy for counting the number of elements in a collection, an array, or a simple enumerable type.
+
+
+
+
+ Gets the name of the counting strategy.
+
+
+
+
+ Gets a displayable description of the counting strategy.
+
+
+
+
+ Returns the number of elements found by applying the current counting strategy.
+
+ The number of elements found.
+
+
+
+ Name of the existing counting strategies.
+
+
+
+
+ Counts by getting the value returned by the property getter.
+
+
+
+
+ Counts by getting the value returned by the or property getter.
+
+
+
+
+ Counts by enumerating the elements returned by .
+
+
+
+
+ Counts by getting the value returned by an existing public "Count" property getter.
+
+
+
+
+ Represents the method that compares two objects of the same type.
+
+
+
+ This is a non-generic version of .
+
+
+ The first object to compare.
+ The second object to compare.
+ a negative value if x is less than y, zero if x equals y, or a positive value if x is greater than y.
+
+
+
+ A function that returns the maximum number of threads that a work scheduler
+ may use to perform work. The value may change over time and cause the
+ scheduler to adapt to changing degrees of parallelism.
+
+ The degree of parallelism which must be at least 1.
+
+
+
+
+ Wrapper for to allow testing.
+
+
+
+
+
+ Checks whether a module with the specified file name is
+ loaded in the process.
+
+ The file name.
+ true if the module is loaded; otherwise, false.
+
+
+
+ Immediately stops the associated process.
+
+
+
+
+
+ Discards any information about the associated process
+ that has been cached inside the process object.
+
+
+
+
+ Causes the object to wait indefinitely for
+ the associated process to enter an idle state. This overload applies
+ only to processes with a user interface and, therefore, a message loop.
+
+ true if the associated process has reached an idle state.
+
+
+
+ Causes the object to wait the specified number
+ of milliseconds for the associated process to enter an idle state. This
+ overload applies only to processes with a user interface and, therefore,
+ a message loop.
+
+
+ A value of 1 to that specifies the amount of
+ time, in milliseconds, to wait for the associated process to become idle.
+ A value of 0 specifies an immediate return, and a value of -1 specifies
+ an infinite wait.
+
+
+ true if the associated process has reached an idle state; otherwise, false.
+
+
+
+
+ Gets a value indicating whether the associated process has been terminated.
+
+
+
+
+ Gets or sets the properties to passed to the
+ method of the underlying .
+
+
+
+
+ Gets the unique identifier for the associated process.
+
+
+
+
+ Wraps the static process creation methods on to allow testing.
+
+
+
+
+ Starts the process and associates it with a new object.
+
+ The process start info.
+ The new process.
+
+
+
+ Wraps the static process query methods on to allow testing.
+
+
+
+
+ Creates an array of objects for all
+ processes on the local compuer that share the specified name.
+
+ The friendly name of he process.
+ An array of objects.
+
+
+
+
+ Default implementation of using .
+
+
+
+
+
+
+
+ Default implementation of using .
+
+
+
+
+
+
+
+ Default implementation of using .
+
+
+
+
+ Creates a new process wrapper.
+
+ A process.
+ If is null.
+
+
+
+
+
+
+ Releases the resources used by the .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Schedules actions to be run in parallel up to a specified (variable)
+ maximum number of threads.
+
+
+
+ The implementation is designed to support re-entrance while still maintaining an
+ upper bound on active thread count. To avoid blowing the limit on thread count
+ due to re-entrance the caller's thread is also used to schedule work.
+
+
+ The work scheduler supports dynamically adjusting the degree of parallelism
+ as new work is added.
+
+
+
+
+
+ Creates a work scheduler.
+
+ A function that determines
+ the current degree of parallelism which may change over time.
+ Thrown if
+ is null.
+
+
+
+ Runs a set of actions in parallel up to the current degree of parallelism.
+
+
+
+ The implementation guarantees that the current thread will only be used to
+ run actions from the provided work set; it will not be used to run actions
+ from other concurrently executing work sets. Other threads will be used
+ to run actions from this work set and from other work sets in the order in
+ which they were enqueued. Thus this function will return as soon as all
+ of the specified actions have completed even if other work sets have
+ pending work.
+
+
+ The actions to run.
+ Thrown if is null
+ or contains null.
+
+
+
+ Holds the value or exception produced by a task.
+
+
+
+
+
+
+
+ Returns true if the task ran to completion and returned a value,
+ or false if an exception was thrown.
+
+
+
+
+ Gets the value that was returned by the task.
+
+ Thrown if is false.
+
+
+
+ Gets the exception that was thrown by the task.
+
+ Thrown if is true.
+
+
+
+ Holds the value or exception produced by a task.
+
+
+
+
+ Creates a result object containing the value returned by the task.
+
+ The new task result.
+ The value.
+
+
+
+ Creates a result object containing the exception thrown by the task.
+
+ The exception.
+ The new task result.
+ Thrown if is null.
+
+
+
+ Gets the value that was returned by the task.
+
+ Thrown if is false.
+
+
+
+ Redirects the console streams.
+
+
+
+
+ Redirect console output and error stream and disables the console input stream.
+
+ The new console output writer.
+ The new console error writer.
+ Thrown if
+ or is null.
+
+
+
+ Resets the console streams as they were initially.
+
+
+
+
+ Resets the console streams as they were initially.
+
+ True if was called directly.
+
+
+
+ Abstract representation of a binary or text resource.
+
+
+
+ Different kind of resources are supported:
+
+ - Inline resources from a storage in memory.
+ - Embedded resources from an assembly manifest.
+ - File resources.
+
+
+
+
+
+
+ Opens the current resource as a .
+
+ The stream.
+
+
+
+ Opens the current resource as a .
+
+ The text reader.
+
+
+
+ Returns true if the contents are dynamic, or false if they are static.
+
+
+
+ Static contents can only change if the test assembly is recompiled.
+
+
+
+
+
+ Gets or sets a that is used to locate the assembly and namespace within which to resolve a manifest resource.
+
+
+
+
+ Represents a resource embedded in an assembly file.
+
+
+
+
+ Constructs the representation of an embedded resource.
+
+ The qualified or unqualified name of the resource.
+ When is unqualified, a type used to locate the assembly and namespace within which to resolve the manifest resource.
+
+
+
+
+
+
+
+
+
+
+
+
+ Representation of a file resource.
+
+
+
+
+ Constructs the representation of a file resource.
+
+ The path of the file.
+
+
+
+ Constructs the representation of a file resource.
+
+ The path of the file.
+ A file system wrapper
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents an inline memory resource.
+
+
+
+
+ Constructs the representation of an inline memory resource.
+
+ The content of the resource as a string.
+
+
+
+
+
+
+
+
+
+
+
+
+ Lazy computation type.
+
+ The encapsulated type.
+
+
+
+ Constructor.
+
+ A function which computes the value on first request.
+ Thrown if is null.
+
+
+
+ Gets the value.
+
+
+
+
+ Specifies the type of the contents of an embedded attachment.
+
+
+
+
+ The attachment is encoded as a text string.
+
+
+
+
+ The attachment is a binary file either directly available as a file, or encoded as base 64 text string.
+
+
+
+
+ Utilities for normalizing markup contents.
+
+
+
+
+ Normalizes a content type.
+
+ The content type, or null if none.
+ The normalized content type, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes an attachment name.
+
+ The attachment name, or null if none.
+ The normalized attachment name, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a stream name.
+
+ The stream name, or null if none.
+ The normalized stream name, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a section name.
+
+ The section name, or null if none.
+ The normalized section name, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes markup text.
+
+ The text, or null if none.
+ The normalized text, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Implementation of a Chi-square test (http://en.wikipedia.org/wiki/Chi_square_test)
+ that calculates the "difference" between an expected and an actual statistical distribution.
+
+
+
+
+ Runs a Chi-square test.
+
+
+
+ Given the observed events ( ) and the expected events ( ),
+ calculates the number of degrees of freedom, the chi-square value, and the significance probability.
+
+
+ A small value of the significance probability indicates a significant difference between the distributions.
+
+
+
+
+
+
+
+
+ Gets the resulting number of degrees of freedom.
+
+
+
+
+ Gets the resulting Chi-square value.
+
+
+
+
+ Gets the resulting significance probability.
+
+
+
+
+ Helper methods to calculate the Gamma function (http://en.wikipedia.org/wiki/Gamma_function).
+
+
+
+
+ Returns the incomplete Gamma function Q(a,x).
+
+
+
+
+
+
+
+ The Gallio.Common.Math namespace provides advanced mathematical
+ functions and helper classes not found in .
+
+
+
+
+ An interface implemented by the server and registered on the server remoting channel
+ to allow message exchange with the client.
+
+
+
+ This is interim API to be used until the new message broker is ready.
+
+
+
+
+
+ Gets the next message.
+
+ The maximum amount of time to wait for a message.
+ The next message, or null if a timeout occurred.
+
+
+
+ Sends a message.
+
+ The message to send.
+
+
+
+ A message consumer provides a simple pattern for handling messages based on their type.
+
+
+
+ A message consumer consists of a series of typed handler clauses which are traversed in
+ order until a handler which matches the message type is found.
+
+
+
+
+ (message => DoSomethingWithFooMessage(message))
+ .Handle(message => DoSomethingWithBarMessage(message))
+ .Otherwise(message => throw new NotSupportedException());
+
+ consumer.Consume(new FooMessage());
+ consumer.Consume(new BarMessage());
+ ]]>
+
+
+
+
+
+ Publishes messages directly to a subscriber.
+
+
+
+
+ Publishes a message.
+
+ The message.
+ Thrown if is null.
+ Thrown if is not valid.
+
+
+
+ Creates a new message consumer with no handler clauses.
+
+
+
+
+ Consumes a message.
+
+ The message to consume.
+ True if the message was consumed by a handler, false if no handler could consume it.
+ Thrown if is null.
+ Thrown if is not valid.
+
+
+
+ Adds a handler for a particular message type.
+
+ The message type.
+ The message handler action.
+ The message consumer.
+ Thrown if is null.
+
+
+
+ Adds a catch-all handler.
+
+ The message handler action.
+ The message consumer.
+ Thrown if is null.
+
+
+
+ The Gallio.Common.Messaging namespace provides an abstraction for
+ sending messages between components.
+
+
+
+
+ The type of exception thrown when an error occurs while manipulating the disk cache.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ A disk cache manages temporary files and directories stored on disk and
+ arranged into groups associated with arbitrary string keys.
+
+
+
+ The files and directories within each group are assumed to have the same lifetime.
+
+
+
+ Write a file to the cache:
+
+
+
+
+
+ Deletes all items in the cache.
+
+ Thrown if an error occurs.
+
+
+
+ Gets the collection of disk cache groups.
+
+
+
+
+ A disk cache group represents an indexed partition of the disk cache.
+
+
+
+ It is physically manifested as a directory on disk and may contain any
+ number of related files or directories with the same lifetime.
+
+
+
+
+
+ Creates the group if it does not exist.
+
+ Thrown if an error occurs.
+
+
+
+ Deletes the group and all of its contents if any.
+
+ Thrown if an error occurs.
+
+
+
+ Gets information about a file within the group.
+
+
+
+ This method will succeed even if the file or the group does not exist.
+
+
+ The relative path of the file within the group.
+ The file info.
+ Thrown if is null.
+ Thrown if an error occurs.
+
+
+
+ Gets information about a directory within the group.
+
+
+
+ This method will succeed even if the directory or the group does not exist.
+
+
+ The relative path of the directory within the group.
+ The directory info.
+ Thrown if is null.
+ Thrown if an error occurs.
+
+
+
+ Opens a file within the group.
+
+
+
+ If a new file is being created, automatically create the group and the
+ containing directory for the file.
+
+
+ The relative path of the file to open within the group.
+ The file open mode.
+ The file access mode.
+ The file sharing mode.
+ The file stream.
+ Thrown if is null.
+ Thrown if an error occurs.
+
+
+
+ Creates a directory within the group.
+
+ The relative path of the directory to create within the group.
+ Directory information for the directory that was created.
+ Thrown if is null.
+ Thrown if an error occurs.
+
+
+
+ Gets the disk cache that contains the group.
+
+
+
+
+ Gets the key of the group.
+
+
+
+
+ Gets the that represents the physical
+ storage location of the disk cache group in the filesystem.
+
+
+
+
+ Returns true if the group exists on disk.
+
+ Thrown if an error occurs.
+
+
+
+ Represents a collection of groups in a disk cache indexed by an aritrary key string.
+
+
+
+
+ Gets the group with the specified key.
+
+ The key.
+ The group.
+ Thrown if is null.
+
+
+
+ The Gallio.Common.Caching namespace contains types related to caching.
+
+
+
+
+ A simple disk cache that stores its contents in a particular directory using hashes
+ of the key values to ensure uniqueness.
+
+
+
+
+ Creates a simple disk cache.
+
+ The path of the cache directory.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the group with the given key.
+
+ The key, nor null.
+ The cache group.
+
+
+
+ Gets the path of the cache directory.
+
+
+
+
+
+
+
+ Represents a disk cache group.
+
+
+
+
+ Creates a group.
+
+ The cache.
+ The cache group key.
+ The location of the cache group.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A disk cache that stores its contents in the user's temporary directory.
+
+
+
+
+
+ The default cache directory name.
+
+
+
+
+ Creates a temporary disk cache within the specified subdirectory of the user's temporary directory.
+
+ The name of the cache subdirectory.
+ Thrown if is null.
+
+
+
+ Creates a temporary disk cache within the
+ subdirectory of the user's temporary directory.
+
+
+
+
+ Compares arrays for equality by element.
+
+
+
+
+ Gets a default instance of the array equality comparer.
+
+
+
+
+ Creates a default array equality comparer.
+
+
+
+
+ Creates an array equality comparer using the specified element comparer.
+
+ The comparer to use to compare individual elements,
+ or null to use .
+
+
+
+
+
+
+
+
+
+ Utility functions for manipulating collections.
+
+
+
+
+ Converts all elements of the input collection and returns the collected results as an array
+ of the same size.
+
+ The input type.
+ The output type.
+ The input collection.
+ The conversion function to apply to each element.
+ The output array.
+
+
+
+ Copies all of the elements of the input collection to an array.
+
+ The element type.
+ The input collection.
+ The output array.
+
+
+
+ Returns the first element of the input enumeration for which the specified
+ predicate returns true.
+
+ The element type.
+ The input enumeration.
+ The predicate.
+ The first matching value or the default for the type if not found.
+
+
+
+ Returns an array of the specified length, filled with the specifed constant value.
+
+ The type of the array.
+ The constant value.
+ The length of the array.
+ The resulting array.
+
+
+
+ A covariant list converts a list of the input type to a
+ read-only list of the more generic output type. The wrapped
+ list can be used to mimic covariance in method return types.
+
+ The input list type.
+ The output list type.
+
+
+
+ Creates a wrapper for the specified list.
+
+ The input list.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets an item from the list with the specified index.
+
+ The index.
+ The item.
+ Thrown if is out of range.
+
+
+
+
+
+
+ Provides a singleton empty array instance.
+
+ The type of array to provide.
+
+
+
+ An empty array of type .
+
+
+
+
+ A read-only empty dictionary.
+
+ The dictionary key type.
+ The dictionary value type.
+
+
+
+ A read-only empty dictionary instance.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Utility functions for manipulating generic collections.
+
+
+
+
+ Converts each element of the input collection and stores the result in place.
+
+ The item type.
+ The list to mutate.
+ The conversion function to apply to each element.
+
+
+
+ Converts each element of the input collection and stores the result in the
+ output list using the same index. The output list must be at least as
+ large as the input list.
+
+ The input type.
+ The output type.
+ The input list.
+ The output list.
+ The conversion function to apply to each element.
+
+
+
+ Converts each element of the input collection and adds the result to the
+ output collection succession in the same order.
+
+ The input type.
+ The output type.
+ The input list.
+ The output list.
+ The conversion function to apply to each element.
+
+
+
+ Converts each element of the input collection and returns the collected results as an array
+ of the same size.
+
+ The input type.
+ The output type.
+ The input collection.
+ The conversion function to apply to each element.
+ The output array.
+
+
+
+ Copies all of the elements of the input enumerable to an array.
+
+ The element type.
+ The input enumerable.
+ The output array.
+
+
+
+ Copies all of the elements of the input collection to an array.
+
+ The element type.
+ The input collection.
+ The output array.
+
+
+
+ Returns the first element of the input enumeration for which the specified
+ predicate returns true.
+
+ The element type.
+ The input enumeration.
+ The predicate.
+ The first matching value or the default for the type if not found.
+
+
+
+ Returns true if the input enumeration contains an element for which the predicate returns true.
+
+ The element type.
+ The input enumeration.
+ The predicate.
+ True if a matching element exists.
+
+
+
+ Performs an action for each element in an enumeration.
+
+ The element type.
+ The input enumeration.
+ The action to perform.
+
+
+
+ Adds all elements of the input enumeration to the output collection.
+
+ The element type.
+ The input enumeration.
+ The output collection.
+
+
+
+ Adds elements of the input enumeration to the output collection,
+ if not already present.
+
+ The element type.
+ The input enumeration.
+ The output collection.
+
+
+
+ Returns true if the elements of both lists are equal.
+
+ The first collection.
+ The second collection.
+ True if the elements are equal.
+
+
+
+ Returns true if the elements of both lists are equal.
+
+ The first collection.
+ The second collection.
+ The comparison strategy to use.
+ True if the elements are equal.
+
+
+
+ Returns true if both dictionaries have equal key/value pairs.
+
+ The first collection.
+ The second collection.
+ True if the elements are equal.
+
+
+
+ Returns true if the elements of both lists are equal but possibly appear in a different order.
+ Handles elements that appear multiple times and ensures that they appear the same
+ number of times in each list.
+
+ The first collection.
+ The second collection.
+ True if the elements are equal.
+
+
+
+ Projects each element of a sequence into a new form.
+
+
+
+ The input sequence.
+
+ The output sequence
+ Thrown if any argument is null.
+
+
+
+ A hashtable-based set implementation.
+
+
+
+ This will probably be replaced by the new HashSet{T} class in
+ the new System.Core of .Net 3.5.
+
+
+
+
+
+ Creates an empty set.
+
+
+
+
+ Creates an empty set using the specified comparer.
+
+ The comparer, or null to use the default comparer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A multi-map allows a list of values to be associated with a single key.
+
+
+
+ The value collections provided by the multi-map are always read-only.
+ They can only be modified by calling the appropriate methods of the multi-map
+ to add or remove items. This behavior helps multi-map implementations
+ better maintain their invariants.
+
+
+
+
+
+ Adds a value to the list of those associated with a key.
+
+ The key.
+ The value to associate.
+
+
+
+ Adds all of the values from the specified map.
+
+ The map.
+ Thrown if is null.
+
+
+
+ Adds all of the values from the specified enumeration of key-value pairs.
+
+ The key-value pairs.
+ Thrown if is null.
+
+
+
+ Returns true if the map contains an entry with the specified key and value.
+
+ The key.
+ The value to find.
+ True if the map contains an entry with the specified key and value.
+
+
+
+ Removes a value from the list of those associated with a key.
+
+ The key.
+ The value to remove from the key.
+ True if the value was removed.
+
+
+
+ Gets the contents of the multi-map as an enumeration of pairs of keys and lists of values.
+
+
+
+
+ A strongly-typed key to be used together with an associative array to help the
+ compiler perform better type checking of the value associated with the key.
+
+ The type of value associated with the key.
+
+
+
+ Creates a new key.
+
+ The unique name of the key.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the unique name of the key.
+
+
+
+
+ Lazily populates and caches values associated with a particular key.
+
+
+
+ Instances of this type are safe for use by multiple concurrent threads.
+ In the case of a race occurs between two threads that result in the population of the
+ same key, the populator function may be called concurrently with two requests for the same
+ key. The winner of the race gets to store its value in the cache for later use.
+ However, the loser of the race will discard its value and use the newly cached instead.
+
+
+
+
+
+ Creates a cache with the specified populator function.
+
+ A function that provides a value given a key.
+ Thrown if is null.
+
+
+
+ Gets the value associated with the specified key.
+ Populates it on demand if not already cached.
+
+ The key.
+ The associated value.
+
+
+
+ A multi-map allows a list of values to be associated with a single key.
+
+
+
+
+ Creates an empty multi-map.
+
+
+
+
+ Adds a value to the list of those associated with a key.
+
+ The key.
+ The value to associate.
+
+
+
+ Adds all values in the pair to the specified key.
+
+ The key and values pair.
+
+
+
+ Adds all values in the pair to the specified key.
+
+ The key.
+ The values.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if the map contains an entry with the specified key and value.
+
+ The key.
+ The value to find.
+ True if the map contains an entry with the specified key and value.
+
+
+
+
+
+
+ Returns true if the map contains at least one value associated with
+ the specified key.
+
+ The key.
+ True if there is at least one value associated with the key.
+
+
+
+
+
+
+ Removes all values associated with the specified key.
+
+ The key.
+ True if the key existed and was removed.
+
+
+
+ Removes a value from the list of those associated with a key.
+
+ The key.
+ The value to remove from the key.
+ True if the value was removed.
+
+
+
+ Removes all values in the pair from the specified key.
+
+ The key and values pair.
+ True if at least one value was removed.
+
+
+
+
+
+
+
+
+
+ Obtains a read-only view of another multi-map.
+
+ The multi-map.
+ Thrown if is null.
+
+
+
+ Gets the number of distinct keys in the map.
+
+
+
+
+
+
+
+ Gets the collection of keys in the multi-map.
+
+
+
+
+ Gets the collection of lists of values in the multi-map.
+
+
+
+
+
+
+
+ Gets or sets the list of values associated with the specified key.
+ Returns an empty list if there are none.
+
+ The key.
+ The list of values.
+
+
+
+ The Gallio.Common.Collections namespace contains specialized collection types and
+ collection utilities.
+
+
+
+
+ A property bag associates keys with values where each key may have one or more associated value.
+ All keys and values must be non-null strings.
+
+
+
+ This collection supports Xml-serialization and content-based equality comparison.
+
+
+
+
+
+ Creates an empty property bag.
+
+
+
+
+ Creates a copy of this property bag.
+
+ The copy.
+
+
+
+ Gets a read-only view of this property set.
+
+ A read-only view.
+
+
+
+ Gets the first value associated with a key.
+
+
+
+ If there are multiple values, returns only the first one.
+
+
+ The key.
+ The first associated value, or null if none.
+
+
+
+ Sets the value associated with a key.
+
+
+
+ Removes all values previously associated with that key.
+
+
+ The key.
+ The new value, or null to remove the existing values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides the Xml schema for this element.
+
+ The schema set.
+ The schema type of the element.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A property set associates keys with values where each key may have exactly one associated value.
+ All keys and values must be non-null strings.
+
+
+
+ This collection supports Xml-serialization and content-based equality comparison.
+
+
+
+
+
+ Creates an empty property set.
+
+
+
+
+ Adds all elements of another collection to this dictionary.
+
+ The collection to add.
+ Thrown if is null.
+
+
+
+ Creates a full copy of this property set.
+
+ The copy.
+
+
+
+ Gets a read-only view of this property set.
+
+ A read-only view.
+
+
+
+ Gets the value associated with a key, or null if absent.
+
+ The key.
+ The associated value, or null if none.
+
+
+
+ Sets the value associated with a key, removes an existing value if null.
+
+ The key.
+ The new value, or null to remove the existing value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides the Xml schema for this element.
+
+ The schema set.
+ The schema type of the element.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A read-only dictionary wrapper.
+
+
+
+
+ Creates a read-only dictionary wrapper for another dictionary.
+
+ The dictionary to wrap.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides a read-only view of another multi-map.
+
+
+
+
+ Creates a read-only view of the specified multi-map.
+
+ The multi-map.
+ Thrown if is null.
+
+
+
+ An equality comparer that compares values by reference.
+
+ The type of values to compare, must be reference types.
+
+
+
+
+
+
+
+
+
+ Gets the singleton instance of the comparer.
+
+
+
+
+ Provides functions for manipulating ad-hoc trees.
+
+
+
+
+ Gets an enumeration of a tree data structure in pre-order traversal.
+
+ The type of node in the tree.
+ The root node of the tree.
+ A function that yields an enumeration of the children
+ of a node in the tree.
+ The pre-order traversal enumeration.
+
+
+
+ Enumerates child nodes in a tree.
+
+ The node.
+ The node's children.
+
+
+
+ A user data collection stores arbitrary key/value pairs that may be associated
+ with other objects in the system.
+
+
+
+ Accesses to the collection are synchronized during access. To safely manupulate
+ multiple keys at one time, simply lock the
+ for the duration of the operation.
+
+
+
+
+
+ Creates an empty collection.
+
+
+
+
+ Creates a copy of the collection.
+
+ The copy.
+
+
+
+ Tries to get a value from the collection.
+
+ The key.
+ Set to the value, or default(T) if none present.
+ True if a value was obtained.
+ The value type.
+
+
+
+ Gets a value from the collection.
+
+ The key.
+ The associated value.
+ Thrown if was not found.
+ The value type.
+
+
+
+ Gets a value from the collection or a default value if none found.
+
+ The key.
+ The default value.
+ The associated value, or the default value.
+ The value type.
+
+
+
+ Determines whether a key has an associated value in the collection.
+
+ The key.
+ True if the key has an associated value.
+ Thrown if is null.
+ The value type.
+
+
+
+ Sets a value in the collection.
+
+ The key.
+ The value to set.
+ The value type.
+
+
+
+ Removes a value from the collection.
+
+ The key.
+ The value type.
+
+
+
+ An event dispatched by the when its
+ is being configured to enable customization.
+
+
+
+
+ Creates event arguments.
+
+ The process start info being configured.
+ Thrown if is null.
+
+
+
+ Gets the process start info being configured.
+
+
+
+
+ A lock box object provides protected read / write access to a shared object
+ that may be accessed concurrently by multiple threads.
+
+
+
+ Clients are expected to use the and methods
+ to acquire and release a lock of the appropriate type prior to manipulating
+ the contents.
+
+
+ The type of object inside the lock box.
+
+
+
+ Creates a lock box for the specified object.
+
+ The object to protect.
+
+
+
+ Acquires a read lock and invokes the action with the object inside the lock box.
+
+ The action to invoke.
+ Thrown if is null.
+
+
+
+ Acquires a write lock and invokes the action with the object inside the lock box.
+
+ The action to invoke.
+ Thrown if is null.
+
+
+
+ Acquires a read lock and invokes the function with the object inside the lock box.
+
+ The action to invoke.
+ The value returned by the function.
+ The function result type.
+ Thrown if is null.
+
+
+
+ Acquires a write lock and invokes the function with the object inside the lock box.
+
+ The action to invoke.
+ The value returned by the function.
+ The function result type.
+ Thrown if is null.
+
+
+
+ The Gallio.Common.Concurrency namespace contains types for synchronizing access
+ to resources and managing threads and processes.
+
+
+
+
+ A process task provides support for launching external processes
+ and collecting their output.
+
+
+
+ The process task provides a guarnatee that when you call
+ all redirected output from the console output and error streams will already
+ have been captured and delivered to the event handlers, as appropriate.
+
+
+
+
+
+ A task represents a concurrently executing operation.
+
+
+
+ A might not necessarily represent an operation that is
+ executing in a local . It can represent other processes
+ that execute remotely or that are represented by some other mechanism.
+
+
+ A is guaranteed to send events in the following order:
+ , (if applicable), .
+ The events are dispatched synchronously such that the next event in the sequence
+ will not be fired until the previous event is completely processed.
+
+
+
+
+
+
+ This lock ensures that Start, Abort and NotifyTerminated are serialized.
+ Without it, we could end up sending a Terminated event before the client
+ received the Started event. Since events are dispatched synchronously,
+ serializing them in this manner helps clients to maintain correct internal state.
+
+
+
+
+ Creates a task.
+
+ The name of the task.
+ Thrown if is null.
+
+
+
+ Starts running the task.
+
+
+
+ Does nothing if the task has already been started or has been aborted.
+
+
+
+
+
+
+ Asynchronously aborts the task.
+
+
+
+ If the task has not been started, then the task will be forbidden from starting later
+ and its property will be set. If the task has already
+ terminated, then does nothing.
+
+
+ A typical implementation of this method may cause a
+ to be thrown non-deterministically within the task's thread. Normally such an exception should
+ cause the thread to abort abruptly but it may have no effect in certain conditions.
+ Also, aborting a task in this manner may cause the application to enter an invalid state
+ because exception handlers are often not designed to recover from
+ correctly.
+
+
+
+
+
+
+
+ Waits for the task to terminate.
+
+
+
+ Does nothing if the task has not been started or is not running.
+
+
+ The maximum amount of time to wait for completion, or null to wait indefinitely.
+ True if the task is not running as of the time this method exits,
+ false if a timeout occurred while waiting.
+ Thrown if
+ represents a negative time span.
+
+
+
+
+
+ Starts the task and waits for it to complete until the timeout expires.
+ If the timeout expires, aborts the task and returns false .
+
+ The maximum amount of time to wait for completion, or null to wait indefinitely.
+ Thrown if
+ represents a negative time span.
+ True if the task ran to completion within the specified time span,
+ false if the task was aborted.
+
+
+
+ Starts the task.
+
+
+
+
+
+ Aborts the task.
+
+
+
+
+
+ Waits for the task to terminate.
+
+ The timeout, or null to wait indefinitely.
+ True if the task is not running as of the time this method exits,
+ false if a timeout occurred while waiting.
+
+
+
+ Dispatches notification that the task has terminated and provides its result.
+
+ The task result.
+ Thrown if is null.
+ Thrown if the task is not currently running.
+
+
+
+ Notifies the event handlers.
+
+
+ This method may be overridden by a subclass to perform any necessary actions
+ just prior to calling the event handlers.
+
+
+
+
+ Notifies the event handlers.
+
+
+ This method may be overridden by a subclass to perform any necessary actions
+ just prior to calling the event handlers.
+
+
+
+
+ Notifies the event handlers.
+
+
+ This method may be overridden by a subclass to perform any necessary actions
+ just prior to calling the event handlers.
+
+
+
+
+ Gets the name of the task.
+
+
+
+
+ Returns true if the task has not been started or aborted yet.
+
+
+
+
+ Returns true if the task is running.
+
+
+
+
+ Returns true if the task ran and was terminated.
+
+
+
+
+ Returns true if the task has been aborted.
+
+
+
+
+ Gets the task result, or null if the task has not terminated or was aborted before starting.
+
+
+
+
+ Adds or removes an event handler that is signaled when the task is started.
+ If a handler is being added and the task has already started, it is immediately invoked.
+
+
+
+
+ Adds or removes an event handler that is signaled when the task is aborted.
+ If a handler is being added and the task has already aborted, it is immediately invoked.
+
+
+
+
+ Adds or removes an event handler that is signaled when the task is terminated.
+ If a handler is being added and the task has already terminated, it is immediately invoked.
+
+
+
+
+ Creates a process task.
+
+ The path of the executable executable.
+ The arguments for the executable.
+ The working directory.
+ Thrown if ,
+ or is null.
+
+
+
+ Sets an environment variable to be passed to the process when started.
+
+ The variable name.
+ The variable value, or null to remove the environment variable
+ so it will not be inherited by the child process.
+ Thrown if the process has already been started.
+ Thrown if is null.
+
+
+
+
+
+
+ Starts a .
+
+
+
+ This method may be override to change how the process is created and
+ started.
+
+
+ The that has been started.
+ The process.
+
+
+
+
+
+
+
+
+
+ Gets the executable path.
+
+
+
+
+ Gets the arguments.
+
+
+
+
+ Gets the working directory path.
+
+
+
+
+ Gets the that was started or null if the
+ process has not been started yet.
+
+
+ Please be aware that is not thread-safe.
+ You must lock the process object before accessing it.
+
+
+
+
+ Gets or sets whether console output stream of the process should be captured
+ and made available via the property.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Gets or sets whether console error stream of the process should be captured
+ and made available via the property.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Gets or sets whether to execute the command with the Windows shell.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Gets or sets whether to create a window for the command prompt.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Gets the captured contents of the console output stream written by the process.
+
+ Thrown if the process has not been started
+ or if is null .
+
+
+
+ Gets the captured contents of the console error stream written by the process.
+
+ Thrown if the process has not been started
+ or if is null .
+
+
+
+ Gets the exit code of the process, or -1 if the process did not run or has not exited.
+
+
+
+
+ Gets a description of the exit code, if available, or null otherwise.
+
+
+
+
+ The event fired to configure just before the process is started.
+
+
+
+
+ The event fired when each line of new output is received on the console output stream.
+
+
+
+ This event should be wired up before starting the task to ensure that
+ no data is lost.
+
+
+ Please note that the property
+ will be null when the redirected stream is closed after the process exits.
+
+
+
+
+
+ The event fired when each line of new output is received on the console error stream.
+
+
+
+ This event should be wired up before starting the task to ensure that
+ no data is lost.
+
+
+ Please note that the property
+ will be null when the redirected stream is closed after the process exits.
+
+
+
+
+
+ An action that reads the contents of a protected object. It should not modify the object in any way.
+
+ The object.
+ The type of object.
+
+
+
+
+ A function that reads the contents of a protected object and produces some result. It should not modify the object in any way.
+
+ The object.
+ The type of object.
+ The result type.
+
+
+
+
+ A manages the lifecycle of any number of s
+ and monitors their run-time behavior.
+
+
+
+ For example, when a terminates abruptly due to an exception, its container
+ will send out a notification that may cause all of the other tasks to be aborted and
+ for the currently executing test case to fail.
+
+
+
+
+
+ Creates an empty task container.
+
+
+
+
+ Adds a new task for this container to watch.
+
+ The task to monitor.
+ Thrown if is null.
+
+
+
+ Asynchronously aborts all of the tasks currently running within the container.
+
+
+
+
+
+ Waits for all of currently running tasks to terminate.
+
+ The maximum amount of time to wait for completion, or null to wait indefinitely.
+ True if no tasks are running as of the time this method exits,
+ false if a timeout occurred while waiting.
+ Thrown if
+ represents a negative time span.
+
+
+
+
+ Gets the list of all tasks that are currently running.
+
+ The list of running tasks.
+
+
+
+ Adds or removes an event handler that is signaled when any watched task is started.
+
+
+
+
+ Adds or removes an event handler that is signaled when any watched task is aborted.
+
+
+
+
+ Adds or removes an event handler that is signaled when any watched task is terminated.
+
+
+
+
+ A task-related event.
+
+
+
+
+ Creates event arguments for a task-related event.
+
+ The task that the event is about.
+ Thrown if is null.
+
+
+
+ Gets the task that the event is about.
+
+
+
+
+ A executes a block of code inside a special
+ scope that is designed to issue and safely handle
+ on demand.
+
+
+
+ This class may be used as a primitive for implementing higher-level protected
+ scopes for the purpose of asynchronous cancelation and time-limited execution.
+
+
+ The implementation distinguishes between s that
+ are initated using the method and those
+ that may be initiated by other system components. Foreign aborts are not handled
+ so they are allowed to continue to propagate. This is to ensure that critical aborts
+ such as those that are initiated by can unwind the stack
+ without interference.
+
+
+
+
+
+ Maximum number of times to poll for a pending abort before giving up.
+
+
+
+
+ Indicates that the thread scope is not currently running abortable code.
+ It could either not be entered, or it could be entered and running a
+ protected block.
+
+
+
+
+ Indicates that the thread scope is running abortable code.
+
+
+
+
+ Indicates that is about to occur.
+
+
+
+
+ Indicates that the scope has been aborted and a
+ has already been issued if needed.
+
+
+
+
+ Runs an action inside of the scope.
+
+
+
+ At most one action may be in progress at any time. This method is not
+ reentrant and cannot be called concurrently from multiple threads.
+
+
+ The action to run.
+ The that was caught if the action
+ was aborted, or null if the action completed normally.
+ Thrown if is null.
+ Thrown if an action is already running in this scope.
+ Any other exception thrown by itself.
+
+
+
+ Enters a protected context wherein it cannot receive a thread abort from this
+ .
+
+
+
+ This method enables critical system code to be protected from aborts that
+ may affect the scope. This call cannot be nested.
+
+
+ An object that when disposed ends the protected block, possibly null if there was no protection necessary.
+
+
+
+ Aborts the currently running action and prevents any further actions from running
+ inside of this scope.
+
+
+
+
+ Because a thread abort is delivered asynchronously, we need to synchronize with
+ it to ensure that it gets delivered. Otherwise the pending thread abort exception
+ could occur outside of our special region.
+
+
+
+
+ An implementation of based on a locally running thread.
+
+
+
+
+ Creates a task that will execute code within a new locally running thread.
+ When the task terminates successfully, its result will contain the value
+ returned by .
+
+ The name of the task.
+ The function to perform within the thread.
+ Thrown if
+ or is null.
+
+
+
+ Creates a task that will execute code within a new locally running thread.
+ When the task terminates successfully, its result will contain the value null .
+
+ The name of the task.
+ The action to perform within the thread.
+ Thrown if
+ or is null.
+
+
+
+ Performs an action within the thread before the task's main action runs.
+
+
+
+ The default implementation does nothing but may be overridden to introduce new behaviors.
+
+
+
+
+
+ Performs an action within the thread after the task's main action runs.
+
+
+
+ The default implementation does nothing but may be overridden to introduce new behaviors.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the desired to use for
+ the thread when it is started.
+
+
+ The default value is which
+ causes the new thread to use the runtime's default apartment state.
+
+ Thrown if this method is called
+ after the thread has started.
+
+
+
+ Gets the thread on which the task is running, or null if the
+ task is not running.
+
+
+
+
+ An action that reads or writes the contents of a protected object.
+
+ The object.
+ The type of object.
+
+
+
+
+ A function that reads or writes the contents of a protected object and produces some result.
+
+ The object.
+ The type of object.
+ The result type.
+
+
+
+
+ Describes an exception in a serializable form.
+
+
+
+
+ Interface implemented by objects that can write themselves to
+ a
+
+
+
+
+ Writes the object to a markup stream.
+
+ The markup stream.
+ Thrown if is null.
+
+
+
+ Provides a method that may be called by client code to obtain a normalized
+ copy of an object.
+
+ The object type.
+
+
+
+ Obtains a normalized copy of the object or the original instance if it is already normalized.
+
+
+
+ Some object may be considered valid but have content which is not in a suitable
+ form for further processing. For example, a message object may have a field that contains
+ excessive whitespace or non-printable characters that can be trimmed. To handle
+ these cases, the message consumer may call the method to
+ obtain a normalized copy of the message. However, if the message was already normalized
+ the method could just return the same instance.
+
+
+ This method may assume that the object has already been validated.
+
+
+ This method is not permitted to modify the original object or its contents. If the
+ contents must be changed during normalization then a copy should be created
+ and returned.
+
+
+ The original instance or a normalized copy.
+
+
+
+ Gets an empty read-only property set that can be used to indicate that
+ an exception data object does not contain any properties.
+
+
+
+
+ Creates an exception data object from an exception.
+
+
+
+ Captures the exception type, message, stack trace and properties from
+ the exception object. To filter out specific properties, mark them with
+ .
+
+
+ The exception.
+ Thrown if is null.
+
+
+
+ Creates an exception data object.
+
+ The exception type full name.
+ The exception message text.
+ The exception stack trace.
+ The exception properties, or
+ if none.
+ The inner exception data, or null if none.
+ Thrown if ,
+ ,
+ or is null.
+
+
+
+ Creates an exception data object.
+
+ The exception type full name.
+ The exception message text.
+ The exception stack trace.
+ The exception properties, or
+ if none.
+ The inner exception data, or null if none.
+ Thrown if ,
+ ,
+ or is null.
+
+
+
+
+
+
+ Formats the exception to a string similar to the one that the .Net framework
+ would ordinarily construct.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The formatted exception.
+
+
+
+ Formats the exception to a string similar to the one that the .Net framework
+ would ordinarily construct.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ If true, strictly follows the standard .Net
+ exception formatting by excluding the display of exception properties.
+ The formatted exception.
+
+
+
+ Writes the exception in a structured format with markers to distinguish its component elements.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The log stream writer.
+ Thrown if is null.
+
+
+
+ Writes the exception in a structured format with markers to distinguish its component elements.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The log stream writer.
+ If true, strictly follows the standard .Net
+ exception formatting by excluding the display of exception properties.
+ Thrown if is null.
+
+
+
+ Gets the exception type full name.
+
+
+
+
+ Gets the exception message text.
+
+
+
+
+ Gets the exception stack trace.
+
+
+
+
+ Gets the inner exception data, or null if none.
+
+
+
+
+ Gets the read-only set of formatted exception properties.
+
+
+
+
+ The Gallio.Common.Diagnostics namespace contains types for reporting
+ failure diagnostics including a stack trace filtering mechanism.
+
+
+
+
+ Describes a stack trace in a serializable form.
+
+
+
+
+ Creates a stack trace data object from a string.
+
+ The stack trace.
+ Thrown if is null.
+
+
+
+ Creates a stack trace data object that points to the specified code element.
+
+ The code element.
+ Thrown if is null.
+
+
+
+
+
+
+ Formats the stack trace to a string similar to the one that the .Net framework
+ would ordinarily construct.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The formatted stack trace.
+
+
+
+ Writes the stack trace in a structured format with markers to distinguish its component elements.
+
+
+
+ The stack trace will not be terminated by a new line.
+
+
+ The log stream writer.
+ Thrown if is null.
+
+
+
+ Returns true if the stack trace data is empty.
+
+
+
+
+ Provides methods for filtering the stack trace for tests.
+
+
+
+ The objective of this filtering is to omit frames that are not relevant to the user
+ when reporting stack traces.
+
+
+ Stack trace filtering proceeds as follows:
+
+ - Stack frames that have an associated
+ or are omitted.
+ - The stack trace is chopped just above the top-most stack frame with
+ an associated
.
+
+
+
+
+
+
+ Filters a stack trace.
+
+ The stack trace.
+ The filtered stack trace.
+ Thrown if
+ is null.
+
+
+
+ Filters a stack trace.
+
+ The stack trace.
+ The filtered stack trace string.
+ Thrown if
+ is null.
+
+
+
+ Filters the stack trace information in an exception.
+
+ The exception.
+ The filtered exception data.
+ Thrown if
+ is null.
+
+
+
+ Filters the stack trace information about an exception.
+
+ The exception data.
+ The filtered exception data.
+ Thrown if
+ is null.
+
+
+
+ Captures a filtered stack trace from the currently executing thread.
+
+ The filtered stack trace.
+
+
+
+ This attribute is used to mark methods and types that are internal to the implementation
+ of the system.
+
+
+
+ The class uses this attribute to identify stack
+ frames that may safely be filtered out when describing failures to users. If the
+ stack frame refers to a method with this attribute or declared by a type
+ with this attribute then it is omitted. The attribute also applies to nested types
+ to help cover anonymous delegates as well.
+
+
+ Other attributes may also contribute to stack trace filtering. Refer to
+ for details.
+
+
+ The class uses this attribute to identify exception
+ properties that should not be captured automatically.
+
+
+
+
+
+ This attribute is used to mark methods that call into user code.
+
+
+
+ The uses this attribute to determine at what
+ point control flow initially transitioned from the test framework into the test.
+ It can then filter out irrelevant frames that lie above the entry point.
+
+
+ If two entry points are nested within one another in the call stack, then the
+ effect is the same as if the outermost entry point did not appear. This enables
+ test frameworks to support recursion into themselves.
+
+
+ Other attributes may also contribute to stack trace filtering. Refer to
+ for details.
+
+
+
+
+
+ Represents a method that determines whether two objects of the same type are equal.
+
+ The first object to compare.
+ The second object to compare.
+ True if the object are equal; otherwise false.
+
+
+
+ Represents a strongly-typed method that determines whether two objects of the same type are equal.
+
+
+
+ This delegate is for , what is
+ for .
+
+
+ The type of the objects to compare.
+ The first object to compare.
+ The second object to compare.
+ True if the object are equal; otherwise false.
+
+
+
+ The Gallio.Common.IO namespace contains utilities and a test-friendly facade for
+ common input/output operations.
+
+
+
+
+ The Gallio.Common.Markup namespace provides a structured text format
+ consisting of documents which may have multiple streams of text each of
+ which may be subdivided into sections of text with optional style markers.
+
+
+
+
+ The Gallio.Common.Markup.Tags namespace defines the tags used by the
+ markup document format to encode structured documents in Xml.
+
+
+
+
+ A video frame that consists of a bitmap.
+
+
+
+
+ Represents a single frame of video content.
+
+
+
+
+ Copies pixels from the frame into a buffer.
+
+ The source rectangle of pixels to copy.
+ The buffer into which to copy the pixels as 32bit RGB with the upper 8 bits zeroed out.
+ The start offset where the first pixel should be written.
+ The incremental offset between subsequent rows of pixels.
+ Thrown if is null.
+ Thrown if the components,
+ or are negative or if they would cause pixels
+ to be written outside the bounds of the pixel buffer.
+ Thrown if the components
+ are negative, is outside the bounds of the pixel buffer, or
+ is less than the width of the rectange.
+ Thrown if the combined dimensions,
+ and would cause pixels to be written out
+ of bounds of the pixel buffer.
+
+
+
+ Copies pixels from the frame into a buffer.
+
+
+
+ The arguments have already been checked to ensure that all pixels in the requested
+ range will fit in the pixel buffer. The implementation can assume that it will be safe to
+ write all requested pixels into the buffer (so it may use unmanaged code to do so
+ if desired).
+
+
+ The source rectangle of pixels to copy.
+ The buffer into which to copy the pixels as 32bit RGB with the upper 8 bits zeroed out.
+ The start offset where the first pixel should be written.
+ The incremental offset between subsequent rows of pixels.
+
+
+
+ Gets the width of the video frame.
+
+
+
+
+ Gets the height of the video frame.
+
+
+
+
+ Creates a bitmap video frame.
+
+ The bitmap.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the bitmap.
+
+
+
+
+
+
+
+
+
+
+ Specifies the vertical alignment of a caption.
+
+
+
+
+ Specifies top alignment.
+
+
+
+
+ Specifies middle alignment.
+
+
+
+
+ Specifies bottom alignment.
+
+
+
+
+ Specifies the horizontal alignment of a caption.
+
+
+
+
+ Specifies left alignment.
+
+
+
+
+ Specifies horizontal alignment.
+
+
+
+
+ Specifies right alignment.
+
+
+
+
+ Displays a caption overlayed on top of an image.
+
+
+
+
+ Abstract base class for video overlays.
+
+
+
+
+ Paints the overlay.
+
+ The paint request.
+ Thrown if is null.
+
+
+
+ Paints the overlay.
+
+ The paint request, not null.
+
+
+
+ Creates a caption overlay.
+
+
+
+
+
+
+
+ Gets or sets the text of the caption.
+
+ The text of the caption or an empty string if none.
+ Thrown if is null.
+
+
+
+ Gets or sets the font size.
+
+ The font size. Default is 16.
+ Thrown if is less than 1.
+
+
+
+ Gets or sets the horizontal alignment.
+
+ The horizontal alignment. Default is .
+
+
+
+ Gets or sets the vertical alignment.
+
+ The vertical alignment. Default is .
+
+
+
+ Specifies parameters for screenshot captures.
+
+
+
+
+ Creates a capture parameters object.
+
+
+
+
+ Gets or sets the zoom factor.
+
+
+
+ The zoom factor specifies the degree of magnification or reduction desired.
+ For example, a zoom factor of 1.0 (the default) is normal size, 0.25 reduces to one quarter the
+ original size and 2.0 magnifies to twice the original size.
+
+
+ Thrown if is less than 1/16 or more than 16.
+
+
+
+ The Gallio.Common.Media namespace provides types for capturing
+ screenshots and encoding video content.
+
+
+
+
+ Manages video source overlays.
+
+
+
+
+ Creates an overlay manager with no overlays.
+
+
+
+
+ Adds an overlay.
+
+ The overlay to add.
+ Thrown if is null.
+
+
+
+ Removes an overlay.
+
+ The overlay to remove.
+ Thrown if is null.
+
+
+
+ Asks all overlays to paint themselves.
+
+ The paint request.
+ Thrown if is null.
+
+
+
+ Asks all overlays to paint themselves over the specified image.
+
+ The image to paint on.
+ The frame number as in .
+ The number of frames per second as in .
+ Thrown if is null.
+
+
+
+ Returns a wrapper for the overlay manager as a composite overlay.
+
+ The composite overlay.
+
+
+
+ Gets the read-only list of registered overlays.
+
+
+
+
+ Describes a request to paint overlays.
+
+
+
+
+ Creates an overlay paint request.
+
+ The graphics object to use for painting the overlay.
+ The bounds of the frame that is being rendered into the graphics context.
+ The zero-based monotonically increasing number of the frame that is being rendered.
+ The frame rate expressed as the number of frames per second, or zero if the frame is static.
+ Thrown if is null.
+
+
+
+ Gets the graphics object to use for painting the overlay.
+
+
+
+
+ Gets the bounds of the frame that is being rendered into the graphics context.
+
+
+
+
+ Gets the zero-based monotonically increasing number of the frame that is being rendered.
+
+
+
+
+ Gets the frame rate expressed as the number of frames per second, or zero if the frame is static.
+
+
+
+
+ An exception that is thrown when screenshots cannot be captured.
+
+
+
+ This exception may indicate that the application is running as a service which has
+ not been granted the right to interact with the desktop.
+
+
+
+
+
+ An exception that expresses a problem performing a media operation.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Records screenshots as a video.
+
+
+
+
+ Creates a screen recorder.
+
+ The screen grabber.
+ The video to which frames are to be added.
+ Thrown if or
+ is null.
+ Thrown if size
+ is not exactly equal to the screenshot size.
+
+
+
+ Disposes the screen recorder.
+
+
+
+
+ Starts or resumes recording.
+
+ Thrown if the object has been disposed.
+
+
+
+ Stops recorded.
+
+ Thrown if the object has been disposed.
+
+
+
+ Paints overlays onto a bitmap.
+
+ The bitmap, not null.
+
+
+
+ Adds a captured screenshot to the video.
+
+ The bitmap, not null.
+
+
+
+ Disposes the screen recorder.
+
+ True if was called directly.
+
+
+
+ Throws if the object has been disposed.
+
+
+
+
+ Gets the overlay manager.
+
+
+
+
+ Gets the current frame number.
+
+
+
+
+ Gets the number of frames per second.
+
+
+
+
+ Gets the screen grabber in use.
+
+ Thrown if the object has been disposed.
+
+
+
+ Gets the video being recorded.
+
+ Thrown if the object has been disposed.
+
+
+
+ Specifies the parameters for a video.
+
+
+
+
+
+ Creates a video parameters object.
+
+ The width of the video.
+ The height of the video.
+ The number of frames per second of the video.
+ Thrown if or ,
+ or are zero or negative.
+
+
+
+ Gets the width of the video.
+
+
+
+
+ Gets the height of the video.
+
+
+
+
+ Gets the number of frames per second of the video.
+
+
+
+
+ Specifies the parameters for a Flash screen video.
+
+
+
+
+
+ Creates a Flash video parameters object.
+
+ The video width.
+ The video height.
+ The number of frames per second.
+ Thrown if or
+ are not between 1 and 4095 or if is not greater than zero.
+
+
+
+ Gets or sets the width of each block to be compressed.
+
+
+
+ The block height must be a multiple of 16 between 16 and 256. The default is 64.
+
+
+ Thrown if is invalid.
+
+
+
+ Gets or sets the height of each block to be compressed.
+
+
+
+ The block height must be a multiple of 16 between 16 and 256. The default is 64.
+
+
+ Thrown if is invalid.
+
+
+
+ Gets or sets the ZLib compression level.
+
+
+
+ Range: 0 (fast / uncompressed), 1 (fast / worst compression), 6 (default), 9 (slow / best compression).
+
+
+ Thrown if is invalid.
+
+
+
+ Gets the interval between successive key frames.
+
+
+
+ The default is 2 seconds. If you use a value of 0, then every frame will be a key frame.
+
+
+ Thrown if is negative.
+
+
+
+ Writes FLV streams.
+
+
+
+
+ Encodes video frames as FLV files using the Flash ScreenVideo lossless video codec.
+
+
+
+ This video format is useful for embedding video screen captures within web based test reports.
+ Frames are encoded as blocks of 16x16 pixel tiles compressed using ZLib. Unchanged tiles are retained
+ from the previous frame.
+
+
+ The maximum frame size for this video format is 4095x4095.
+
+
+
+
+
+ A video is an abstraction of an encoded video stream (possibly incorporating audio).
+
+
+
+ The primary use of this class is to author videos that can be embedded in test
+ reports. It is not intended to be used for playback.
+
+
+ Subclasses define specific encoding formats.
+
+
+ While a video is being created, its contents may be buffered in memory or on disk
+ in a temporary location.
+
+
+
+
+
+ Creates a new video.
+
+ The video parameters.
+ Thrown if is null.
+
+
+
+ Adds a frame to the video.
+
+
+
+ The implementation makes a copy of the frame or encodes it immediately so that
+ the caller can reuse the same frame buffers for subsequent frames.
+
+
+ The video frame to add.
+ Thrown if is null.
+ Thrown if the dimensions are not
+ exactly equal to those of the video.
+
+
+
+ Saves the video to a stream.
+
+ The stream.
+ Thrown if is null.
+
+
+
+ Adds a frame to the video.
+
+
+
+ The implementation makes a copy of the frame or encodes it immediately so that
+ the caller can reuse the same frame buffers for subsequent frames.
+
+
+ The frame dimensions have already been checked by the caller.
+
+
+ The video frame to add, not null.
+
+
+
+ Saves the video to a stream.
+
+ The stream, not null.
+
+
+
+ Gets the mime-type of the video format.
+
+
+
+
+
+ Gets the video parameters.
+
+
+
+
+ Gets the number of frames currently in the video.
+
+
+
+
+ Creates a new Flash screen video.
+
+ The video parameters.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the video parameters.
+
+
+
+
+
+
+
+ Grabs screenshots.
+
+
+
+
+ Creates a screen grabber.
+
+ The capture parameters.
+ Thrown if is null.
+
+
+
+ Gets the size of the screen.
+
+ The screen size.
+
+
+
+ Returns true if screenshots can be captured.
+
+
+
+ This method may return false if the application is running as a service which has
+ not been granted the right to interact with the desktop.
+
+
+ True if the screen can be captured.
+
+
+
+ Throws an exception if a screenshot cannot be captured at this time.
+
+ Thrown if a screenshot cannot be captured at this time.
+
+
+
+ Disposes the screen grabber.
+
+
+
+
+ Captures a screenshot.
+
+
+
+ Captures a screenshot and returns the bitmap. The caller is responsible for disposing
+ the bitmap when no longer needed.
+
+
+ If not null writes the screenshot into the specified bitmap,
+ otherwise creates and returns a new bitmap.
+ The screenshot.
+ Thrown if the provided is
+ not of the expected size.
+ Thrown if the object has been disposed.
+ Thrown if a screenshot cannot be captured at this time.
+
+
+
+ Paints overlays onto a bitmap.
+
+ The bitmap, not null.
+
+
+
+ Disposes the screen grabber.
+
+ True if was called directly.
+
+
+
+ Throws if the object has been disposed.
+
+
+
+
+ Gets the overlay manager.
+
+
+
+
+ Gets the capture parameters.
+
+ Thrown if the object has been disposed.
+
+
+
+ Gets the width of the screenshots that will be taken.
+
+ Thrown if the object has been disposed.
+
+
+
+ Gets the width of the screenshots that will be taken.
+
+ Thrown if the object has been disposed.
+
+
+
+ A message exchange mediates interactions between a server and a client.
+
+
+
+ This is interim API to be used until the new message broker is ready.
+
+
+
+
+
+ Base class for long-lived marshal by ref objects.
+
+
+
+ A represents a remote
+ object whose lifetime is managed explicitly. It ensures that long-lived
+ services are not inadvertently disconnected by the remoting infrastructure
+ and remain accessible until the application discards them.
+
+
+ However, it is important to keep a reference to the marshalled object
+ to ensure it does not get garbage collected prematurely. A marshalled
+ object can also be explicitly disconnected via .
+
+
+ This class overrides
+ to return null which disables the automatic lease-management
+ performed by the default lifetime service.
+
+
+
+
+
+
+
+
+ Creates a message exchange.
+
+ The message sink to which messages sent by the client should
+ be directed.
+ Thrown if is null.
+
+
+
+ Gets an interface that a client can use to asynchronously receive and
+ synchronously send messages.
+
+ The client link.
+
+
+
+ Sends a message to the client.
+
+ The message to send.
+ Thrown if is null.
+ Thrown if is not valid.
+
+
+
+ Waits for all published messages to be received by the client.
+
+ The timeout.
+ True if all messages were received, false if a timeout occurred.
+
+
+
+ Specifies a topic key routing published messages to their subscribers.
+
+
+
+ A topic consists of a sequence of dot ('.') delimited case-sensitive words. Each word
+ may contain the characters '0'-'9', 'a'-'z' and 'A'-'Z'. eg. "testrun.1234.progress".
+ Matching is performed using a .
+
+
+
+
+
+ Creates a topic with a given key.
+
+ The topic key.
+ Thrown if is null.
+ Thrown if is not a valid topic.
+
+
+
+ Returns the topic key.
+
+ The topic key.
+
+
+
+ Gets the complete topic key.
+
+
+
+
+ A topic pattern expresses a simple matching rule for topics.
+
+
+
+ Topic pattern matching proceeds word-wise where words within the topic are
+ separated by periods ('.'). There are two wildcards: '*' matches a single word and '#'
+ matches zero or more consecutive words. The topic must be matched in
+ full by the topic pattern; partial matches are of no significance.
+
+
+
+
+
+ Creates a topic pattern.
+
+ The topic pattern string.
+ Thrown if is null.
+
+
+
+ Returns true if this pattern matches the specified topic.
+
+ The topic to consider.
+ True if this pattern matches the specified topic.
+ Thrown if is null.
+
+
+
+ Returns the topic pattern string.
+
+ The topic pattern string.
+
+
+
+ Gets the topic pattern string.
+
+
+
+
+ The Gallio.Common namespace contains common data types and utilities.
+
+
+
+
+ The Gallio.Common.Normalization namespace provides a simple abstraction
+ for normalizing objects.
+
+
+
+
+ The Gallio.Common.Platform namespace provides utilities for detecting
+ native platform parameters such as the .Net runtime and framework version
+ and the bitness of the currently executing process.
+
+
+
+
+ Specifies the integrity level of a Windows process.
+
+
+
+
+ Unknown integrity level.
+
+
+
+
+ Process is running with Untrusted integrity.
+
+
+
+
+ Process is running with Low integrity.
+
+
+
+
+ Process is running with Medium integrity.
+
+
+
+
+ Process is running with High integrity.
+
+
+
+
+ Process is running with System integrity.
+
+
+
+
+ Process is running with Protected Process integrity.
+
+
+
+
+ Provides additional utilities for manipulating the Windows registry, particularly
+ to take care of differences on 32bit and 64bit platforms.
+
+
+
+
+ Opens a registry subkey taking into account the bitness of the platform
+ and the requested processor architecture affinity.
+
+
+ If requests a 32bit architecture, then only
+ the 32bit registry is searched. Likewise if it requests a 64bit architecture,
+ then only the 64bit registry is searched. Otherwise searches the 64bit
+ registry first then falls back on the 32bit registry.
+
+ The processor architecture affinity.
+ The registry hive.
+ The key name.
+ The action to perform on the sub key. Should return true on success.
+ True if the action succeeded.
+
+
+
+
+ Gets a registry value taking into account the bitness of the platform
+ and the requested processor architecture affinity.
+
+
+ If requests a 32bit architecture, then only
+ the 32bit registry is searched. Likewise if it requests a 64bit architecture,
+ then only the 64bit registry is searched. Otherwise searches the 64bit
+ registry first then falls back on the 32bit registry.
+
+ The processor architecture affinity.
+ The registry hive.
+ The key name.
+ The value name, or null to read the key's value.
+ The default value to return.
+ The value, or null if the key does not exist.
+
+
+
+
+ The Gallio.Common.Policy namespace defines common procedures for reporting unhandled
+ exceptions, processing events safely, and accessing user and machine local application data.
+
+
+
+
+ Describes a policy for obtaining paths of special resources such as
+ temporary directories and user profile settings files.
+
+
+
+ The policy is broken down into partitions based on their common purpose. The idea
+ is that Gallio will try to keep related resources together within a directory
+ named after the partition. As an additional safeguard, all paths returned by this
+ policy will be grouped within a folder called "Gallio".
+
+
+
+
+
+ Gets the special path policy for a partition whose name is derived from the type's full name.
+
+ The type used to define the name of the partition.
+ The special path policy.
+
+
+
+ Gets the special path policy for a specified partition.
+
+ The partition name.
+ The special path policy.
+ Thrown if is null.
+
+
+
+ Gets the temporary directory.
+
+ The temporary directory.
+
+
+
+ Creates a temporary directory with a unique name.
+
+ The temporary directory.
+
+
+
+ Creates a zero-byte temporary file with a unique name.
+
+ The temporary file.
+
+
+
+ Gets the application data directory for the roaming user.
+
+ The roaming user application data directory.
+
+
+
+ Gets the application data directory for the local non-roaming user.
+
+ The local non-roaming user application data directory.
+
+
+
+ Gets the application data directory shared by all users.
+
+ The common application data directory.
+
+
+
+ Gets the name of the partition this policy describes.
+
+
+
+
+ An attachment is an embedded object in a markup document. An attachment must specify a
+ content type (a MIME type), and some contents.
+
+
+
+
+ Creates an attachment.
+
+ The name of attachment, or null to automatically assign one. The attachment
+ name must be unique within the scope of the currently executing test step.
+ The content type, not null.
+ Thrown if is null.
+
+
+
+ Creates a plain text attachment.
+
+ The attachment name, or null to automatically assign one.
+ The text string, not null.
+ The attachment.
+ Thrown if is null.
+
+
+
+ Creates an HTML attachment.
+
+ The attachment name, or null to automatically assign one.
+ The html string, not null.
+ The attachment.
+ Thrown if is null.
+
+
+
+ Creates an XHTML attachment.
+
+ The attachment name, or null to automatically assign one.
+ The xhtml string, not null.
+ The attachment.
+ Thrown if is null.
+
+
+
+ Creates an XML attachment.
+
+ The attachment name, or null to automatically assign one.
+ The XML string, not null.
+ The attachment.
+ Thrown if is null.
+
+
+
+ Creates an image attachment with a mime-type compatible with its internal representation.
+
+ The attachment name, or null to automatically assign one.
+ The image to attach.
+ Thrown if is null.
+
+
+
+ Creates an video attachment with a mime-type compatible with its internal representation.
+
+ The attachment name, or null to automatically assign one.
+ The video to attach.
+ Thrown if is null.
+
+
+
+ Creates XML attachment with mime-type by serializing an object.
+
+ The attachment name, or null to automatically assign one.
+ The object to serialize and embed, must not be null.
+ The xml serializer to use, or null to use the default based on the object's type.
+ Thrown if is null.
+
+
+
+
+ Generates serializable attachment data from an attachment.
+
+ The attachment data.
+
+
+
+ Recovers the attachment information from serializable attachment data.
+
+ The attachment data.
+ The attachment.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the name of the attachment, not null.
+
+
+
+
+ Gets the content type of the attachment specified as a MIME type, not null.
+ for definitions of common supported MIME types.
+
+
+
+
+ Specifies how attachments are stored in Xml and as files.
+
+
+
+
+ The attachment content is not present.
+
+
+
+
+ The attachment content is saved to a linked file indicated by .
+
+
+
+
+ The attachment content is included inline as
+ with a given .
+
+
+
+
+
+ An Xml-serializable structure that describes the contents, encoding and disposition of an attachment.
+
+
+ The contents of the attachment are embedded in the execution log according to
+ their encoding. Text is directly embedded into the Xml whereas
+ binary attachments are base 64 encoded.
+
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Gets the text contents of a text attachment.
+
+ The text, or null if not available.
+ Thrown if the attachment is not textual.
+
+
+
+ Gets the binary contents of a binary attachment.
+
+ The bytes, or null if not available.
+ Thrown if the attachment is not binary.
+
+
+
+ Loads the attachment contents from a stream.
+
+ The stream.
+ Thrown if is null.
+ If the attachment could not be loaded.
+
+
+
+ Saves the attachment contents to a stream.
+
+ The stream.
+ The preferred encoding to use if writing text, or null if none.
+ Thrown if is null.
+ If the attachment could not be saved.
+ Thrown if the attachment contents are not available.
+
+
+
+ Gets or sets the name of the attachment, not null.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the content type of the attachment as a MIME type, not null.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the type of the attachment.
+ This value specifies how the attachment is represented in Xml.
+
+
+
+
+ Gets or sets the path of the attachment contents relative to
+ the directory that contains the Xml serialized report,
+ or null if the content is embedded.
+
+
+
+
+ Gets or sets the content disposition of the attachment which
+ indicates how the attachment has been stored.
+
+ The content disposition, initially
+
+
+
+ Gets or sets the attachment content serialized as text (including Base64 attachments), possibly null if none.
+
+
+
+
+ Returns true if the attachment is textual, false if it is binary.
+
+
+
+
+ Represents a binary-encoded attachment.
+
+
+
+
+ Creates an attachment.
+
+ The attachment name, not null.
+ The content type, not null.
+ The binary data, not null.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the binary content of the attachment, not null.
+
+
+
+
+ A markup document writer that falls back to a different writer for certain
+ operations when its primary markup document writer is closed.
+
+
+
+ Not all operations are delegated to the fallback writer. Some, such as
+ embedding attachments and entering or exiting nested scopes, are excluded
+ due to potential errors that may occur because the fallback writer may not
+ have seen the previous operation to add the attachment or enter the scope.
+
+
+
+
+
+ A markup document writer records structured text as a hierarchically structured
+ document.
+
+
+
+ Markup documents are especially used to record the output of a test run including
+ text that was written to console output streams, exceptions that occurred, and
+ anything else the test writer might want to save.
+
+
+ A markup document consists of zero or more markup streams that are opened automatically
+ on demand to capture independent sequences of log output. Each stream can
+ further be broken down into possibly nested sections to classify output
+ during different phases of test execution (useful for drilling into complex tests).
+ In addition to text, a markup document can contain attachments that are either attached
+ at the top level of the markup document or embedded into markup streams. Attachments are
+ typed by mime-type and can contain Text, Xml, Images, Blobs, or any other content.
+ Certain test frameworks may automatically create attachments to gather all manner
+ of diagnostic information over the course of the test.
+
+
+ All operations on this interface are thread-safe.
+
+
+ Subclasses may assume that the following validation steps have been performed before
+ the implementation methods are called:
+
+ - Checking arguments for null and invalid values
+ - Ensuring that the writer has not been closed
+ - Ensuring that no attachment with the same name exists when adding an attachment
+ - Ensuring that there is an attachment with the specified name exists when embedding an attachment
+ - Ensuring that the nesting level of sections and markers is correct and balanced when End is called
+
+
+
+ The object extends so instances may be
+ accessed by remote clients if required.
+
+
+
+
+
+
+ Closes the markup document writer.
+
+
+
+
+ Flushes the markup writer.
+
+
+
+
+ Attaches an attachment to the document.
+
+
+
+ An attachment instance can be embedded multiple times efficiently since each
+ embedded copy is typically represented as a link to the same common attachment instance.
+
+
+ The attachment to include.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an HTML attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The HTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an image attachment with a mime-type compatible with its internal representation.
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The image to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches a video attachment with a mime-type compatible with its internal representation.
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The video to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XML-serialized object as an XML attachment with mime-type
+ using the default for the object's type.
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The object to serialize and embed, must not be null.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XML-serialized object as an XML attachment with mime-type
+ using the specified .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The object to serialize and embed, must not be null.
+ The to use, or null to use the default
+ for the object's type.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an plain text attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The text to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XHTML attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The XHTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XML attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The XML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Gets a writer for the stream with the specified name.
+
+ The stream name, never null.
+ The markup stream writer.
+
+
+
+ Closes the markup document writer.
+
+
+
+ The implementation may prevent the document writer from being closed by throwing an
+ exception. When this happens, the log's property
+ will remain false.
+
+
+
+
+
+ Flushes the markup document writer.
+
+
+ The implementation should flush all of the individual document streams.
+
+
+
+
+ Adds an attachment to the markup document.
+
+
+
+ The implementation should allow the same attachment instance to be attached
+ multiple times and optimize this case by representing embedded attachments
+ as links.
+
+
+ The attachment to write, never null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Writes a text string to a markup stream.
+
+
+
+ The implementation can assume that newlines are normalized to LFs ('\n') only
+ and that CRs ('\r') have been stripped.
+
+
+ The markup stream name.
+ The text to write, never null.
+
+
+
+ Embeds an attachment into a markup stream.
+
+
+
+ The implementation should allow the same attachment instance to be attached
+ multiple times and optimize this case by representing embedded attachments
+ as links.
+
+
+ The markup stream name.
+ The name of the attachment to write, never null.
+ Thrown if no attachment with the specified
+ name has been previously attached.
+
+
+
+ Begins a section in a markup stream.
+
+ The markup stream name.
+ The name of the section to begin, never null.
+
+
+
+ Begins a marked region in a markup stream.
+
+ The markup stream name.
+ The marker.
+
+
+
+ Ends the current region started with one of the Begin* methods in a markup stream.
+
+ The markup stream name.
+ Thrown if there is no current nested region.
+
+
+
+ Flushes a markup stream.
+
+ The markup stream name.
+
+
+
+ Gets the stream writer for captured messages.
+
+
+
+
+ Gets the stream writer for captured messages.
+
+
+
+
+ Gets the stream writer for captured messages.
+
+
+
+
+ Gets the stream writer for diagnostic and messages.
+
+
+
+
+ Gets the stream writer for generic log messages.
+
+
+
+
+ Gets the stream writer for reporting failure messages and exceptions.
+
+
+
+
+ Gets the stream writer for reporting warning messages.
+
+
+
+
+ Returns true if the markup document writer is closed.
+
+
+
+
+ Gets the markup stream with the specified name. If the stream
+ does not exist, it is created on demand.
+
+
+
+ This property may return different instances of
+ each time it is called but they always represent the same stream just the same.
+
+
+ The name of the markup stream.
+ The log stream.
+ Thrown if is null.
+
+
+
+ Creates a fallback markup document writer with the specified provider.
+
+ The markup document writer to call by default.
+ The markup document to call as a fallback.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A marker is a hidden tag that labels markup contents with a semantic class.
+
+
+
+ A marker is roughly equivalent in operation to an HTML "div" tag whose "class"
+ attribute is used to annotate the contained block of tags and text. In HTML
+ CSS selectors are used to apply presentation artifacts to the block; likewise
+ tools may vary the presentation of markup based on associated marker classes.
+
+
+ This class provides several standard marker classes but you may also define your own
+ at will just by creating a marker instance with a custom class name.
+
+
+
+
+
+ Standard marker class for assertion failures.
+
+
+
+
+ Standard marker class for labels and headings.
+
+
+
+
+ Standard marker class for exceptions including their details.
+
+
+
+
+ Standard marker class for exception types reported as part of exception details.
+
+
+
+
+ Standard marker class for exception messages reported as part of exception details.
+
+
+
+
+ Standard marker class for exception property names reported as part of exception details.
+
+
+
+
+ Standard marker class for exception property values reported as part of exception details.
+
+
+
+
+ Standard marker class for stack traces.
+
+
+
+
+ Standard marker class for fixed width output such as that from a console or structured table.
+
+
+
+
+ Standard marker class for content that should be displayed with a highlight.
+
+
+
+
+ Standard marker class for content that represents added content in a diff.
+
+
+
+
+ Standard marker class for content that represents deleted content in a diff.
+
+
+
+
+ Standard marker class for content that represents changed content in a diff.
+
+
+
+
+ Standard marker class for content that has been elided and may be made available
+ instead as an attribute.
+
+
+
+
+ Standard marker class for code location references.
+
+
+
+
+ Path attribute for code location references.
+
+
+
+
+ Line attribute for code location references.
+
+
+
+
+ Column attribute for code location references.
+
+
+
+
+ Standard marker class for link to a url.
+
+
+
+
+ Url attribute for links.
+
+
+
+
+ Creates a standard marker for a code location.
+
+
+
+
+ Creates a standard marker for a link to a Url.
+
+
+
+
+ Creates a marker.
+
+ The marker class.
+ Thrown if is null.
+ Thrown if the is not a valid identifier. .
+
+
+
+ Creates a marker with attributes.
+
+ The marker class.
+ The attributes.
+ Thrown if or
+ is null.
+ Thrown if the is not a valid identifier. .
+
+
+
+ Creates a copy of the marker with the specified attribute added.
+
+ The attribute name.
+ The attribute value.
+ The marker copy with the attribute.
+ Thrown if
+ or is null.
+ Thrown if the is not a valid identifier. .
+
+
+
+ Verifies that the parameter is a valid marker class or attribute identifier.
+
+ The identifier.
+ Thrown if is null.
+ Thrown if is empty or contains characters
+ other than letters, digits and underscores.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if two markers are equal.
+
+ The first marker to compare.
+ The second marker to compare.
+ True if the markers are equal.
+
+
+
+ Returns true if two markers are not equal.
+
+ The first marker to compare.
+ The second marker to compare.
+ True if the markers are not equal.
+
+
+
+ Standard marker for assertion failures.
+
+
+
+
+ Standard marker for labels and headings.
+
+
+
+
+ Standard marker for exceptions including their details.
+
+
+
+
+ Standard marker for exception types reported as part of exception details.
+
+
+
+
+ Standard marker for exception messages reported as part of exception details.
+
+
+
+
+ Standard marker for exception property names reported as part of exception details.
+
+
+
+
+ Standard marker for exception property values reported as part of exception details.
+
+
+
+
+ Standard marker for stack traces.
+
+
+
+
+ Standard marker for fixed width output such as that from a console or structured table.
+
+
+
+
+ Standard marker for content that should be displayed with a highlight.
+
+
+
+
+ Standard marker for content that represents added content in a diff.
+
+
+
+
+ Standard marker for content that represents deleted content in a diff.
+
+
+
+
+ Standard marker for content that represents changed content in a diff.
+
+
+
+
+ Standard marker for text that is elided and replaced by an ellipsis.
+
+
+
+
+ Gets the marker class.
+
+
+
+
+ Gets the marker's attributes which are optional name/value pairs associated
+ with a marker to carry additional semantic content.
+
+
+
+
+ Defines constants for commonly used mime types for attachment contents.
+
+
+
+
+ Binary data.
+
+
+
+
+ Plain text data.
+
+
+
+
+ Xml data.
+
+
+
+
+ HTML.
+
+
+
+
+ Well-formed XHTML.
+
+
+
+
+ Cascading Style Sheet.
+
+
+
+
+ JavaScript
+
+
+
+
+ PNG image.
+
+
+
+
+ JPEG image.
+
+
+
+
+ GIF image.
+
+
+
+
+ MHTML web archive.
+
+
+
+
+ Flash video.
+
+
+
+
+ Guesses the mime type given a well-known extension.
+
+ The extension.
+ The mime type, or null if not known.
+ Thrown if is null.
+
+
+
+ Guesses the extension given a well-known mime-type.
+
+ The mime type.
+ The extension, or null if not known.
+ Thrown if is null.
+
+
+
+ Gets all the registered mime types.
+
+
+
+
+ A markup document writer that does nothing.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An implementation of that writes its output to a string.
+
+
+
+
+ An implementation of that represents the test log as
+ text written to a .
+
+
+
+
+ Creates a textual markup document writer.
+
+ The text writer to write to.
+ If true, prints detailed information about the location of
+ attachments, sections, and markers, otherwise discards these formatting details
+ and prints section headers as text on their own line.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the underlying text writer.
+
+
+
+
+ Returns true if the verbose print mode is enabled.
+
+
+
+
+ Creates a log stream writer for the stream.
+
+ If true, prints detailed information about the location of
+ attachments, sections, and markers, otherwise discards these formatting details
+ and prints section headers as text on their own line.
+
+
+
+ Gets the formatted log contents as a string.
+
+ The contents as a string.
+
+
+
+ A structured document is an Xml-serializable in-memory representation of a markup
+ document written by a .
+
+
+
+
+
+ Creates an empty document.
+
+
+
+
+ Gets an attachment by name.
+
+ The attachment name.
+ The attachment or null if not found.
+ Thrown if is null.
+
+
+
+ Gets a stream by name.
+
+ The stream name.
+ The stream or null if not found.
+ Thrown if is null.
+
+
+
+ Writes the contents of the document to a markup document writer.
+
+ The writer.
+ Thrown if is null.
+
+
+
+ Formats the document to a string by concatenating all formatted streams and
+ displaying a "*** Stream Name ***" header for each stream name.
+
+ The formatted text.
+
+
+
+ Gets the list of streams, not null.
+ Used for Xml-serialization.
+
+
+
+
+ Gets the list of attachments, not null.
+
+
+
+
+ A structured stream object represents a recursively structured stream of rich text that
+ supports embedded attachments, nested sections and marked regions. Each part of the
+ text is captured by a tag, some of which are composable and may therefore contain other tags.
+
+
+
+ It is effectively an xml-serializable representation of a markup stream written by
+ a .
+
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates an initialized stream.
+
+ The stream name.
+ Thrown if is null.
+
+
+
+ Writes the contents of the stream to a markup stream writer.
+
+ The writer.
+ Thrown if is null.
+
+
+
+ Formats the stream using a .
+
+ The formatted text.
+
+
+
+ Gets or sets the name of the stream, not null.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the body of the stream, not null.
+
+ Thrown if is null.
+
+
+
+ Writes a in memory.
+
+
+
+
+ Creates a document writer that builds a new .
+
+
+
+
+ Flushes the writer and formats it as a string.
+
+ The formatted document as a string.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the document under construction.
+
+
+
+ The contents of the document will change as more text is written.
+ However, it may be necessary to
+ or
+ the writer for these changes to be observed.
+
+
+
+
+
+ A structured text object contains attachments and formatted text with rich
+ presentation elements.
+
+
+
+ Structured text is emitted by a .
+
+
+
+
+
+
+ Creates a simple structured text object over a plain text string.
+
+ The text string.
+ Thrown if is null.
+
+
+
+ Creates a structured text object that wraps the body tag of a structured markup document stream
+ and no attachments.
+
+ The body tag to wrap.
+ Thrown if is null.
+
+
+
+ Creates a structured text object that wraps the body tag of a structured markup document stream
+ and a list of attachments.
+
+ The body tag to wrap.
+ The list of attachments.
+ Thrown if ,
+ or is null.
+
+
+
+ Returns the total length of all s that appear within
+ the structured text body.
+
+ The total text length.
+
+
+
+ Writes the structured text to a markup stream writer.
+
+ The writer.
+ Thrown if is null.
+
+
+
+ Writes the structured text to a markup stream writer and truncates its text
+ to a particular maximum length, omitting all subsequent contents.
+
+ The writer.
+ The maximum length of text to write.
+ True if truncation occurred.
+ Thrown if is null.
+ Thrown if is negative.
+
+
+
+ Formats the structured text to a string, discarding unrepresentable formatting details.
+
+ The structured text as a string.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if two structured text objects are equal.
+
+ The first structured text object to compare.
+ The second structured text object to compare.
+ True if the structured text objects are equal.
+
+
+
+ Returns true if two structured text objects are not equal.
+
+ The first structured text object to compare.
+ The second structured text object to compare.
+ True if the structured text objects are not equal.
+
+
+
+ Gets a copy of the body tag that describes the structured text.
+
+
+
+
+ Gets the immutable list of attachments belonging to the structured text.
+
+
+
+
+ An abstract base class for tag visitors that recursively traverses all tags
+ and does nothing else by default.
+
+
+
+
+ Visits a .
+
+
+
+
+ Visits a body tag.
+
+ The tag to visit.
+
+
+
+ Visits a section tag.
+
+ The tag to visit.
+
+
+
+ Visits a marker tag.
+
+ The tag to visit.
+
+
+
+ Visits an embedded attachment tag.
+
+ The tag to visit.
+
+
+
+ Visits a text tag.
+
+ The tag to visit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Writes information in a structured manner so as to produce a
+ or .
+
+
+
+
+ A markup stream writer provides methods for writing rich structured text with embedded
+ attachments, nested sections and hidden semantic markers to a particular stream within
+ a markup document writer.
+
+
+
+ The operations on this interface are thread-safe.
+
+
+ The object extends so instances may be
+ accessed by remote clients if required.
+
+
+ Newlines are always normalized to LFs ('\n') only. Any CRs ('\r') that are
+ written are automatically stripped.
+
+
+
+
+
+
+ Creates a markup stream writer.
+
+ The containing markup document writer.
+ The stream name.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Writes a markup stream writable object to the stream.
+
+
+ The object to write, or null if none.
+
+
+
+ Writes an exception.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception to write.
+ Thrown if is null.
+
+
+
+ Writes an exception within its own section.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception to write.
+ The section name, or null if none.
+ Thrown if is null.
+
+
+
+ Writes an exception.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception data to write.
+ Thrown if is null.
+
+
+
+ Writes an exception within its own section which provides additional cues for interpretation.
+
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception data to write.
+ The section name, or null if none.
+ Thrown if is null.
+
+
+
+ Writes highlighted text. Highlights can be used to
+ emphasize important information such differences between similar expected
+ and actual values.
+
+
+
+ This is a convenience method that simply encapsulates the highlighted text within a
+ marked region of type .
+
+
+ The text to write, or null if none.
+
+
+
+ Writes an ellipsis to indicate where content has been elided for brevity.
+ An ellipsis may be used, for example, when printing assertion failures to clearly
+ identify sections where the user is not being presented all of the information
+ because it was too long and had to be truncated.
+
+
+
+ This is a convenience method that simply encapsulates "..." within a
+ marked region of type . However, tools
+ may reinterpret the special marker to make the "..." less ambiguous.
+
+
+
+
+
+ Begins a section with the specified name. May be nested.
+
+
+
+ A section groups together related content in the markup stream to make it
+ easier to distinguish. The section name is used as a heading for presentation.
+
+
+
+
+
+ The name of the section.
+ A Disposable object that calls when disposed. This
+ is a convenience for use with the C# "using" statement.
+ Thrown if is null.
+
+
+
+ Begins a marked region. May be nested.
+
+
+
+ A marker is a hidden tag that labels its contents with a semantic class.
+ It is roughly equivalent in operation to an HTML "span" tag. Various tools
+ may inspect the markers and modify the presentation accordingly.
+
+
+
+
+
+ The marker.
+ A Disposable object that calls when disposed. This
+ is a convenience for use with the C# "using" statement.
+
+
+
+ Ends the region most recently started with one of the Begin* methods.
+
+ Thrown if there is no current nested region.
+
+
+
+ Embeds an attachment.
+
+
+
+ An attachment instance can be embedded multiple times efficiently since each
+ embedded copy is typically represented as a link to the same common attachment instance.
+
+
+ The attachment to embed.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds another copy of an existing attachment.
+
+
+
+ This method can be used to repeatedly embed an existing attachment at multiple
+ points in multiple streams without needing to keep the instance
+ itself around. This can help to reduce memory footprint since the
+ original instance can be garbage collected shortly
+ after it is first attached.
+
+
+ An attachment instance can be embedded multiple times efficiently since each
+ embedded copy is typically represented as a link to the same common attachment instance.
+
+
+ The name of the existing attachment to embed.
+
+
+ Thrown if is null.
+ Thrown if no attachment with the specified
+ name has been previously attached.
+
+
+
+ Embeds an plain text attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The text to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an HTML attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The HTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XHTML attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The XHTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XML attachment with mime-type .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The XML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an image attachment with a mime-type compatible with its internal representation.
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The image to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds a video attachment with a mime-type compatible with its internal representation.
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The video to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XML-serialized object as an XML attachment with mime-type
+ using the default for the object's type.
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The object to serialize and embed, must not be null.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XML-serialized object as an XML attachment with mime-type
+ using the specified .
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the document.
+ The object to serialize and embed, must not be null.
+ The to use, or null to use the default
+ for the object's type.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ This method does not make sense for a markup stream writer because
+ a stream cannot be closed independently of its containing document.
+
+
+
+
+ This method does not make sense for a markup stream writer because
+ a stream cannot be closed independently of its containing document.
+
+
+
+
+ This method does not make sense for a markup stream writer because
+ a stream cannot be closed independently of its containing document.
+
+
+
+
+ Gets the containing markup document writer.
+
+
+
+
+ Gets the name of the markup stream being written.
+
+
+
+
+
+
+
+
+
+
+ Creates a structured text writer.
+
+
+
+
+ Gets the structured text produced so far.
+
+ The structured text.
+
+
+
+ Returns the structured text formatted as a string.
+
+ The structured text as a string.
+
+
+
+
+
+
+ The top-level container tag of markup.
+
+
+
+
+ An abstract container tag for representing tags that can contain other tags.
+
+
+
+
+ A tag is the fundamental unit of content within a markup stream.
+
+
+
+
+ Provides a typed clone operation.
+
+ The type produced when the object is cloned.
+
+
+
+ Clones the object.
+
+ The cloned object.
+
+
+
+ Invokes the appropriate visitor method for this tag type.
+
+ The visitor.
+ Thrown if is null.
+
+
+
+
+
+
+ Formats the tag using a .
+
+ The formatted text.
+
+
+
+ Writes the tag to a .
+
+ The markup stream writer.
+ Throw if is null.
+
+
+
+
+
+
+ Creates an empty container tag.
+
+
+
+
+ Invokes the appropriate visitor method each element contained within this tag.
+
+ The visitor.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets the list of nested contents of this tag.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An embedded attachment tag.
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates an initialized tag.
+
+ The name of the attachment to embed.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the name of the referenced attachment to embed, not null.
+
+ Thrown if is null.
+
+
+
+ A marker tag.
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates an initialized tag.
+
+ The marker.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the marker class, not null.
+
+ Thrown if is null.
+ Thrown if the is not a valid identifier.
+ .
+
+
+
+ Gets the list of marker attributes.
+
+
+
+
+ Gets the marker.
+
+
+
+
+ Represents a marker attribute.
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates an initialized attribute.
+
+ The attribute name.
+ The attribute value.
+ Thrown if
+ is invalid.
+ Thrown if
+ or is null.
+
+
+
+ Gets or sets the attribute name, not null.
+
+ Thrown if is null.
+ Thrown if the is not a valid identifier.
+
+
+
+ Gets or sets the attribute value, not null.
+
+ Thrown if is null.
+
+
+
+ A section tag.
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates an initialized tag.
+
+ The section name.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the section name, not null.
+
+ Thrown if is null.
+
+
+
+
+ Formats instances to plain text.
+
+
+ Text tags are written as-is. Sections introduce paragraph breaks with
+ the header written out as the first line. Embedded attachments are
+ described by name.
+
+
+
+
+
+ Gets the formatted text that has been built.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ensures that the next chunk of text appended is separated by at least the specified
+ number of line breaks.
+
+ The minimum number of line breaks to insert.
+
+
+
+ Appends text to the buffer including any requested spacing.
+
+ The text to append.
+
+
+
+ A text tag, containing text.
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates an initialized text tag.
+
+ The text within the tag.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides the Xml schema for this element.
+
+ The schema set.
+ The schema type of the element.
+
+
+
+ Gets or sets the text within the tag, not null.
+
+ Thrown if is null.
+
+
+
+ Gets version information for Gallio components.
+
+
+
+
+ Generates a version label from a version number for display purposes.
+
+
+
+ A Gallio version label consists of a major version, minor version and build number and
+ is of the form "3.1 build 456". The revision number is not displayed.
+
+
+ Gallio component assemblies contain two different version numbers: an assembly version number
+ and a file version number. To preserve assembly compatibility across builds of the same version,
+ the assembly version number omits build number and revision information. Consequently
+ derived the version label from the file version number.
+
+
+ The version to transform into a label.
+ The version label.
+ Thrown if is null.
+
+
+
+ Gets a version label of a Gallio component assembly for display purposes.
+
+
+
+ A Gallio version label consists of a major version, minor version and build number and
+ is of the form "3.1 build 456". The revision number is not displayed.
+
+
+ Gallio component assemblies contain two different version numbers: an assembly version number
+ and a file version number. To preserve assembly compatibility across builds of the same version,
+ the assembly version number omits build number and revision information. Consequently
+ derived the version label from the file version number.
+
+
+ The assembly.
+ The version label.
+ Thrown if is null.
+
+
+
+ Gets the version number of an assembly for display purposes.
+
+
+
+ Returns the file version ( ) when available,
+ otherwise returns the assembly version.
+
+
+ The assembly.
+ The version number.
+ Thrown if is null.
+
+
+
+ Provides basic information about an Assembly derived from its metadata.
+
+
+
+
+ Gets the major version of the CLI runtime required for the assembly.
+
+
+
+ Typical runtime versions:
+
+ - 2.0: .Net 1.0 / .Net 1.1
+ - 2.5: .Net 2.0 / .Net 3.0 / .Net 3.5 / .Net 4.0
+
+
+
+
+
+
+ Gets the minor version of the CLI runtime required for the assembly.
+
+
+
+ Typical runtime versions:
+
+ - 2.0: .Net 1.0 / .Net 1.1
+ - 2.5: .Net 2.0 / .Net 3.0 / .Net 3.5 / .Net 4.0
+
+
+
+
+
+
+ Gets the processor architecture required for the assembly.
+
+
+
+
+ Gets the assembly references.
+
+
+
+ This field is only populated when the flag is specified.
+
+
+ Thrown if the assembly name was not populated.
+
+
+
+ Gets the assembly references.
+
+
+
+ This field is only populated when the flag is specified.
+
+
+ Thrown if the assembly references were not populated.
+
+
+
+ Gets the runtime version in the form "vX.Y.ZZZZ".
+
+
+
+ This field is only populated when the flag is specified.
+
+
+ Thrown if the runtime version were not populated.
+
+
+
+ Specifies the optional fields of the assembly metadata that are to be populated.
+
+
+
+
+ Populates the basic PE format information about the assembly.
+
+
+
+
+ Populates the assembly name.
+
+
+
+ Populating this field is expensive because it requires loading the entire assembly.
+
+
+
+
+
+
+ Populates the list of assembly references.
+
+
+
+ Populating this field is expensive because it requires loading the entire assembly.
+
+
+
+
+
+
+ Populates the runtime version.
+
+
+
+
+ Implementation of a debug symbol resolver based on the Microsoft Common Compiler Infrastructure Metadata Components (CCI Metadata Components)
+
+
+
+ see http://ccimetadata.codeplex.com/ for more information about the CCI Metadata Components.
+
+
+
+
+
+ Resolves debug symbols associated with members.
+
+
+
+
+ Gets the location of a source file that contains the declaration of a method, or
+ null if not available.
+
+ The path of the assembly that contains the method.
+ The method token.
+ The source code location, or null if unknown.
+ Thrown if is null.
+
+
+
+ Creates a Cci debug symbol resolver.
+
+
+
+
+
+
+
+
+
+
+ Data structure that maps every method in a CCI with its
+
+
+
+
+ Constructor.
+
+ File system wrapper.
+ The path of the assembly to scan.
+
+
+
+ Returns the code location of the method with the specified metadata token.
+
+ The searched metadata token.
+ The resulting code location, or an unknown location if the method was not found.
+
+
+
+ Creates instances of unresolved reflection objects based on wrappers.
+
+
+
+ All objects produced by this factory implement .
+
+
+
+
+
+ Creates an instance of the factory.
+
+
+
+
+ Creates an wrapper for .
+
+ The adapter.
+ The unresolved assembly.
+ Thrown if is null.
+
+
+
+ Creates a wrapper for .
+
+ The adapter.
+ The unresolved constructor.
+ Thrown if is null.
+
+
+
+ Creates a wrapper for .
+
+ The adapter.
+ The unresolved event.
+ Thrown if is null.
+
+
+
+ Creates a wrapper for .
+
+ The adapter.
+ The unresolved field.
+ Thrown if is null.
+
+
+
+ Creates a wrapper for .
+
+ The adapter.
+ The unresolved method.
+ Thrown if is null.
+
+
+
+ Creates a wrapper for .
+
+ The adapter.
+ The unresolved parameter.
+ Thrown if is null.
+
+
+
+ Creates a wrapper for .
+
+ The adapter.
+ The unresolved property.
+ Thrown if is null.
+
+
+
+ Creates a wrapper for .
+
+ The adapter.
+ The unresolved type.
+ Thrown if is null.
+
+
+
+ Gets the singleton instance of the factory.
+
+
+
+
+ Represents a code element that could not be resolved to a native reflection type.
+
+
+
+ The produces reflection objects that
+ implement this interface.
+
+
+
+
+
+ Gets the underlying reflection adapter.
+
+
+
+
+ Abstract base class for native wrappers.
+
+
+
+
+ A mirror describes a code element or attribute using a particular reflection policy.
+
+
+
+
+ Gets the reflection policy of the mirror.
+
+
+
+
+
+
+
+ The Gallio.Common.Reflection.Impl namespace provides internal reflection services
+ for reflection policy implementors and includes a framework for implementing
+ new reflection policies as subclasses of the
+ class.
+
+
+
+
+ The Gallio.Common.Reflection namespace defines an abstract reflection Api
+ similar to System.Reflection but intended to enable reflection of .Net code
+ assets that are not loaded as executable assemblies. The reflection Api
+ provides several capabilities not present in System.Reflection including the
+ ability to obtain source file and line number information as well as Xml
+ documentation comments. This namespace includes a wrapper for standard .Net
+ reflection and for a file-based reflection policy based on Mono.Cecil.
+
+
+
+
+ Utilities for generating dynamic proxies and adapters using code generation techniques.
+
+
+
+
+ Coerces a source delegate to a target delegate type by casting the source delegate's
+ parameters individually to the target delegate type's parameter types.
+
+ The target delegate type.
+ The source delegate, or null.
+ The target delegate, or null if the source delegate was null.
+ Thrown if
+ is null.
+ Thrown if
+ is not a delegate type.
+ Thrown if the source and target delegate types are
+ incompatible such as if they have different numbers of parameters or a different
+ composition of out/ref parameters.
+
+
+
+ Abstract base class for channels implemented using the .Net remoting infrastructure.
+
+
+
+
+ Creates a channel.
+
+ The .Net remoting channel.
+ The root Uri associated with the channel.
+ Thrown if or is null.
+
+
+
+
+
+
+ Disposes the channel.
+
+ True if was called directly.
+
+
+
+ Gets the Uri of a service with the given name that can be accessed using this channel.
+
+ The service name.
+ The service uri.
+ Thrown if is null.
+
+
+
+ Gets the associated .Net remoting channel.
+
+
+
+
+ Gets the root Uri associated with the channel.
+
+
+
+
+ Abstract base class for client channels implemented using the .Net
+ remoting infrastructure.
+
+
+
+
+ A client channel manages the client side of a remoting channel.
+
+
+
+
+
+ Gets a well-known remote service with the specified name.
+
+ The type of the service.
+ The name of the service.
+ The component or a proxy that provides the service.
+ Thrown if
+ or is null.
+
+
+
+ Creates a channel.
+
+ The .Net remoting channel.
+ The root Uri associated with the channel.
+ Thrown if or is null.
+
+
+
+
+
+
+ Abstract base class for client channels implemented using the .Net
+ remoting infrastructure.
+
+
+
+
+ A server channel manages the server side of a remoting channel.
+
+
+
+
+
+ Registers a well-known service with the specified name.
+
+ The name of the service.
+ The component that provides the service.
+ Thrown if or
+ is null.
+
+
+
+ Creates a channel.
+
+ The .Net remoting channel.
+ The root Uri associated with the channel.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+ A client channel based on an that uses a
+ .
+
+
+
+
+ Creates a channel.
+
+ The ipc port name to connect to.
+ Thrown if is null.
+
+
+
+ A server channel based on an that uses a
+ .
+
+
+
+
+ Creates a channel.
+
+ The ipc port name to register.
+ Thrown if is null.
+
+
+
+ A client channel based on an that uses a
+ .
+
+
+
+
+ Creates a channel.
+
+ The host name to connect to.
+ The port number to connect to.
+ The request timeout or null if none.
+ Thrown if is null.
+
+
+
+ A server channel based on an that uses a
+ .
+
+
+
+
+ Creates a channel.
+
+ The remotely accessed hostname.
+ The port number.
+ Thrown if is null.
+
+
+
+ The Gallio.Common.Remoting namespace contains types for managing .Net remoting channels.
+
+
+
+
+ Calculates a 32-bit hash code based on the FNV (Fowler-Noll-Vo) algorithm.
+ (http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash)
+
+
+
+
+ Returns the final hash code.
+
+ The resulting 32-bit hash code.
+
+
+
+ Default constructor.
+
+
+
+
+ Constructor.
+
+ Salt value.
+
+
+
+ Adds the hash code of the specified object and combines it with the previous values.
+
+ The object to add.
+ The builder itself for chaining syntax.
+
+
+
+ Adds the hash code of the specified objects and combines them with the previous values.
+
+ An enumeration of objects to add.
+ The builder itself for chaining syntax.
+
+
+
+ The Gallio.Common.Text namespace contains types for managing text ranges,
+ computing differences between strings, and regular expressions.
+
+
+
+
+ The Gallio.Common.Text.RegularExpression namespace contains a lightweight regular expression parser
+ which supports a subset of the .Net regular expression features. The parser is used in particular by MbUnit to generate
+ random strings based on a given pattern.
+
+
+
+
+ Utility class for absolute and relative time management.
+
+
+
+
+ Utility class for absolute and relative time management.
+
+
+
+
+ Resets the time and starts the clock.
+
+
+
+
+ Stops the clock.
+
+
+
+
+ Blocks the current thread for a specified time.
+
+ The amount of time for which the thread is blocked.
+
+
+
+
+ Blocks the current thread for a specified time.
+
+ The amount of time for which the thread is blocked.
+
+
+
+
+ Gets the time elapsed.
+
+
+
+
+ Returns the local date and time.
+
+
+
+
+ Returns the current date and time, expressed as the Coordinated Universal Time (UTC).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The Gallio.Common.Time namespace contains various types to ease absolute and relative time management.
+
+
+
+
+ A value type that represents the result of evaluating an
+ expression of type .
+
+
+
+
+ Gets the singular value of the type.
+
+
+
+
+
+
+
+ The Gallio.Common.Validation namespace provides a simple data validation framework
+ intended to be used to verify the integrity of data that has been deserialized
+ from Xml or other sources that lack strong built-in integrity constraints.
+
+
+
+
+ Normalization utilities.
+
+
+
+
+ Normalizes a collection of normalizable values.
+
+ The type of the collection.
+ The type of the values in the collection.
+ The collection of values to normalize, or null if none.
+ The factory to use to create a new collection if needed.
+ The normalization function to apply to each value in the collection.
+ The comparer to compare normalized values to determine if a change occurred during normalization.
+ The normalized collection, or null if none. The result will
+ be the same instance as if it was already normalized.
+ Thrown if ,
+ or is null.
+
+
+
+ Normalizes a string.
+
+
+
+ Preserves all valid characters in the string and replaces others as requested.
+
+
+ The string to normalize, or null if none.
+ The predicate to determine whether a character is valid.
+ If the character consists of a surrogate pair, then the parameter will be
+ its UTF32 value.
+ The converter to provide a replacement for an invalid character.
+ If the character consists of a surrogate pair, then the parameters will be
+ its UTF32 value.
+ The normalized text, or null if was null. The result will
+ be the same instance as if it was already normalized.
+ Thrown if
+ or is null.
+
+
+
+ Normalizes a name by replacing characters that are not printable with a '?'.
+
+ The name to normalize, or null if none.
+ The normalized name, or null if was null. The result will
+ be the same instance as if it was already normalized.
+
+
+
+ Normalizes a name by replacing characters that are not printable ASCII with '?'.
+
+ The string to normalize, or null if none.
+ The normalized string, or null if was null. The result will
+ be the same instance as if it was already normalized.
+
+
+
+ Normalizes Xml text.
+
+
+
+ Preserves all characters in the following ranges: \t, \n, \r, \u0020 - \uD7FF,
+ \uE000 - \uFFFD, and \U00010000 - \U0010FFFF. All other characters are replaced
+ with '?' to indicate that they cannot be represented in Xml.
+
+
+ The Xml text to normalize, or null if none.
+ The normalized Xml text, or null if was null. The result will
+ be the same instance as if it was already normalized.
+
+
+
+ Represents a type of XML diff.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Unexpected content.
+
+
+
+
+ Unexpected comment.
+
+
+
+
+ Unexpected element
+
+
+
+
+ Missing element
+
+
+
+
+ Mismatched content.
+
+
+
+
+ Mismatched comment.
+
+
+
+
+ Mismatched element.
+
+
+
+
+ Unexpected attribute.
+
+
+
+
+ Missing attribute.
+
+
+
+
+ Mismatched attribute.
+
+
+
+
+ Gets the description of the diff.
+
+
+
+
+ Represents a single attribute in an XML element.
+
+
+
+
+ Represents an XML node that can be compared to another
+ node of the same type, in order to get the differences.
+
+ The type of the diffable node.
+
+
+
+ Diffs the current node with an expected prototype, and returns
+ a set of differences found.
+
+ A prototype representing the expected content of the node.
+ The path of the parent node.
+ Comparison options.
+ The resulting diff set describing the differences found.
+ Thrown if or is null.
+
+
+
+ The base node for the XML composite tree representing an XML fragment.
+
+
+
+
+ Represents an XML node with a name.
+
+
+
+
+ Determines whether the name of the current node is equal to the specified name,
+ by respecting the specified equality options.
+
+ The name to compare.
+ Equality options.
+ True if the names are equal; false otherwise.
+
+
+
+ Gets the name of the node.
+
+
+
+
+ Returns the number of times the searched node was found at the specified path.
+
+ The path of the searched node.
+ The expected value found in the searched node, or null if the value must be ignored.
+ Options for the search.
+ The number of matching items found; zero if not found.
+ Thrown if is null.
+
+
+
+ Gets the type of the node.
+
+
+
+
+ Gets the index of the node.
+
+
+
+
+ Determines whether it is the first attribute in its parent.
+
+
+
+
+ Determines whether it is the last attribute in its parent.
+
+
+
+
+ Gets the children nodes.
+
+
+
+
+ Constructs an attribute.
+
+ The index of the attribute.
+ The name of the attribute.
+ The value of the attribute.
+ The number of attributes in the parent collection.
+ Thrown if or is null.
+ Thrown if is negative.
+
+
+
+
+
+
+
+
+
+
+
+
+ Determines whether the value of the current attribute is equal to the specified value,
+ by respecting the specified equality options.
+
+ The value to compare.
+ Equality options.
+ True if the values are equal; false otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the value of the attribute.
+
+
+
+
+ Determines whether it is the first attribute in its parent.
+
+
+
+
+ Determines whether it is the last attribute in its parent.
+
+
+
+
+
+
+
+
+
+
+ An immutable collection of XML attributes.
+
+
+
+
+ Immutable collection of XML nodes.
+
+
+
+
+ Constructs a collection of XML nodes from the specified enumeration.
+
+ An enumeration of nodes.
+
+
+
+
+
+
+
+
+
+ Determines whether the collection contains elements that match the conditions defined by the specified predicate.
+
+ The predicate.
+ True if the collection contains at least one element that match the conditions; otherwise, false.
+
+
+
+ Returns the number of times the searched node was found at the specified path.
+
+ The path of the searched node.
+ The expected value found in the searched node, or null if the value must be ignored.
+ Options for the search.
+ The number of matching items found; zero if not found.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ A collection of XML nodes that can be compared to another
+ collection of the same type, in order to get the differences.
+
+ The type of the collection.
+ The type of the items in the collection.
+
+
+
+ Returns the index of the first item which matches the specified predicates.
+
+ The predicate to evaluate.
+ The index of the first item found; otherwise -1 if no item was found.
+
+
+
+ Gets the number of items in the collection.
+
+
+
+
+ Gets the item located at the specified index.
+
+ The zero-based index.
+ The item found at the searched index.
+
+
+
+ An empty collection singleton instance.
+
+
+
+
+ Constructs a collection of XML attributes from the specified enumeration.
+
+ An enumeration of attributes.
+
+
+
+
+
+
+ Determines whether the collection contains an attribute with the specified name, and optionally the specified value.
+
+ The name of the searched attribute.
+ The expected value found in the searched attribute, or null if the value must be ignored.
+ Options for the search.
+ True is such an attribute exists; otherwise false.
+ Thrown if is null.
+
+
+
+ Represents the declaration element at the beginning of an XML document.
+
+
+
+
+ The abstract base node for the XML composite tree representing an XML fragment.
+
+
+
+
+ Constructs a node instance.
+
+ The type of the node.
+ The index of the node.
+ The number of elements at the same level.
+ The children nodes.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructs the declaration element.
+
+ The attributes of the element.
+
+
+
+
+
+
+
+
+
+ Gets the declaration attributes.
+
+
+
+
+ A diff item representing one single difference between two XML fragments.
+
+
+
+
+ Constructs a diff item.
+
+ The type of the diff.
+ The path of the difference.
+ Indicates which XML fragment is targeted by the diff.
+ Thrown if or is null.
+ Thrown if or is empty.
+
+
+
+
+
+
+ Returns the diff as an assertion failure.
+
+ The expected fragment used to format the diff.
+ The actual fragment used to format the diff.
+ The resulting assertion failure.
+ Thrown if or is null.
+
+
+
+ Gets a type of the diff.
+
+
+
+
+ Gets the path of the difference.
+
+
+
+
+ Indicates which XML fragment is targeted by the diff.
+
+
+
+
+ Provides services for formatting objects for display.
+
+
+
+
+ Formats an object to a string for display.
+
+
+
+ The formatted string may incorporate a variety of presentation techniques
+ intended to clearly identify formatted values of different types.
+ For example, strings might appear quoted, objects might be described
+ using or in terms of their properties,
+ collections might be listed as sequences of formatted elements.
+
+
+ The resulting string should not be expected to be machine-readable.
+
+
+ This method should never return an empty string or throw an exception.
+ If the value cannot be formatted property then a placeholder should
+ be used instead, such as the value's type.
+
+
+ Likewise this method should never throw an exception. If the object cannot be formatted
+ cleanly, then an error message should be produced instead.
+
+
+ These constraints are intended to ensure that the formatter provides
+ a robust service to all clients.
+
+
+ The object to format, may be null.
+ The formatted string, never null and never an empty string.
+
+
+
+ Diffing engine abstract factory.
+
+
+
+
+ Makes a diffing engine for collections of attributes.
+
+ The expected attributes.
+ The actual attributes.
+ The current path of the parent node.
+ Equality options.
+ The resulting diffing engine.
+
+
+
+ Makes a diffing engine for collections of elements.
+
+ The expected elements.
+ The actual elements.
+ The current path of the parent node.
+ Equality options.
+ The resulting diffing engine.
+
+
+
+ An immutable set of diff items representing the differences between two XML fragments.
+
+
+
+
+ A empty diff set singleton instance.
+
+
+
+
+ Constructs a sets from the specified enumeration of diff items.
+
+ An enumeration of diff items.
+
+
+
+
+
+
+ Returns the diff items as an enumeration of assertion failures.
+
+ The expected fragment used to format the diff.
+ The actual fragment used to format the diff.
+ The resulting enumeration of assertion failures.
+ Thrown if or is null.
+
+
+
+ Gets a value indicating if the set is empty (i.e. no differences found)
+
+
+
+
+ Gets the number of diffs in the collection.
+
+
+
+
+ A simple builder for the object.
+
+
+
+
+ Adds the specified diff item to the set.
+
+ The diff item to be added.
+ A reference to the builder itself.
+ Thrown if is null.
+
+
+
+ Adds the diff items contained into the specified set to the current set.
+
+ The diff items to be added.
+ A reference to the builder itself.
+ Thrown if is null.
+
+
+
+ Returns a new based on the current content of the builder.
+
+ The resulting diff set object.
+
+
+
+ The target of a diff result.
+
+
+
+
+ The actual XML fragment.
+
+
+
+
+ The expected XML fragment.
+
+
+
+
+ The actual and the expected XML fragments.
+
+
+
+
+ Represents a diffable XML fragment.
+
+
+
+ fragments are the root objects for constructing, searching, diffing XML documents.
+
+
+
+
+
+ Constructs an XML document.
+
+ The declaration element of the document.
+ The root element of the document.
+ Thrown if is null.
+
+
+
+
+
+
+ Diffs the current fragment with an expected prototype, and returns a set of differences found.
+
+ A prototype representing the expected content of the node.
+ Comparison options.
+ The resulting diff set describing the differences found.
+ Thrown if is null.
+
+
+
+
+
+
+ Finds the node located at the specified path.
+
+ The searched strict path.
+ The node found.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the declaration element of the document.
+
+
+
+
+ Diffing engine.
+
+ The type of the objects to diff.
+
+
+
+ Computes the differences between the expected and the actual object.
+
+ The resulting diff set.
+
+
+
+ Type of XML Node.
+
+
+
+
+ A valid XML fragment.
+
+
+
+
+ An XML element.
+
+
+
+
+ A comment element.
+
+
+
+
+ A textual content inside an element.
+
+
+
+
+ A declaration element at the beginning of an XML document.
+
+
+
+
+ An attribute.
+
+
+
+
+ Represents an immutable and loose path to a node in an XML fragment.
+
+
+
+ A loose path is built based on the name of the elements that lead to it.
+ Thus several nodes might be represented by the same loose path.
+
+
+
+
+
+ Represents an immutable path to a node in an XML fragment.
+
+
+
+
+ Formats the current path.
+
+ The resulting formatted path.
+
+
+
+ Determines whether the current node represents the empty root path.
+
+
+
+
+ Returns the entire path excluding the head node.
+
+ The output path
+
+
+
+ Returns the path nodes as an array.
+
+ The output array.
+
+
+
+
+
+
+
+
+
+
+ Represents a closed immutable and loose path to a node in an XML fragment.
+
+
+
+ A closed path points to a type of node that has no child, like an attribute.
+
+
+
+
+ A loose path is built based on the name of the elements that lead to it.
+ Thus several nodes might be represented by the same loose path.
+
+
+
+
+
+ Represents an immutable and loose path to a node in an XML fragment.
+
+
+
+ A loose path is built based on the name of the elements that lead to it.
+ Thus several nodes might be represented by the same loose path.
+
+
+
+
+
+ Extends the path to a child element.
+
+ The name of the child element.
+ A new immutable open path that encapsulates the current path.
+
+
+
+ Extends the path to a child attribute.
+
+ The name of the child attribute.
+ A new immutable closed path that encapsulates the current path.
+
+
+
+ Parses the textual representation of an XML path.
+
+
+
+
+ Parses the specified textual representation of a loose path.
+
+ The input path.
+ The resulting path object.
+
+
+
+ Parses the specified textual representation of a strict path.
+
+ The input path.
+ The resulting path object.
+
+
+
+ Formats a strict path into a human readable form, based on the contents of an existing XML fragment.
+
+
+
+
+ Formats a strict path into a human readable form, based on the contents of an existing XML fragment.
+
+ The strict path to format.
+ The fragment used to format the path..
+ Rendering options.
+ Thrown if , or is null.
+
+
+
+ Rendering options for the XML path renderer.
+
+
+
+
+ No options.
+
+
+
+
+ Prints each element in its own indented line.
+
+
+
+
+ Concrete node representing an XML declaration node in a strict path, and which is closed to further extensions.
+
+
+
+
+ Abstract node that extends a strict XML path, and let it opened for further extensions.
+
+
+
+
+ Represents an open, immutable and strict path to a node in an XML fragment.
+
+
+
+ A strict path is built based on the index of the elements that lead to it.
+ Thus a strict path unambiguously designates one and only one node in an XML fragment.
+
+
+
+
+
+ Extends the path to a child element.
+
+ The index of the child element.
+ A new immutable strict path that encapsulates the current path.
+
+
+
+ Extends the path to a child attribute.
+
+ The index of the child attribute.
+ A new immutable strict path that encapsulates the current path.
+
+
+
+ Extends the path to the declaration node.
+
+ A new immutable strict path that encapsulates the current path.
+
+
+
+ Splits the current path into an array containing all the inner child nodes.
+
+ An array of path nodes.
+
+
+
+ Returns the node with the current index from the child collection of the specified parent node.
+
+ The parent node.
+ The node in the collection of the child node with the current index.
+
+
+
+ Gets the index of the node.
+
+
+
+
+ Gets the parent path node.
+
+
+
+
+
+ Constructs an empty node that represents the root path.
+
+
+
+
+ Constructs a node that extends the specified parent node with an additional level of depth.
+
+ The parent node to encapsulate.
+ The index of the inner attribute.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the index of the attribute.
+
+
+
+
+ Constructs a node that extends the specified root node by targetting the declaration node.
+
+ The parent node to encapsulate.
+ Thrown if is null.
+ Thrown if is not the root.
+
+
+
+ Formats the current path.
+
+ The resulting formatted path.
+
+
+
+
+
+
+ Diffing engine for collections of ordered XML items.
+
+ The type of the collection.
+ The type of the items in the collection.
+
+
+
+ Constructs the diffing engine.
+
+ The expected object.
+ The actual object.
+ The current path of the parent node.
+ Equality options.
+ A type of the diffed items.
+
+
+
+
+
+
+ The target diffed items.
+
+
+
+
+ Diffing engine for collections of unordered attributes.
+
+
+
+
+ Constructs the diffing engine.
+
+ The expected object.
+ The actual object.
+ The current path of the parent node.
+ Equality options.
+
+
+
+
+
+
+ Diffing engine for collections of unordered elements.
+
+
+
+
+ Constructs the diffing engine.
+
+ The expected object.
+ The actual object.
+ The current path of the parent node.
+ Equality options.
+
+
+
+
+
+
+ Abstract node that extends and closes a loose XML path.
+
+
+
+
+ Constructs an empty node that represents the root path.
+
+
+
+
+ Constructs a node that extends the specified parent node with an additional level of depth.
+
+ The parent node to encapsulate.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the parent node of the path.
+
+
+
+
+ Determines whether the current node represents the root path.
+
+
+
+
+ Concrete node representing an XML attribute node, and that closes a loose XML path.
+
+
+
+
+ Constructs a node that extends the specified parent node by targetting an inner attribute by its name.
+
+ The parent node to encapsulate.
+ The name of the inner attribute.
+ Thrown if or is null.
+ Thrown if is empty.
+
+
+
+ Formats the current path.
+
+ The resulting formatted path.
+
+
+
+
+
+
+
+
+
+ Gets the name of the attribute.
+
+
+
+
+ Abstract node that extends a loose XML path, and let it opened for further extensions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Concrete node representing an XML element markup in a loose path, and which is opened for further extensions.
+
+
+
+
+ Gets the instance representing an empty root path.
+
+
+
+
+ Constructs a node that extends the specified parent node by targetting an child element by its name.
+
+ The parent node to encapsulate.
+ The name of the inner element.
+ Thrown if or is null.
+ Thrown if is empty.
+
+
+
+
+
+
+
+
+
+ Formats the current path.
+
+ The resulting formatted path.
+
+
+
+
+
+
+
+
+
+ Gets the name of the element.
+
+
+
+
+ Concrete node representing an XML attribute node, and that closes a strict XML path.
+
+
+
+
+ Constructs a node that extends the specified parent node by targetting an inner attribute by its index.
+
+ The parent node to encapsulate.
+ The index of the inner attribute.
+ Thrown if is null.
+ Thrown if is negative.
+
+
+
+ Formats the current path.
+
+ The resulting formatted path.
+
+
+
+
+
+
+ Concrete node representing an XML element node in a strict path, and which is opened for further extensions.
+
+
+
+
+ Gets the instance representing an empty root path.
+
+
+
+
+ Constructs a node that extends the specified parent node by targetting an child element by its index.
+
+ The parent node to encapsulate.
+ The index of the child element.
+ Thrown if is null.
+ Thrown if is negative.
+
+
+
+
+
+
+
+
+
+
+
+
+ Formats the current path.
+
+ The resulting formatted path.
+
+
+
+ Immutable collection of XML nodes.
+
+
+
+
+ An empty collection singleton instance.
+
+
+
+
+ Constructs a collection of XML nodes from the specified enumeration.
+
+ An enumeration of nodes.
+
+
+
+
+
+
+ Represents a comment tag in an XML fragment.
+
+
+
+
+ Constructs an XML comment tag.
+
+ The index of the node.
+ The total number of nodes at the same level.
+ The literal content of the comment tag.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets the textual content of the comment tag.
+
+
+
+
+ Represents a textual content inside an element
+
+
+
+
+ Constructs textual content inside an element.
+
+ The index of the node.
+ The total number of nodes at the same level.
+ The literal text content.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Determines whether the text value is equal to the specified text value,
+ by respecting the specified equality options.
+
+ The text value to compare.
+ Equality options.
+ True if the values are equal; false otherwise.
+
+
+
+ Gets the textual content of the comment tag.
+
+
+
+
+ Represents an element in an XML fragment.
+
+
+
+
+ Constructs an XML element.
+
+ The index of the node.
+ The total number of nodes at the same level.
+ The name of the element.
+ The attributes of the element.
+ The child nodes of the element.
+ Thrown if , , or is null.
+ Thrown if is empty.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the attributes of the element.
+
+
+
+
+ The Gallio.Common.Xml2 namespace contains types for manipulating Xml.
+
+
+
+
+ Options for the XML-related equality assertions.
+
+
+
+
+ No equality options (the strictest).
+
+
+
+
+ Ignores the case of the name of the XML elements.
+
+ " is equal to " ".
+ ]]>
+
+
+
+ Ignores the case of the value of the XML elements.
+
+ VALUE" is equal to "value ".
+ ]]>
+
+
+
+ Ignores the order of XML elements with the same parent.
+
+ " is equal to " ".
+ ]]>
+
+
+
+ Ignores the case of the name of the XML attributes.
+
+ " is equal to " ".
+ ]]>
+
+
+
+ Ignores the case of the value of the XML attributes.
+
+ " is equal to " ".
+ ]]>
+
+
+
+ Ignores the order of the attributes defined in the same element.
+
+ " is equal to " ".
+ ]]>
+
+
+
+ Ignores the comment tags.
+
+ ".
+ ]]>
+
+
+
+ A parsing service that extracts a composite tree from an XML fragment.
+
+
+
+
+ Parses the specified XML fragment.
+
+ The XML fragment to parse.
+ Parsing options.
+ The resulting document representing the parsed XML fragment.
+ Thrown if is null.
+
+
+
+ Entry-point class that serves as builder for an XML path.
+
+
+
+
+ Empty path instance.
+
+
+
+
+ Starts a new loose XML path by specifying the name of its root element.
+
+ The name of the root element.
+ A new open loose XML path.
+ Thrown if is null.
+ Thrown if is empty.
+
+
+
+ Parses the specified textual representation of a path.
+
+
+
+ The specified path should start with a slash character ('/').
+ Elements are separated by a slash, and attributes denoted by a colon (':').
+
+
+
+ The textual representation of a path.
+ The resulting path object.
+
+
+
+ Separator for elements.
+
+
+
+
+ Separator for elements.
+
+
+
+
+ Entry-point for strict XML paths.
+
+
+
+
+ Empty path instance.
+
+
+
+
+ Starts a new strict XML path by specifying the index of its root element.
+
+ The index of the root element.
+ A new open loose XML path.
+ Thrown if is negative.
+
+
+
+ Parses the specified textual representation of a path.
+
+
+
+ The specified path should start with a slash character ('/').
+ Elements are separated by a slash, and attributes denoted by a colon (':').
+
+
+
+ The textual representation of a path.
+ The resulting path object.
+
+
+
+ A delegate for the decorator method which
+ combines the specified inner failures into a single outer failure with a common explanation.
+
+ The inner failures to combine together.
+ The composite assertion failure.
+
+
+
+ The Gallio.Framework.Assertions namespace provides a framework for reporting assertion failures.
+
+
+
+
+ Captures screenshot images and videos.
+
+
+
+ These functions are intended to provide a simple interface for capturing,
+ captioning, and embedding images and video. If you desire more control over the manner
+ in which the capture occurs, you may prefer to use the ,
+ , and classes directly.
+
+
+
+
+
+ Gets the size of the screen.
+
+ The screen size.
+
+
+
+ Returns true if screenshots can be captured.
+
+
+
+ This method may return false if the application is running as a service which has
+ not been granted the right to interact with the desktop.
+
+
+ True if the screen can be captured.
+
+
+
+ Captures an image of the entire desktop.
+
+ The screenshot.
+ Thrown if a screenshot cannot be captured at this time.
+
+
+
+ Captures an image of the entire desktop.
+
+ The capture parameters.
+ The screenshot.
+ Thrown if is null.
+ Thrown if a screenshot cannot be captured at this time.
+
+
+
+ Starts recording a screen capture video of the entire desktop.
+
+
+
+ Recording a screen capture video can be very CPU and space intensive particularly
+ when running tests on a single-core CPU. We recommend calling
+ with
+ a factor of 0.25 or less and a frame rate
+ of no more than 5 to 10 frames per second.
+
+
+ The recorder.
+ Thrown if a screenshot cannot be captured at this time.
+
+
+
+ Starts recording a screen capture video of the entire desktop.
+
+
+
+ Recording a screen capture video can be very CPU and space intensive particularly
+ when running tests on a single-core CPU. We recommend calling
+ with
+ a factor of 0.25 or less and a frame rate
+ of no more than 5 to 10 frames per second.
+
+
+ The capture parameters.
+ The number of frames per second to capture.
+ The recorder.
+ Thrown if is null.
+ Thrown if a screenshot cannot be captured at this time.
+
+
+
+ Automatically embeds a screenshot when a trigger event occurs.
+
+
+
+ If screenshots cannot be captured, the method will embed a warning message to that effect.
+
+
+ The trigger event.
+ The name to give the image attachment, or null to assign one automatically.
+
+
+
+
+ Automatically embeds a screenshot when a trigger event occurs.
+
+
+
+ If screenshots cannot be captured, the method will embed a warning message to that effect.
+
+
+ The trigger event.
+ The name to give to the image attachment, or null to assign one automatically.
+ The capture parameters.
+ Thrown if is null.
+
+
+
+
+ Automatically embeds a video of the test run from this point forward when a trigger event occurs.
+
+
+
+ Recording a screen capture video can be very CPU and space intensive particularly
+ when running tests on a single-core CPU. We recommend calling
+ with
+ a factor of 0.25 or less and a frame rate
+ of no more than 5 to 10 frames per second.
+
+
+ If screenshots cannot be captured, the method will embed a warning message to that effect.
+
+
+ The trigger event.
+ The name to give the video attachment, or null to assign one automatically.
+
+
+
+
+ Automatically embeds a video of the test run from this point forward when a trigger event occurs.
+
+
+
+ Recording a screen capture video can be very CPU and space intensive particularly
+ when running tests on a single-core CPU. We recommend calling
+ with
+ a factor of 0.25 or less and a frame rate
+ of no more than 5 to 10 frames per second.
+
+
+ If screenshots cannot be captured, the method will embed a warning message to that effect.
+
+
+ The trigger event.
+ The name to give the video attachment, or null to assign one automatically.
+ The capture parameters.
+ The number of frames per second to capture.
+ Thrown if is null.
+
+
+
+
+ Gets the overlay manager for the current test context.
+
+ The overlay manager.
+
+
+
+ Gets the overlay manager for the specified test context.
+
+ The test context.
+ The overlay manager.
+ Thrown if is null.
+
+
+
+ Adds an overlay to display over screenshot images and videos.
+
+ The overlay to add.
+ Thrown if is null.
+
+
+
+ Sets a caption to display over screenshots images and videos.
+
+ The caption text, an empty string to remove it.
+ Thrown if is null.
+
+
+
+ Sets the font size of the caption to display over screenshots images and videos.
+
+ The caption font size.
+ Thrown if is less than 1.
+
+
+
+ Sets the alignment of the caption to display over screenshots images and videos.
+
+ The horizontal alignment.
+ The vertical alignment.
+
+
+
+ Gets the caption overlay to display over of screenshots images and videos.
+
+ The caption overlay.
+
+
+
+ Describes the semantics of how objects should be compared.
+
+
+
+ This class encapsulates a default set of rules for comparing objects. These rules may be
+ used as the foundation of a suite of standard assertion functions for comparing identity,
+ equality and relations.
+
+
+ The comparison engine has extension points available:
+ Extend the object comparison by registring custom comparers through .
+ Extend the object eqaulity by registring custom equality comparers through .
+
+
+ Custom comparers defined through or
+ have always a higher priority than any built-in comparer, including inner type comparers such as
+ or .
+
+
+
+
+
+ Gets the default instance.
+
+
+
+
+ Generator of sequential values.
+
+
+
+
+ Generic abstract generator of sequential numeric values.
+
+ The type of the value to generate.
+
+
+
+ Generic abstract generator of values.
+
+ The type of the values returned by the generator.
+
+
+
+ Generator of values.
+
+
+
+
+ Generates the sequence of values.
+
+ An enumeration of generated values.
+
+
+
+ Filters the specified value.
+
+ The value to be filtered.
+ True if the value is accepted; false otherwise.
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Checks for the specified value to be not one of the following:
+
+
+
+
+
+
+
+
+ The property value to be checked.
+ A friendly name for the property.
+ The specified property value is invalid.
+
+
+
+ Checks for the specified value to be not one of the following:
+
+
+
+
+
+ The property value to be checked.
+ A friendly name for the property.
+ The specified property value is invalid.
+
+
+
+ Checks for the specified value to be not one of the following:
+
+
+
+
+
+ The property value to be checked.
+ A friendly name for the property.
+ The specified property value is invalid.
+
+
+
+ Gets or sets the filter function that can be used
+ to reject or accept generated values.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Returns the linear sequence constructed by using the , , and properties.
+
+ The sequence of values.
+
+
+
+ Returns the linear sequence constructed by using the , , and properties.
+
+ The sequence of values.
+
+
+
+ Returns the linear sequence constructed by using the , , and properties.
+
+ The sequence of values.
+
+
+
+ Gets or sets the starting point of the sequence.
+
+
+
+
+ Gets or sets the ending point of the sequence.
+
+
+
+
+ Gets or sets the increment between each value of the sequence.
+
+
+
+
+ Gets or sets the length of the sequence of values
+ created by the generator.
+
+
+
+
+ Gets the default step.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the default step.
+
+
+
+
+ Generator of sequential values.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the default step.
+
+
+
+
+ Generator of random values within a given range.
+
+
+
+
+ Generic abstract generator of random values within a given range.
+
+ The type of the value to generate.
+
+
+
+ A general purpose pseudo-random number generator.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Returns the sequence of random values.
+
+ The sequence of values.
+
+
+
+ Gets the lower bound of the range.
+
+
+
+
+ Gets the upper bound of the range.
+
+
+
+
+ Gets the length of the sequence of values
+ created by the generator.
+
+
+
+
+ Constructs a generator of random numbers.
+
+
+
+
+
+
+
+ Generator of random values within a given range.
+
+
+
+
+ Constructs a generator of random numbers.
+
+
+
+
+
+
+
+ Describes the semantics of how objects should be compared.
+
+
+
+ This class encapsulates a default set of rules for comparing objects. These rules may be
+ used as the foundation of a suite of standard assertion functions for comparing identity,
+ equality and relations.
+
+
+ The comparison engine has extension points available:
+ Extend the object comparison by registring custom comparers through .
+ Extend the object eqaulity by registring custom equality comparers through .
+
+
+ Custom comparers defined through or
+ have always a higher priority than any built-in comparer, including inner type comparers such as
+ or .
+
+
+
+
+
+ Returns true if two objects are the same.
+
+
+
+ Rules applied:
+
+ - Objects are the same if they are referentially
+ equal according to
.
+
+
+
+ The left object, may be null.
+ The right object, may be null.
+ True if both objects are the same.
+ The object type, which must be a reference type (class) since a value type
+ (struct) has no concept of referential identity.
+
+
+
+ Returns true if two objects are equal.
+
+ The left object, may be null.
+ The right object, may be null.
+ True if the objects are equal.
+ for details.
+
+
+
+ Returns true if two objects are equal.
+
+
+
+ Rules applied:
+
+ - If both objects are null, returns true.
+ - If one object is null but not the other, returns false.
+ - If both objects are referentially equal, returns true.
+ - If both objects are of a special type, applies special type equality semantics (see below)
+ - If the objects are both instances of the same simple enumerable type (
),
+ returns true if the collections have equal length and contents.
+ - Otherwise uses
to determine equality.
+
+
+
+ Special type semantics:
+
+ and : Compared by their ToString().
+ : Compared by their full name.
+
+
+
+ The left object, may be null.
+ The right object, may be null.
+ True if the objects are equal.
+ The object type.
+
+
+
+ Compares two objects.
+
+
+
+ Rules applied:
+
+ - If both objects are null, returns 0.
+ - If both objects are referentially equal, returns true.
+ - If the objects are both instances of the same simple enumerable type (
),
+ then compares each pair of values until a non-equal pair is found at which point the
+ result of that comparison is returned. If one enumeration runs out of values than the other,
+ then it is considered to be less than the other.
+ - If the objects implement
, uses it to determine order.
+ - If the objects implement
, uses it to determine order.
+ - Otherwise no deterministic comparison is possible so throws an exception.
+
+
+
+ The ordering of nulls is determined by except
+ when comparing collections. If one collection happens to be null but not the other then it
+ is considered less than the other.
+
+
+ The left object, may be null.
+ The right object, may be null.
+ A value less than zero if the left object if less than
+ the right object, zero if the left and right objects are equal, or greater than zero if
+ the left object is greater than the right object.
+ Thrown if the values cannot be ordered.
+ The object type.
+
+
+
+ Returns true if the specified type is a simple enumerable type.
+
+
+
+ A simple enumerable type is one that that does not override .
+
+
+ The set of simple enumerable types includes arrays, lists, dictionaries and other
+ standard collection types in the .Net framework.
+
+
+ The object type.
+ Thrown if is null.
+
+
+
+ Returns true if two values are equal to within a specified delta.
+
+
+
+ The values are considered approximately equal if the absolute value of their difference
+ is less than or equal to the delta.
+
+
+ This method works with any comparable type that also supports a subtraction operator
+ including , , ,
+ , (using a delta),
+ and many others.
+
+
+ The type of values to be compared.
+ The type of the difference produced when the values are
+ subtracted, for numeric types this is the same as but it
+ may differ for other types.
+ The expected value.
+ The actual value.
+ The inclusive delta between the values.
+ True if the values are approximately equal.
+
+
+
+ Extensibility point for object equality managed by .
+
+
+
+ Use the methods and to add and remove
+ custom type equality comparers.
+
+
+ The Gallio inner comparison engine handles with the case of null objects comparison prior to
+ the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the
+ objects to compare are never null.
+
+
+
+ ((x, y) => x.Value == y.Value);
+ ]]>
+
+
+
+
+ Registers a custom equality comparer for the specified type.
+
+
+
+ The Gallio inner comparison engine handles with the case of null objects comparison prior to
+ the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the
+ objects to compare are never null.
+
+
+ The type for which the custom comparer operates.
+ An equality comparer that returns true is the objects are equivalent; false otherwise.
+ Thrown if or is null.
+ Thrown if a custom comparer for the specified type was already registered.
+
+
+
+ Registers a strongly-typed custom equality comparer for the specified type.
+
+
+
+ The Gallio inner comparison engine handles with the case of null objects comparison prior to
+ the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the
+ objects to compare are never null.
+
+
+ The type for which the custom comparer operates.
+ An equality comparer that returns true is the objects are equivalent.
+ Thrown if is null.
+ Thrown if a custom comparer for the specified type was already registered.
+
+
+
+ Unregisters the custom equality comparer for the specified type.
+
+
+
+ If no custom comparer exists for the specified type,
+ the method has no effect and no exception is thrown.
+
+
+ The searched type.
+ Thrown if is null.
+
+
+
+ Unregisters the custom equality comparer for the specified type.
+
+
+
+ If no custom comparer exists for the specified type,
+ the method has no effect and no exception is thrown.
+
+
+ The searched type.
+
+
+
+ Extensibility point for object comparison managed by .
+
+
+
+ Use the methods and to add and remove
+ custom type comparers.
+
+
+ The Gallio inner comparison engine handles with the case of null objects comparison prior to
+ the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the
+ objects to compare are never null.
+
+
+
+ ((x, y) => x.Value.CompareTo(y.Value));
+ ]]>
+
+
+
+
+ Registers a custom comparer for the specified type.
+
+
+
+ The Gallio inner comparison engine handles with the case of null objects comparison prior to
+ the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the
+ objects to compare are never null.
+
+
+ The type for which the custom comparer operates.
+ A comparer that returns a negative value if the first object represents less that the second object,
+ zero if they represents the same value; or a positive value if the first object represents more than the second object.
+ Thrown if or is null.
+ Thrown if a custom comparer for the specified type was already registered.
+
+
+
+ Registers a strongly-tped custom comparer for the specified type.
+
+
+
+ The Gallio inner comparison engine handles with the case of null objects comparison prior to
+ the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the
+ objects to compare are never null.
+
+
+ The type for which the custom comparer operates.
+ A comparer that returns a negative value if the first object represents less that the second object,
+ zero if they represents the same value; or a positive value if the first object represents more than the second object.
+ Thrown if is null.
+ Thrown if a custom comparer for the specified type was already registered.
+
+
+
+ Unregisters the custom comparer for the specified type.
+
+
+
+ If no custom comparer exists for the specified type,
+ the method has no effect and no exception is thrown.
+
+
+ The searched type.
+ Thrown if is null.
+
+
+
+ Unregisters the custom comparer for the specified type.
+
+
+
+ If no custom comparer exists for the specified type,
+ the method has no effect and no exception is thrown.
+
+
+ The searched type.
+
+
+
+ Base class for all the patterns defining an extension point of the framework.
+
+
+
+ Extension point attributes act through a static method.
+
+
+
+
+
+ A decorator attribute applies contributions to a test component in scope
+ such as a test or test parameter generated by some other pattern attribute.
+
+
+
+ Occasionally the order in which decorators are applied is significant so this type provides a
+ property to specify an explicit ordering when required. All decorators that apply to a given test component
+ declaration are applied in increasing .
+
+
+
+
+
+ The class is the base class for all pattern test framework
+ attributes. It associates a code element with a for building
+ up parts of the test model using reflection.
+
+
+
+ Subclasses of define simpler interfaces for implementing
+ the semantics of common types of attributes such as test factories, decorators,
+ and data providers. Refer to the documentation of each subclass for details on its use.
+
+
+
+
+
+
+
+ A defines a composable rule for building up a test model
+ using reflection.
+
+
+
+ The general idea is that a pattern applies contributions to a
+ that represents the state of the pattern interpretation process. A primary pattern
+ adds contributions to its containing scope with the method. All
+ patterns (primary and non-primary) add further contributions to the pattern's own
+ scope with the method.
+
+
+ A pattern can also defer some of its processing by registering a decorator on the scope.
+ Once all of the decorators have been gathered, they can be applied in sorted order
+ as required.
+
+
+ Pattern processing is performed recursively. First the primary pattern for the assembly
+ is found. If none is registered then the default assembly pattern is used instead.
+ The assembly pattern then performs reflection over the types within the assembly and hands
+ off control (via ) to any primary patterns it finds each type. Likewise the
+ types scan their members and call into their primary patterns. And so on. Each primary pattern
+ is responsible for invoking (via ) any additional non-primary patterns
+ associated with their code element after they have established the appropriate evaluation scope.
+
+
+ Typically a pattern is associated with a code element by means of a
+ but other associations are possible. Some patterns might define default rules for recursively
+ processing code elements that do not have primary patterns of their own. Others might use
+ means other than standard reflection to discover the patterns to be applied. The process is
+ intended to be open and extensible.
+
+
+
+
+
+
+
+ Gets the test parts represented by a code element.
+
+
+
+ This method is only called for primary patterns.
+
+
+ The evaluator.
+ The code element.
+ The test parts, or an empty array if none.
+ May be thrown to halt processing of the pattern
+ and report an error message to the user as an annotation that describes how the
+ pattern was misapplied.
+
+
+
+ Consumes a code element and applies its contributions to the scope
+ provided by a containing pattern.
+
+
+
+ This method is used to declare new tests, test parameters and other components
+ and add them to a containing test that was defined in some other scope.
+
+
+ For example, when enumerating test fixtures, the assembly-level pattern will
+ call the method of the primary patterns associated
+ with each type in an assembly. Some of these patterns will create new test fixture
+ objects and add them as children of the containing assembly-level test. They will then
+ call the method of each non-primary pattern associated with
+ the type within the scope of the test fixture. Then they will typically
+ recurse into the fixture to apply contributions defined by patterns associated
+ with methods, fields, properties, events, constructors and generic type parameters.
+
+
+ This method is only called for primary patterns.
+
+
+ The containing scope.
+ The code element to process.
+ If true, skips generating child test components.
+ Instead the children may be populated on demand using
+ . The implementation
+ may safely ignore the value of this flag so long as subsequent attempts to populate children on
+ demand are idempotent (do nothing or have no adverse side-effects).
+
+ May be thrown to halt processing of the pattern
+ and report an error message to the user as an annotation that describes how the
+ pattern was misapplied.
+
+
+
+ Processes a code element and applies its contributions to the scope of this pattern.
+ The scope will typically have been introduced by the method
+ of a primary pattern applied to this code element.
+
+
+
+ This method is used by patterns to decorate tests and test parameters that
+ have been declared by primary patterns.
+
+
+ For example, the method will typically be called by another
+ pattern that has just created a new test based on the associated code element,
+ such as a test method. The method then has the opportunity to modify the test
+ to add metadata, change its name, add new behaviors, and so on.
+
+
+ The scope.
+ The code element to process.
+ May be thrown to halt processing of the pattern
+ and report an error message to the user as an annotation that describes how the
+ pattern was misapplied.
+
+
+
+ Returns true if this is a primary pattern.
+
+
+
+ A primary pattern is a pattern that defines the ultimate purpose of a code
+ element and the nature of the tests or test parameters that are produced from it.
+ Consequently the primary pattern is the only one on which the
+ method will be called.
+
+
+ Each code element may have at most one primary pattern. It is an error
+ for a code element to have more than one associated primary pattern.
+
+
+ If a code element does not have an associated primary pattern, its containing
+ test may choose to apply default processing to it instead. For example, the
+ containing test may give an opportunity to patterns associated with the code element
+ to consume a test method parameter but will revert to default behavior if no
+ primary patterns explicitly claim it.
+
+
+ Non-primary patterns still play a very important part in the construction
+ of the test model. Non-primary patterns may implement the
+ method to decorate tests and test parameters declared by the primary pattern.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Throws a with the specified message
+ including a short heading that identifies the attribute type.
+
+ The message, not null.
+ Always thrown.
+
+
+
+ Throws a with the specified message
+ including a short heading that identifies the attribute type.
+
+ The message, not null.
+ The associated exception, or null if none.
+ Always thrown.
+
+
+
+
+
+
+ Gets or sets the order in which the decorator should be applied.
+
+
+
+ Decorators with lower order indices values are applied before decorators with
+ higher ones. In the case of a tie, an arbitrary choice is
+ made among decorators with the same order index to determine the order in
+ which they will be processed.
+
+
+
+ The default order index is 0.
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The method.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Applies decorations to the containing test.
+
+ The containing scope.
+ The method to process.
+
+
+
+
+
+
+ Gets the current test environment instance which can be used to register custom actions.
+
+
+
+
+ Targeted member types for the fixture invoker.
+
+
+
+
+ Default value combining , , and .
+
+
+
+
+ Indicates to find the searched member among the fields.
+
+
+
+
+ Indicates to find the searched member among the properties.
+
+
+
+
+ Indicates to find the searched member among the methods.
+
+
+
+
+ Gets the list of test framework extensions associated with a given assembly.
+
+ The assembly.
+ The associated extensions.
+
+
+
+ Explores tests implemented using the pattern test framework.
+
+
+
+
+ A test explorer generates a from test code.
+
+
+
+ A test explorer may be stateful since it is only used to build one
+ incrementally and then is disposed.
+
+
+ Subclasses of this class provide the algorithm used to populate the test model.
+
+
+
+
+
+ Disposes the test explorer.
+
+
+
+
+ Disposes the test explorer.
+
+ True if was called directly.
+
+
+
+ Explores tests defined by the specified code element and populates the explorer's test model.
+
+ The reflection policy.
+ The code element.
+ Thrown if ,
+ is null.
+
+
+
+ Finishes populating the model.
+
+
+
+ The default implementation does nothing. Subclasses should override this method
+ to apply any deferred changes to the test model once exploration is complete.
+
+
+
+
+
+ Explores tests defined by the specified code element and populates the explorer's test model.
+
+ The reflection policy, not null.
+ The code element, not null.
+
+
+
+ Creates the .
+
+
+
+ The default implementation returns a new .
+
+
+ The test model.
+
+
+
+ Gets the test model.
+
+
+
+
+ The test model for the pattern test framework.
+
+
+
+
+ The test model provides access to the contents of the test tree
+ generated from a test package by the test enumeration process.
+
+
+
+
+ Creates a test model with a new empty root test.
+
+
+
+
+ Clears the list of annotations.
+
+
+
+
+ Adds an annotation.
+
+ The annotation to add.
+ Thrown if is null.
+
+
+
+
+ Removes an annotation.
+
+ The annotation to remove.
+ Thrown if is null.
+
+
+
+
+ Finds a test by its id.
+
+ The test id.
+ The test, or null if not found.
+ Thrown if is null.
+
+
+
+ Gets or sets the root test in the model.
+
+ Thrown if is null.
+
+
+
+ Recursively enumerates all tests including the root test.
+
+
+
+
+ Gets the read-only list of annotations.
+
+
+
+ An annotation is an informational, warning or error message associated with
+ a code element in the test model.
+
+
+ Test frameworks publish annotations on the test model that describe usage errors
+ or warnings about problems that may prevent tests from running, such as using a
+ custom attribute incorrectly. They may also emit informational annotations to
+ draw the user's attention, such as by flagging ignored or pending tests.
+
+
+ The presentation of annotations is undefined. A command-line test runner might
+ simply log them whereas an IDE plugin could generate new task items to incorporate
+ them into the UI.
+
+
+
+
+
+ Creates a pattern test model.
+
+
+
+
+ Gets or sets the root test.
+
+
+
+
+ Specifies a trigger condition for automatic execution of an action.
+
+
+
+
+
+ Never performs the action.
+
+
+
+
+ Perform the action when the test finishes.
+
+
+
+
+ Perform the action when the test passed.
+
+
+
+
+ Perform the action when the test passed or was inconclusive.
+
+
+
+
+ Perform the action when the test was inconclusive.
+
+
+
+
+ Perform the action when the test failed.
+
+
+
+
+ Perform the action when the test failed or was inconclusive.
+
+
+
+
+ Generator of random objects from a predefined list of string values.
+
+
+
+
+ Generator of random objects based on a regular expression filter mask.
+
+
+
+
+ Constructs a generator of random objects.
+
+
+
+
+
+
+
+ Generates the next random string.
+
+ A random string.
+
+
+
+ Gets or sets the length of the sequence of strings
+ created by the generator.
+
+
+
+
+ Constructs a generator of random objects.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the predefined string values.
+
+
+
+
+ Generator of random objects based on a regular expression filter mask.
+
+
+
+
+ Constructs a generator of random objects.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets regular expression pattern that serves as a filter mask.
+
+
+
+
+ The Gallio.Framework.Data.Generation namespace provides a framework for generating data
+ based on a specification.
+
+
+
+
+ Represents a arbitrary character among a set of possible values, in a regular expression tree.
+
+
+
+ It is usually the representation of an explicit set, noted as "[...]" in a regular expression.
+
+
+
+
+
+ Abstract base class for a regular expression composite tree leaf.
+
+
+
+
+ Interface for a regular expression composite tree leaf.
+
+
+
+
+ Returns a random string that matches the regular expression element.
+
+ A random string.
+
+
+
+ A shared built-in generator of random numbers.
+
+
+
+
+ Constructs an inner element of a regular expression composite tree.
+
+ A quantifier specifying how many times the element is repeated.
+ Thrown if is null.
+
+
+
+
+
+
+ Returns the random string that matches the regular expression element.
+
+ A random string.
+
+
+
+ Constructs an element representing a set of possible characters.
+
+ A quantifier specifying how many times the element is repeated.
+ A raw string containing the characters to include into the set,
+ expressed in the usual regular expression syntax (example: "ABCX-Z0-9").
+ Thrown if or are null.
+
+
+
+ Constructs an element representing a set of possible characters.
+
+ A quantifier specifying how many times the element is repeated.
+ An array of characters to include into the set.
+ Thrown if or are null.
+
+
+
+
+
+
+ Represents an empty element in a regular expression composite tree.
+
+
+
+
+ Represents an invariant literal text in a regular expression tree.
+
+
+
+
+ Constructs an invariant literal text.
+
+ A quantifier specifying how many times the element is repeated.
+ The invariant literal text.
+ Thrown if or are null.
+
+
+
+
+
+
+ Default constructor.
+
+
+
+
+ Represents an element of a regular expression tree that serves as logical container child elements.
+
+
+
+ It is usually the representation of a logical group, noted as "(...)" in a regular expression.
+
+
+
+
+
+ Constructs a group element that contains child elements.
+
+ A quantifier specifying how many times the element is repeated.
+ The child elements.
+ Thrown if or are null.
+
+
+
+
+
+
+ This exception type is used to signal an error while parsing
+ a simplified regular expression with the RegexLite parser.
+
+
+
+
+ Creates a exception.
+
+
+
+
+ Creates a exception with the specified message..
+
+ The message, or null if none.
+
+
+
+ Creates a exception with the specified message and the inner exception.
+
+ The message, or null if none.
+ The inner exception, or null if none.
+
+
+
+ Creates a exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Lightweight parser for simplified regular expressions.
+
+
+
+
+ RegexLite text parser.
+
+ The text to be parsed.
+ A root element containing the resulting regular expression tree.
+
+
+
+ Provides information describing how to parse the current expression.
+
+
+
+
+ Primary mode for parsing root expressions.
+
+
+
+
+ Special mode for parsing logical groups "(...)".
+
+
+
+
+ Special mode for parsing explicit sets "[...]".
+
+
+
+
+ Determines whether the specified character is
+ the initiator character for the current parsing mode.
+
+ The character to evaluate.
+ True if is an initiator; false otherwise.
+
+
+
+ Determines whether the specified character is
+ the terminator character for the current parsing mode.
+
+ The character to evaluate.
+ True if is a terminator; false otherwise.
+
+
+
+ Parses the specified expression in the context of the actual parsing mode.
+
+ The text to parse.
+ A quantifier to attach to the resulting element.
+ A resulting element representing the expression.
+
+
+
+ Returns the information container corresponding to the specified initiator character,
+ or the 'Root' parsing mode, if not found.
+
+ The character to evaluate.
+ The resulting information container.
+
+
+
+ Gets the initiator character.
+
+
+
+ The initiator character is the character that starts of an inner expression.
+
+
+
+
+
+ Gets the terminator character.
+
+
+
+ The initiator character is the character that ends an inner expression.
+
+
+
+
+
+ Gets a value indicating if the actual parsing mode is the primary 'Root' mode.
+
+
+
+
+ Gets a value indicating if the actual parsing mode should process metacharacters,
+ or just to ignore them for a later processing.
+
+
+
+
+ A lightweight simplified regular expression pattern.
+
+
+
+ The following syntactic features are supported:
+
+ -
+
Logical Grouping : Group a part of the expression ((...) ).
+
+ -
+
Explicit Set : Define a set of possible characters ([...] ).
+ Ranges defined with a tiret are accepted.
+
+ -
+
Explicit Quantifier : Specify the number of times the previous expression must be repeated.
+ 'Constant' ({N} ) or 'Range' ({N,M} ) syntax are both accepted.
+
+ -
+
Zero Or One Quantifier Metacharacter : 0 or 1 of the previous expression (? ).
+ Same effect as {0,1} .
+
+ -
+
Escape Character : Makes the next character literal instead of a special character (\ ).
+
+
+
+
+
+
+
+ Constructs a simplified regular expression pattern.
+
+ The input pattern.
+ Thrown if is null.
+ Thrown if is invalid.
+
+
+
+ Returns the random string that matches the regular expression pattern.
+
+ A random string that matches the regular expression pattern.
+
+
+
+ Gets the root element (for testing purpose.)
+
+
+
+
+ Quantifier for a regular expression element,
+ which specifies the number of times the element must be repeated.
+
+
+
+
+ Gets a special quantifier specifying a single occurence of an element (1 time).
+
+
+
+
+ Gets a special quantifier specifying the optional occurence of an element (0 or 1 time).
+
+
+
+
+ Constructs a quantifier with a constant value.
+
+ The number of repetitions.
+
+
+
+ Constructs a quantifier specifying a variable number of times.
+
+ The minimum value of the range.
+ The maximum value of the range.
+
+
+
+ Returns a random number within the range of the quantifier.
+
+ A random number.
+
+
+
+ Gets the minimum number of times.
+
+
+
+
+ Gets the maximum number of times.
+
+
+
+
+ Generator of sequential values.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the default step.
+
+
+
+
+ Generator of random values within a given range.
+
+
+
+
+ Constructs a generator of random numbers.
+
+
+
+
+
+
+
+ A condition is a simple light-weight mechanism for evaluating conditional
+ expressions in a given context.
+
+
+
+ Conditions are most useful for defining declarative conditional activation
+ expressions in . For example, we might wish to automatically
+ activate a plugin or enable an action when a given property appears in the
+ conditional context.
+
+
+ The currently-supported conditional expression syntax is as follows:
+
+ - "${namespace:identifier}": Specifies a condition based on the existence
+ of a property with a particular identifier within the specified namespace.
+ eg. "${env:VariableName}" might evaluate to true if the "VariableName" environment
+ variable is defined.
+ - "ExprA or ExprB": Given two conditions ExprA and ExprB produces a combined
+ condition that evaluates to true when either on is true.
+ - An empty condition is invalid.
+
+
+
+ Note: This abstraction is a work in progress. If you need additional
+ conditional expression types, operators or combinators please post
+ a feature request to the Gallio issue tracker. Later we may open
+ this up similar to the test Filter mechanism.
+
+
+
+
+
+ Returns true if the condition is satisfied in the given context.
+
+ The condition evaluation context.
+ True if the condition is satisfied.
+ Thrown if is null.
+
+
+
+ Parses a condition from an expression.
+
+ The expression to parse.
+ The expression.
+ Thrown if is null.
+ Thrown if cannot be parsed.
+
+
+
+ Returns the conditional expression as a string.
+
+ The expression string.
+
+
+
+ A condition context provides information used to evaluate whether a condition holds true.
+
+
+
+
+ Returns true if the context contains a value for a given property.
+
+ The property namespace.
+ The property identifier.
+ True if the context has the specified property.
+ Thrown if
+ or is null.
+
+
+
+ Returns true if the context contains a value for a given property.
+
+ The property namespace, not null.
+ The property identifier, not null.
+ True if the context has the specified property.
+
+
+
+ This exception type is used to signal an error while using a data generator.
+ The exception message, if present, should explain the reason that the test was generator has failed.
+
+
+
+
+ Creates a exception.
+
+
+
+
+ Creates a exception with the specified message..
+
+ The message, or null if none.
+
+
+
+ Creates a exception with the specified message and the inner exception.
+
+ The message, or null if none.
+ The inner exception, or null if none.
+
+
+
+ Creates a exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ The Gallio.Framework.Data namespace provides a framework for manipulating data
+ from multiple data sources and performing data binding.
+
+
+
+
+ The Gallio.Framework namespace provides data types and services for test writers
+ and framework implementors.
+
+
+
+
+ Finds and invokes a member of a test fixture, a nested type of the test fixture,
+ or an external type.
+
+
+
+ The member is searched among the fields, the properties, and the methods. It might be
+ a public or a non-public member. If the member belongs directly to the test fixture, it
+ might be an instance member. Otherwise, it must be a static member.
+
+
+ The type of the result returned by the member invoked.
+
+
+
+ Constructs a invoker for a member of a test fixture, a nested type of the test fixture,
+ or an external type.
+
+
+
+ The member is searched among the fields, the properties, and the methods of the test fixture
+ or the specified .
+
+
+ The owning type of the searched member, or null if it is assumed to be the fixture class.
+ The scope of the test.
+ The name of the searched member.
+ Thrown if or are null.
+
+
+
+ Invokes the argument-less member and returns the resulting value.
+
+ The resulting value.
+
+
+
+ Invokes the member with the specified arguments and returns the resulting value.
+
+ The arguments to pass to the member.
+ The resulting value.
+
+
+
+ Invokes the member with the specified arguments and returns the resulting value.
+
+ The arguments to pass to the member.
+ The arguments to pass to the member.
+ The resulting value.
+
+
+
+ The Gallio.Framework.Pattern namespace provides the Pattern Test Framework which
+ can serve as the foundation for building new test frameworks.
+
+
+
+ The Pattern Test Framework is based on the idea of extensible and composable units
+ called patterns ( ). Patterns are usually encoded as .Net attributes
+ and applied to test assemblies, types and members to define tests.
+
+
+ MbUnit is based on the Pattern Test Framework.
+
+
+ If you are implementing a new attribute-based test framework then you may find it
+ beneficial to extend the Pattern Test Framework. Alternately you may implement
+ directly.
+
+
+
+
+
+
+
+ The Gallio.Framework.Utilities namespace provides utilities for framework implementors.
+
+
+
+
+ Generates test commands from a tree of tests.
+
+
+
+
+ Recursively builds a tree of test commands.
+
+ The test model.
+ The filter set for the test model.
+ If true, only the specified tests are included, otherwise children
+ of the selected tests are automatically included.
+ The test context manager.
+ The root test command or null if none of the tests in
+ the subtree including matched the filter.
+ Thrown if ,
+ or is null.
+ Thrown if an invalid test dependency is found.
+
+
+
+ The Gallio.Model.Commands namespace provides an optional abstraction for
+ decomposing a into a tree of s
+ sorted according to test dependencies and order constraints.
+
+
+
+ The types in this namespace are provided as an optional convenience for implementing
+ a .
+
+
+
+
+
+ The Gallio.Model.Contexts namespace provides an optional abstraction for
+ associating a with a thread which can then
+ be used to track the current test and to publish test messages to a
+ .
+
+
+
+ The types in this namespace are provided as an optional convenience for implementing
+ a .
+
+
+
+
+
+ Test environmnent hosting custom actions to be run on AppDomain/Thread set-up and teardown.
+
+
+
+
+ Base implementation of a test environment.
+
+
+
+
+ The test environment configures global behavior related to preparing
+ the test execution environment for running tests and tearing them down.
+
+
+
+
+ Sets up the current test AppDomain.
+
+ Returns an object that when disposed causes the test environment to be torn down, or null if none.
+
+
+
+ Sets up the current test Thread.
+
+ Returns an object that when disposed causes the test environment to be torn down, or null if none.
+
+
+
+
+
+
+
+
+
+ A chain of actions to be run on AppDomain set-up.
+
+
+
+
+ A chain of actions to be run on AppDomain teardown.
+
+
+
+
+ A chain of actions to be run on Thread set-up.
+
+
+
+
+ A chain of actions to be run on Thread teardown.
+
+
+
+
+
+
+
+
+
+
+ A test driver implementation used when no test framework supports a given test file.
+
+
+
+
+ A base test driver that does nothing.
+
+
+
+
+ Provides test framework services for exploring and running tests.
+
+
+
+
+ Gets the test parts represented by a code element.
+
+ The reflection policy.
+ The code element.
+ The test parts, or an empty array if none.
+ Thrown if
+ or is null.
+
+
+
+ Describes tests via reflection over code elements.
+
+ The reflection policy.
+ The list of code elements, usually
+ and objects, that might contain tests to be described.
+ The test exploration options.
+ The message sink to receive test exploration messages.
+ The progress monitor.
+ Thrown if ,
+ , ,
+ or is null.
+
+
+
+ Explores tests in a test package.
+
+ The test isolation context.
+ The test package.
+ The test exploration options.
+ The message sink to receive test exploration messages.
+ The progress monitor.
+ The test report.
+ Thrown if ,
+ , ,
+ or is null.
+
+
+
+ Runs tests from a test package.
+
+ The test isolation context.
+ The test package.
+ The test exploration options.
+ The test execution options.
+ The message sink to receive test exploration and execution messages.
+ The progress monitor.
+ The test report.
+ Thrown if ,
+ , , ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the test parts represented by a code element.
+
+
+
+ The default implementation always returns an empty array. Subclasses may override
+ this method to provide information about code elements that represent tests.
+
+
+ The reflection policy, not null.
+ The code element, not null.
+ The test parts, or an empty array if none.
+
+
+
+ Describes tests via reflection over code elements.
+
+
+
+ The default implementation does nothing. Subclasses may override to enable tests
+ to be described via reflection only. This is required for ReSharper integration.
+
+
+ The reflection policy, not null.
+ The enumeration of code elements, usually
+ and objects, that might contain tests to be described, not null.
+ The test exploration options, not null.
+ The message sink to receive test exploration messages, not null.
+ The progress monitor, not null.
+
+
+
+ Explores tests from a test package.
+
+
+
+ The default implementation does nothing. Subclasses may override to enable tests
+ to be explored. This is required for presenting lists of tests in test runners like Icarus.
+
+
+ The test isolation context, not null.
+ The test package, not null.
+ The test exploration options, not null.
+ The message sink to receive test exploration messages, not null.
+ The progress monitor, not null.
+ The test report.
+
+
+
+ Runs tests from a test package.
+
+
+
+ The default implementation does nothing. Subclasses may override to enable tests
+ to be run. This is required for actually running tests.
+
+
+ The test isolation context, not null.
+ The test package, not null.
+ The test exploration options, not null.
+ The test execution options, not null.
+ The message sink to receive test exploration and execution messages, not null.
+ The progress monitor, not null.
+ The test report.
+
+
+
+ Creates the fallback test driver.
+
+ The test framework options.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the fallback explanation.
+
+
+
+
+ Describes the function of a code element in a test.
+
+
+
+
+ Gets whether the part represents a test case or test container.
+
+
+
+
+ Gets or sets whether the part represents a test case such as a test method.
+
+
+
+
+ Gets or sets whether the part represents a test container such as a test class.
+
+
+
+
+ Gets or sets whether the part represents some contribution to a test
+ such as a setup or teardown method, a test parameter, or a factory.
+
+
+
+
+ Specifies a test frameworks that has been selected by a .
+
+
+
+
+ Creates a test framework selection.
+
+ The selected test framework handle.
+ The test framework options.
+ True if the selection includes the fallback test
+ framework because a test file is not supported by any other registered
+ test framework.
+ Thrown if
+ or is null.
+
+
+
+ Gets the selected test framework handle.
+
+
+
+
+ Gets the test framework options.
+
+
+
+
+ Returns true if the selected test framework is a fallback because no other
+ registered test framework supports the requested test resources.
+
+
+
+
+
+ Provides options that configure a test framework.
+
+
+
+
+ Creates a default set of test framework options.
+
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the options.
+
+ The copy.
+
+
+
+ Gets a read-only collection of configuration properties for the test framework.
+
+
+
+
+ A test framework implementation used when no test framework supports a given test file.
+
+
+
+
+ Abstract base class for test framework implementations.
+
+
+
+
+ The test framework service provides support for enumerating and executing
+ tests that belong to some test framework.
+
+
+
+ A new third party test framework may be supported by defining and registering
+ a suitable implementation of this interface.
+
+
+
+
+
+ Gets the test driver factory for the framework.
+
+
+
+ When multiple test frameworks result the same test driver factory
+ then only one instance of the test driver will be created and it will
+ be shared by those frameworks. Factory identity is based on delegate
+ equality.
+
+
+ The test driver factory.
+
+
+
+
+
+
+ The test framework option key used to explain why the fallback test framework is being used.
+
+
+ The associated value should be a plain test message describing the problem with
+ the test file.
+
+
+
+
+
+
+
+ Specifies how Gallio responds to test files that do not match any frameworks.
+
+
+
+
+
+ Default match: always fallback to the fallback test framework when
+ a file does not satisfy the constraits of any other
+ test framework exactly.
+
+
+
+
+ Approximate match: fallback to the fallback test framework when
+ a file does not satisfy the constraints of any other
+ test framework exactly but appears to be an approximate match
+ for one of them (perhaps differing in version only). Otherwise
+ the file is not considered a test file.
+
+
+
+
+ Strict match: no fallback. If a file does not satisfy the
+ constraints of any framework exactly then it is not considered a test file.
+
+
+
+
+ Sets up console I/O streams.
+
+
+
+
+
+
+
+ A contextual log text writer messages to a named log stream in the log associated
+ with the test execution context that is active at the time each message is written.
+
+
+
+
+ Creates a text writer that writes to the specified execution log stream.
+
+ The execution log stream name.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A contextual log trace listener messages to a named log stream in the log associated
+ with the test execution context that is active at the time each message is written.
+
+
+
+
+ Creates a trace listener that writes to the specified execution log stream.
+
+ The execution log stream name.
+
+
+
+
+
+
+
+
+
+
+
+
+ Default implementation of a test environment manager.
+
+
+
+
+ The test environment manager configures test AppDomains and threads.
+
+
+
+
+ Sets up the current test AppDomain.
+
+ Returns an object that when disposed causes the test environment to be torn down, or null if none.
+
+
+
+ Sets up the current test Thread.
+
+ Returns an object that when disposed causes the test environment to be torn down, or null if none.
+
+
+
+ Creates a test environment manager.
+
+ The environments, not null.
+
+
+
+
+
+
+
+
+
+ The Gallio.Model.Environments namespace provides an optional abstraction for
+ configuring the local test environment during test exploration and execution.
+
+
+
+ The types in this namespace are provided as an optional convenience for implementing
+ a .
+
+
+
+
+
+ Specifies traits for .
+
+
+
+
+ The base class for plugin, service or component traits.
+
+
+
+ Subclasses should include properties with getters and setters for binding
+ configuration values associated with services (aka. traits). They may also
+ include methods and other service-specific functionality based on the traits.
+
+
+ Traits objects are instantiated in the same way as other components. The container
+ injects required dependencies (on services or configuration values) in the constructor
+ and injects optional dependencies into settable properties.
+
+
+
+
+
+ A thread task that uses the to configure
+ the test environment for the thread.
+
+
+
+
+ Creates a task that will execute code within a new locally running thread
+ test thread and a configured test environemnt.
+ When the task terminates successfully, its result will contain the value
+ returned by .
+
+ The name of the task.
+ The function to perform within the thread.
+ The test environment manager, or null to use the default environment manager.
+ Thrown if
+ or is null.
+
+
+
+ Creates a task that will execute code within a new locally running thread
+ test thread and a configured test environemnt.
+ When the task terminates successfully, its result will contain the value null .
+
+ The name of the task.
+ The action to perform within the thread.
+ The test environment manager, or null to use the default environment manager.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+ Sets up trace listeners.
+
+
+
+
+
+
+
+ Logs unhandled exceptions instead of killing the AppDomain.
+
+
+
+
+
+
+
+ Ensures Windows Forms applications can be tested safely.
+
+
+
+ This environment disables
+ because it can cause problems with tests that use Windows Forms and that require COM
+ message pumping. Just because a thread happens to instantiate a Control does
+ not imply that it should always be enlisted into the Windows Forms synchronization context.
+
+
+ Specifically this setting change resolves an obscure hangs that can occur. Creating
+ a will auto-register the WindowsFormsSynchronizationContext. This
+ is fine as long as a message pump is running in the thread. However as is typical with
+ tests, such message pumps are short-lived so soon enough there is no pump.
+ Now when a system event like UserPreferenceChanged occurs, the
+ class will try to synchronize with the registered handler using a WindowsFormsSynchronizationContext
+ but there is no pump running. The call hangs indefinitely. What's more, the test
+ runner will not be able to unload the AppDomain because it will remain stuck in
+ native code!
+
+
+ As a work-around, we disable auto-installation of the Windows Forms synchronization context.
+
+
+ For more information, see the following:
+ http://ikriv.com/en/prog/info/dotnet/MysteriousHang.html
+ http://www.aaronlerch.com/blog/2008/12/15/debugging-ui/
+
+
+
+
+
+
+
+
+ Gets a test controller for a subtree of tests.
+
+ The test.
+ The test controller or null if there is no specific controller
+ available for the test so the test should be executed using a default rule.
+
+
+
+ A test controller that recursively traverses a hierarchy of test commands and
+ delegates to another test controller based on a .
+
+
+
+
+ A test controller executes tests defined by a tree of s.
+
+
+
+ A test controller may be stateful because it is used for only one test run then disposed.
+
+
+ Subclasses of this class provide the algorithm used to execute the commands.
+
+
+
+
+
+ Disposes the test controller.
+
+
+
+
+ Disposes the test controller.
+
+ True if was called directly.
+
+
+
+ Runs the tests.
+
+
+
+ This method can be called at most once during the lifetime of a test controller.
+
+
+ The root test monitor.
+ The parent test step, or null if starting a root step.
+ The test execution options.
+ The progress monitor.
+ The combined result of the root test command.
+ Thrown if
+ , or is null.
+
+
+
+ Implementation of called after argument validation has taken place.
+
+ The root test command, not null.
+ The parent test step, or null if none.
+ The test execution options, not null.
+ The progress monitor, not null.
+ The combined result of the root test command.
+
+
+
+ Recursively generates single test steps for each and
+ sets the final outcome to .
+
+
+
+ This is useful for implementing fallback behavior when
+ is true.
+
+
+ The root test command.
+ The parent test step.
+ The combined result of the test commands.
+
+
+
+ Creates a recursive test controller.
+
+ The test controller provider which provides
+ the test controller to which the execution of a subtree of tests should be delegated.
+ Thrown if
+ is null.
+
+
+
+
+
+
+ A test harness implementation based on .
+
+
+
+
+ A test harness configures the test environment during test exploration and execution.
+
+
+
+ A test harness may be stateful because it is used for only one test run then disposed.
+
+
+
+
+
+ Creates the test harness.
+
+
+
+
+ Sets up the test AppDomain.
+
+
+
+ The default implementation returns null. Subclasses should override this method
+ to prepare the AppDomain for testing such as by redirecting the console streams
+ to a logging apparatus.
+
+
+ Returns an object that when disposed causes the changes to be torn down, or null if none.
+
+
+
+ Sets up the test Thread.
+
+
+
+ The default implementation returns null. Subclasses should override this method
+ to configure the Thread properties around the action such as setting the thread
+ synchronization context.
+
+
+ Returns an object that when disposed causes the changes to be torn down, or null if none.
+
+
+
+ Disposes the test harness.
+
+
+
+
+ Disposes the test harness.
+
+ True if was called directly.
+
+
+
+ Creates the test harness.
+
+ The test environment manager.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ A simple test driver explores tests using a
+ and runs them using a .
+
+
+
+ The simple test driver class provides a good foundation for implementing
+ test drivers for most .Net frameworks. All you need to do is override the
+ required methods to provide a to populate a
+ and a to run the
+ . The tests run within an environment configured
+ by the .
+
+
+
+
+
+ A base test driver that is intended to support exploring and executing tests
+ inside .Net assemblies.
+
+
+
+ This test driver is a simple component for building a test driver for .Net based
+ test frameworks that do not require specialized hosting apparatus. It explores and
+ runs each test assembly within a separate isolated task that is configured based on the assembly
+ config file, runtime version and processor requirements. Depending on the isolation context,
+ the test may run in a different AppDomain or a different Process with a code coverage
+ tool, profiler or debugger attached. Regardless, subclasses do not need to concern themselves
+ with these details.
+
+
+ Both the and methods execute on
+ a remote created instance of the test driver within the test host.
+ If the test driver does not have a default constructor then it must implement the
+ method to provide the required constructor
+ arguments for the remote instance.
+
+
+
+
+
+ Explores tests in an assembly.
+
+
+
+ The default implementation does nothing. Subclasses may override to enable tests
+ to be explored. This is required for presenting lists of tests in test runners like Icarus.
+
+
+ This method executes within the test host which is most likely a different AppDomain
+ or Process from the test runner itself.
+
+
+ The test assembly, not null.
+ The test exploration options, not null.
+ The message sink, not null.
+ The progress monitor, not null.
+
+
+
+ Runs tests in an assembly.
+
+
+
+ The default implementation does nothing. Subclasses may override to enable tests
+ to be run. This is required for actually running tests.
+
+
+ This method executes within the test host which is most likely a different AppDomain
+ or Process from the test runner itself.
+
+
+ The test assembly, not null.
+ The test exploration options, not null.
+ The test execution options, not null.
+ The message sink, not null.
+ The progress monitor, not null.
+
+
+
+ Configures the host for a particular assembly.
+
+
+ The default implementation does nothing. Subclasses may override to customize
+ host the test host is configured for a particular assembly.
+
+ The host setup, not null.
+ The test assembly path, not null.
+
+
+
+ Gets arguments used to construct the a remote instance of the test driver.
+
+
+
+ If the test driver does not have a default constructor then it must implement the
+ method to provide the required constructor arguments.
+
+
+ All arguments must be serializable.
+
+
+ The default implementation returns an empty array.
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a host setup for a particular assembly within a test package.
+
+ The test package, not null.
+ The assembly path, not null.
+ The assembly metadata, not null.
+ The host setup setup.
+
+
+
+ Configures the host setup prior to the initialization of the script runtime.
+
+
+
+ The default implementation does nothing. Subclasses may override this method
+ to customize the host setup.
+
+
+ The host setup, not null.
+ The test package, not null.
+ The assembly path, not null.
+ The assembly metadata, not null.
+
+
+
+ An isolated task runs in a .
+
+
+
+ Subclasses must be implemented carefully since they may run in a remote environment
+ separate from the test runner.
+
+
+
+
+
+ Runs the task.
+
+
+
+ Wraps any exception thrown within a .
+
+
+
+
+
+ Runs the task.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a test explorer to describe and explore tests.
+
+ The test explorer.
+
+
+
+ Creates a test controller to run tests.
+
+ The test controller.
+
+
+
+ Creates a test harness to configure the test environment.
+
+
+
+ The default implementation returns a new
+ configured with the registered
+ with the runtime.
+
+
+ The test harness.
+
+
+
+ Creates a test command factory for generating s from
+ a .
+
+
+
+ The default implementation returns a new
+ with a default implementation.
+
+
+ The test command factory.
+
+
+
+ Creates a test context manager for tracking test context and publishing
+ test messages to a message sink.
+
+
+
+ The default implementation returns a new
+ attached to the current
+ and the .
+
+
+ The message sink to which test messages are published.
+ The test command factory.
+
+
+
+ Gets the name of the framework as it should appear in progress messages.
+
+
+
+
+ The Gallio.Model.Helpers namespace provides a suite of optional abstractions
+ to help implement test drivers.
+
+
+
+ The types in this namespace are provided as an optional convenience for implementing
+ a .
+
+
+
+
+
+ An abstract base implementation of a test isolation context.
+
+
+
+
+ A test isolation context is responsible for running test code in an isolated
+ (possibly remote) environment.
+
+
+
+
+ Begins a batch of isolated tasks.
+
+
+
+ The isolation context may optimize the execution of subsequent isolated tasks
+ given that they are all part of the same batch.
+
+
+ The status reporter.
+ Returns an object that when disposed causes the batch to be terminated, or null if none.
+ Thrown if is null.
+
+
+
+ Runs an isolated task within the test isolation context.
+
+
+
+ Since the task may be executed remotely, make sure that all
+ arguments and results are serializable.
+
+
+ The isolated task subclass.
+ The host setup parameters for the isolated task.
+ The status reporter.
+ The task arguments, or null if none. Must be serializable.
+ The task result, or null if none. Must be serializable.
+ Thrown if
+ or is null.
+
+
+
+ Gets or sets whether the test isolation context requires test drivers to try to run test
+ code within the same thread on which the isolated task is executed.
+
+
+
+ A test isolation context may require single-threaded execution because it needs to
+ ensure that tests run within the UI loop of an application or due to other
+ synchornization concerns.
+
+
+
+
+
+ Disposes the test isolation context.
+
+
+
+
+
+
+
+
+
+
+ Runs an isolated task within the test isolation context.
+
+ The isolated task subclass.
+ The host setup parameters for the isolated task, not null.
+ The status reporter, not null.
+ The task arguments, or null if none. Must be serializable.
+ The task result, or null if none. Must be serializable.
+
+
+
+ Begins a batch of isolated tasks.
+
+
+
+ The default implementation does nothing and returns null.
+
+
+ The status reporter, not null.
+ Returns an object that when disposed causes the batch to be terminated, or null if none.
+
+
+
+ Disposes the test isolation context.
+
+ True if was called directly.
+
+
+
+
+
+
+ An abstract base implementation of a test isolation provider.
+
+
+
+
+ A test isolation provider creates instances.
+
+
+
+
+ Creates a test isolation context.
+
+ The test isolation options.
+ The logger.
+ The test isolation context.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ Creates a test isolation context.
+
+ The test isolation options, not null.
+ The logger, not null.
+ The test isolation context.
+
+
+
+ Tells the server that the client has finished processing an isolated task.
+
+
+
+
+ Base class for all message objects.
+
+
+
+ Subclasses of this type should be declared to be both XML-serializable
+ (using and )
+ and binary serializable (using ).
+ They should also override to validate all message
+ properties. Validation is performed before sending and after receiving messages
+ to enforce basic message integrity constraints that are not checked by the serialization
+ protocol itself.
+
+
+ Message types do not need to be declared in advanced. Consequently plugins
+ may defined their own custom message types as long as they have a distinct name.
+
+
+
+
+ This is an example of a message type.
+
+ 10000)
+ throw new ValidationException("Quantity should be between 1 and 10000.");
+ }
+ }
+ ]]>
+
+
+
+
+
+
+ Provides a method that may be called by client code to validate that the content
+ of an object is well-formed.
+
+
+
+
+ Validates the object.
+
+ Thrown if the data is not well-formed.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the unique id of the isolated task.
+
+
+
+
+ Gets or sets the isolated task result.
+
+
+
+
+ Gets or sets the exception data.
+
+
+
+
+ Tells the server that the client is active.
+
+
+
+
+ Tells the client to run an isolated task.
+
+
+
+
+
+
+
+ Gets or sets the unique id of the isolated task.
+
+
+
+
+ Gets or sets the type of isolated task.
+
+
+
+
+ Gets or sets the isolated task arguments.
+
+
+
+
+ Tells the client to shut down.
+
+
+
+
+ The type of exception thrown when test isolation operations fail.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Reports a status update.
+
+
+
+
+ A test isolation provider based on .
+
+
+
+
+ Creates a hosted test isolation provider.
+
+ The host factory.
+ Thrown if
+ is null.
+
+
+
+
+
+
+ A hosted test isolation context created by .
+
+
+
+
+ Creates a hosted test isolation context.
+
+ The host factory.
+ The test isolation options.
+ The logger.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+ Runs an isolated task in a host.
+
+ The isolated task type.
+ The host setup which includes the test isolation option properties copied down, not null.
+ The status reporter, not null.
+ The task arguments.
+ The task result.
+
+
+
+ Gets the host factory.
+
+
+
+
+ Gets the test isolation options.
+
+
+
+
+ Gets the logger.
+
+
+
+
+ Manages the client end of a remote connection that runs isolated tasks provided by the server.
+
+
+
+
+ Creates a test isolation client.
+
+ The IPC port name.
+ The unique id of the client/server pair.
+ Thrown if is null.
+
+
+
+
+
+
+ Disposes the client.
+
+ True if was called directly.
+
+
+
+ Runs isolated tasks until the server shuts down.
+
+
+
+
+ Provides options that control test isolation.
+
+
+
+
+ Creates a default set of options.
+
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the options.
+
+ The copy.
+
+
+
+ Gets a read-only collection of configuration properties for the test isolation context.
+
+
+
+
+ Manages the server end of a remote connection that dispatches isolated tasks to a client.
+
+
+
+
+ Creates a test isolation server.
+
+ The IPC port name.
+ The unique id of the client/server pair.
+ Thrown if is null.
+
+
+
+
+
+
+ Disposes the server.
+
+ True if was called directly.
+
+
+
+ Runs an isolated task on the client.
+
+ The type of isolated task to run.
+ The isolated task arguments.
+ The isolated task result.
+ Thrown if is null.
+
+
+
+ Instructs a client to shutdown nicely.
+
+
+
+ If this method is not called, the client will still eventually shut down when the
+ server is disposed but it may take longer and may result in an error being
+ logged on the client.
+
+
+ The maximum amount of time to wait for the client to receive the shutdown message.
+
+
+
+ Utilities for normalizing test model contents.
+
+
+
+
+ Normalizes a test, step or parameter id.
+
+ The id, or null if none.
+ The normalized id, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a test, step or parameter name.
+
+ The name, or null if none.
+ The normalized name, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a lifecycle phase.
+
+ The lifecycle phase, or null if none.
+ The normalized lifecycle phase, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a metadata key.
+
+ The metadata key, or null if none.
+ The normalized metadata key, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a metadata value.
+
+ The metadata value, or null if none.
+ The normalized metadata value, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes the message or details of an annotation.
+
+ The text, or null if none.
+ The normalized text, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a log message.
+
+ The text, or null if none.
+ The normalized text, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Normalizes a metadata collection.
+
+ The metadata collection, or null if none.
+ The normalized metadata collection, or null if none. May be the same instance if
+ was already normalized.
+
+
+
+ Provides functions for converting a into a sequence of
+ messages and back.
+
+
+
+
+ Publishes the contents of the test model to a message sink as test
+ and annotation discovered messages.
+
+ The test model to publish.
+ The message sink.
+ Thrown if
+ or is null.
+
+
+
+ Creates a message sink that populates the test model as test and annotation
+ discovered messages are published.
+
+ The test model to populate.
+ The message sink.
+ Thrown if is null.
+
+
+
+ A factory for test drivers.
+
+ The component handles of frameworks which share this test driver factory, not null.
+ The test framework options, not null.
+ The logger for the test driver, not null.
+
+
+
+ Describes characteristics of a test.
+
+
+
+
+ Gets the test id.
+
+
+
+
+ Gets the test name.
+
+
+
+
+ Gets the code element associated with the test, or null if none.
+
+
+
+
+ Gets the test metadata.
+
+
+
+
+
+ Default implementation of .
+
+
+
+
+ Describes a test kind.
+
+
+
+ The test kind is ignored by the test runner but it allows tests to be classified
+ so that a user interface can provide appropriate decorations and other affordances
+ for any test kinds that it recognizes.
+
+
+ The test kind is associated with a test by setting the test's
+ metadata to the id of the test kind component.
+
+
+
+
+
+ Default implementation of a .
+
+
+
+
+ Manages the list of test kinds.
+
+
+
+
+ Gets handles for all registered test kinds.
+
+
+
+
+ Creates a test kind manager.
+
+ The test kind handles.
+ Thrown if is null.
+
+
+
+
+
+
+ The Gallio.Model.Filters namespace provides a syntax for filtering tests based
+ on their properties.
+
+
+
+
+ Notifies that an annotation has been discovered by the test exploration process.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the annotation, not null.
+
+
+
+
+ Notifies that a test has been discovered by the test exploration process.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the parent test, or null if the test is the root.
+
+
+
+
+ Gets or sets information about the test that was discovered, not null.
+
+
+
+
+ Notifies that a block started with Begin* has finished within a test step log stream.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the stream name, not null.
+
+
+
+
+ Notifies that a marker block has been started within a test step log stream.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the stream name, not null.
+
+
+
+
+ Gets or sets the marker.
+
+
+
+
+ Notifies that a section block has been started within a test step log stream.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the stream name, not null.
+
+
+
+
+ Gets or sets the section name, not null.
+
+
+
+
+ Notifies that an attachment has been embedded into a test step log stream.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the stream name, not null.
+
+
+
+
+ Gets or sets the attachment name, not null.
+
+
+
+
+ Notifies that text has been written to a test step log stream.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the stream name, not null.
+
+
+
+
+ Gets or sets the text, not null.
+
+
+
+
+ Notifies that an attachment has been added to a test step log.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the attachment, not null.
+
+
+
+
+ Notifies that a test step has finished execution.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the test result, not null.
+
+
+
+
+ Notifies that a test step has dynamically added metadata to itself.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the metadata key, not null.
+
+
+
+
+
+ Gets or sets the metadata value, not null.
+
+
+
+
+ Notifies that a test step has changed lifecycle phase.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the id of the test step, not null.
+
+
+
+
+ Gets or sets the lifecycle phase name, not null.
+
+
+
+
+
+ Notifies that a test step has started execution and provides its definition.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets information about the test step that is about to start, not null.
+
+
+
+
+ Gets or sets the code element associated with the test step, or null if none.
+
+
+
+
+ The Gallio.Model.Messages namespace contains the messaging infrastructure for
+ test exploration and execution.
+
+
+
+
+ The Gallio.Model namespace contains types that describe the test object model.
+
+
+
+
+ The Gallio.Model.Schema namespace contains serializable types that
+ are used to describe tests for communication and persistence.
+
+
+
+
+ Provides options for selecting test frameworks.
+
+
+
+
+ Creates a test framework filter initialized to defaults.
+
+
+
+
+ Gets or sets a filter predicate for selecting test frameworks to include, or null if all
+ frameworks should be considered.
+
+
+ The predicate. Default is null .
+
+
+
+
+ Gets or sets the fallback mode used to specify when the
+ should be used if a test file is not supported by any other test framework.
+
+
+ The fallback mode. Default is .
+
+
+
+
+ Gets or sets the test framework options.
+
+ Thrown if is null.
+
+
+
+ Specifies traits for .
+
+
+
+
+ Creates test kind traits.
+
+ The test kind name.
+ The test kind description.
+ Thrown if
+ or is null.
+
+
+
+ Gets the name of the test kind.
+
+
+
+
+ Gets the description of the test kind.
+
+
+
+
+ Gets or sets the icon for the test kind, or null if none.
+
+
+
+ The icon should be available in a 16x16 size.
+
+
+
+
+
+ Describes a test package in a portable manner for serialization.
+
+
+
+
+
+ Creates an empty test package.
+
+
+
+
+ Copies the contents of a test package.
+
+ The source test package.
+ Thrown if is null.
+
+
+
+ Initializes a test package with the contents of this structure.
+
+ The test package to populate.
+ Thrown if is null.
+
+
+
+ Creates a test package with the contents of this structure.
+
+ The test package.
+
+
+
+ Makes the test package paths relative to the specified base path.
+
+ The base path.
+ Thrown if is null.
+
+
+
+ Makes the test package paths absolute given the specified base path.
+
+ The base path.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the list of relative or absolute paths of test files.
+
+
+
+
+
+ Gets the list of hint directories used to resolve test assemblies and other files.
+
+
+
+
+
+ Gets the list of test framework IDs that are to be excluded from the test
+ exploration process.
+
+
+
+
+
+ Gets or sets whether assembly shadow copying is enabled.
+
+
+
+
+
+ Gets or sets whether to attach the debugger to the host.
+
+
+
+
+
+ Gets or sets the application base directory, or null to use the directory
+ containing each group of test files or some other suitable default chosen by the test framework.
+
+
+
+
+
+ Gets or sets the working directory, or null to use the directory containing
+ each group of test files or some other suitable default chosen by the test framework.
+
+
+
+
+
+ Gets or sets the .Net runtime version, or null to auto-detect.
+
+
+
+
+
+ Gets or sets the properties for the test runner. (non-null)
+
+ Thrown if is null.
+
+
+
+
+ The Gallio.Model.Isolation namespace provides a means for running test
+ code within an isolated environment.
+
+
+
+
+ Arguments for an event raised to indicate that test execution has started.
+
+
+
+
+ Base arguments for events raised to indicate the beginning of an operation.
+
+
+
+
+ Initializes the event arguments.
+
+
+
+
+ Initializes the event arguments.
+
+ The test package.
+ The test exploration options.
+ The test execution options.
+ The report lock-box which may be used to access the report asynchronously during execution.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets the test package.
+
+
+
+
+ Gets the test exploration options.
+
+
+
+
+ Gets the test execution options.
+
+
+
+
+ Gets the report lock-box which may be used to access the report asynchronously during execution.
+
+
+
+
+ The Gallio.Runner.Events namespace contains event types that are used by the test runner.
+
+
+
+
+ Abstract base class for report containers that are used to load or save the contents of a report.
+
+
+
+
+ A report container that is used to load or save the contents of a report.
+
+
+
+ A report container consists of zero or more logical report files distinguished by extension and
+ a content folder. The content folder holds attachment contents and format-specific resources.
+
+
+ The definition of a report container is necessarily somewhat abstract. It is intended
+ to allow the files associated with report rendered in multiple formats to coexist
+ side by side unambiguously and without duplication of common attachment contents.
+
+
+ Paths within reports are always specified relative to the root of the container
+ with each path segment delimited by backslashes. The first path segment must be
+ , optionally with an extra period-delimited extension.
+ For example, if is "Report" then "Report.xml" and
+ "Report/Contents.txt" are valid paths but "Bar" and
+ "Report-NotAnExtension" are not.
+
+
+ By convention report content such as attachments and images are
+ stored in a folder with the same name as .
+
+
+
+
+ This example demonstrates the structure of report files with the report name of
+ "MyReport" .
+
+ "MyReport.html" : A report file.
+ "MyReport.txt" : Another report file in a different format.
+ "MyReport\" : The standard report content directory by convention.
+ "MyReport\Step123\AttachedLog.txt" : An execution log attachment.
+ "MyReport\img\TestIcon.png" : An image used in the report.
+ "MyReport\img\FixtureIcon.png" : Another image used in the report.
+ "MyReport\img\Screenshot.jpg" : An execution log attachment.
+
+
+
+
+
+
+ Deletes the entire contents of the report in all of its formats.
+
+ Thrown if an I/O error occurs.
+
+
+
+ Opens a report file for reading.
+
+ The relative path of the report file within the container.
+ The stream.
+ Thrown if is null.
+ Thrown if an I/O error occurs.
+
+
+
+ Opens a report file for writing, overwriting any previous file with the same name.
+
+
+
+ It is not necessary to create "directories" within the container. They are
+ automatically created when new files are opened for writing within them.
+
+
+ The path of the report file.
+ The content type of the file, or null if not specified.
+ The text encoding of the file, or null if not specified or if the file is binary.
+ The stream.
+ Thrown if is null.
+ Thrown if an I/O error occurs.
+
+
+
+ Replaces invalid characters in a file or directory name with underscores
+ and trims it if it is too long.
+
+ The file or directory name.
+ The encoded file or directory name.
+ Thrown if is null.
+
+
+
+ Gets the base name of the report.
+
+
+
+ Logical files and folders associated with the report all begin with this
+ name and are disambiguated by extension.
+
+
+
+
+
+ Protected constructor.
+
+ The report directory path.
+ The report name.
+ Thrown if or
+ is null.
+ Thrown if is an empty string.
+
+
+
+
+
+
+
+
+
+
+
+
+ Disposes the report container.
+
+
+
+
+
+
+
+ Lightly validates the path to catch common programming errors.
+ This isn't really strong enough for enforcing any real security constraints.
+
+ The path to validate.
+ The resulting validated path.
+
+
+
+
+
+
+ Gets the full-path of the report directory.
+
+
+
+
+ An archive based representation of a report container that uses
+ a compressed file to store report contents.
+
+
+
+
+ Creates a filed archive based representation of a report container.
+
+ The report directory path.
+ The report name.
+ Thrown if or
+ is null.
+ Thrown if is an empty string.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The type of file archive used to enclose a test report.
+
+
+
+
+ Parses the specified value and returns the corresponding value,
+ or the default value if null or an empty string was specified.
+
+ The value of the searched archive.
+ The resulting report archive item.
+ True if the parsing was successful; otherwise false.
+
+
+
+ Parses the specified value and returns the corresponding value,
+ or the default value if null or an empty string was specified.
+
+ The value of the searched archive.
+ The resulting report archive item.
+ Thrown if the specified value does not correspond
+ to an known report archive value,
+
+
+
+ Non-compressed file structure.
+
+
+
+
+ Compressed zip archive.
+
+
+
+
+ Gets the report container type.
+
+
+
+
+ Abstract factory that provides a for reading or saving
+ a report, according to the specified settings.
+
+
+
+
+ Constructs a factory.
+
+ A file system wrapper.
+ The report directory path.
+ The report name.
+ Thrown if any argument is null.
+
+
+
+ Makes a report container for a saving operation.
+
+ Indicates if the report must be packed in a compressed archive.
+ A new instance of report container.
+ Thrown if any argument is null.
+
+
+
+ Makes a report container for a reading operation.
+
+ A new instance of report container.
+
+
+
+ Represents a method that converts an object into an object of another type.
+
+ The object to convert.
+ The result of the conversion.
+
+
+
+ Represents a strongly-typed method that converts an object into an object of another type.
+
+ The type of the object to convert.
+ The type of the result of the conversion,
+ The object to convert.
+ The result of the conversion.
+
+
+
+ Converts a text representation of a to its corresponding value.
+
+
+
+
+ A conversion rule encapsulates an algorithm for converting a value from a source
+ type to a target type.
+
+
+
+ This type is not intended to be used directly by clients. Instead refer to
+ for a simpler abstraction that wraps .
+
+
+
+
+
+ Gets the cost of converting a value of type
+ to type .
+
+ The source type, never null.
+ The target type, never null.
+ A converter that may be used to recursively
+ convert the contents of a composite object from one type to another, never null.
+ The conversion cost.
+
+
+
+ Converts the value to type .
+
+
+
+ This method must not be called if returned
+ when asked about the type and .
+ It must also not be called if is null or
+ if it is already an instance of .
+
+
+ The value to convert, never null.
+ The target type, never null.
+ A converter that may be used to recursively
+ convert the contents of a composite object from one type to another, never null.
+
+ The converted value.
+
+
+
+
+
+
+
+
+
+ Conversion rule for custom user conversions.
+
+
+
+
+ Constructs a custom conversion rule.
+
+ The conversion operation.
+
+
+
+
+
+
+
+
+
+ Extensibility point for object conversion managed by .
+
+
+
+ Use the methods and to add and remove
+ custom type converters.
+
+
+
+ The following example registers a custom converter that converts an value to a Foo object.
+ (x => new Foo(x));
+ ]]>
+
+
+
+
+ Registers a custom converter that transforms an object of the source type into an object of the target type.
+
+ The type of the object to convert.
+ The type of the result of the conversion.
+ A delegate that performs the conversion.
+ Thrown if , or is null.
+ Thrown if a custom converter for the specified types was already registered.
+
+
+
+ Registers a strongly-tped custom converter for the specified types.
+
+ The type of the object to convert.
+ The type of the result of the conversion.
+ A delegate that performs the conversion.
+ Thrown if is null.
+ Thrown if a custom converter for the specified types was already registered.
+
+
+
+ Unregisters the custom converter for the specified types.
+
+
+
+ If no custom converter exists for the specified types,
+ the method has no effect and no exception is thrown.
+
+
+ The searched source type.
+ The searched target type.
+ Thrown if or is null.
+
+
+
+ Unregisters the custom converter for the specified types.
+
+
+
+ If no custom converter exists for the specified types,
+ the method has no effect and no exception is thrown.
+
+
+ The searched source type.
+ The searched target type.
+
+
+
+ Entry point for the registration of custom actions that extends the framework.
+
+
+
+
+ Extensibility point for object conversion managed by .
+
+
+
+
+ Extensibility point for object formatting managed by .
+
+
+
+
+ Extensibility point for object equality managed by .
+
+
+
+
+ Extensibility point for object comparison managed by .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Represents a method that displays an object in a readable textual form.
+
+ The object to format.
+ The readable textual representation.
+
+
+
+ Represents a strongly-typed method that displays an object in a readable textual form.
+
+ The type of the object to format.
+ The object to format.
+ The readable textual representation.
+
+
+
+ Formatting rule for custom user formatters.
+
+
+
+
+ A formatting rule encapsulates an algorithm for formatting values of particular
+ types to strings for presentation.
+
+
+
+ This type is not intended to be used directly by clients. Instead refer to
+ for a simpler abstraction that wraps .
+
+
+
+
+
+ Gets the formatting rule's priority for object of the specified type.
+
+
+
+ Rules with higher priority values take precedence over rules with lower priority values.
+
+
+ The type of object, never null.
+ The priority of this rule, or null if the rule does not support formatting the specified object type.
+ for priority suggestions.
+
+
+
+ Formats the specified object.
+
+
+
+ Exceptions thrown by this method will not be reported to clients.
+ Instead the formatter will substitute an appropriate placeholder string instead.
+
+
+ The object to format, never null.
+ The formatter to use for recursive formatting, never null.
+ The formatted string representation of the object or null if the object
+ could not be formatted to produce a non-empty string.
+
+
+
+ Constructs a custom conversion rule.
+
+ The formatting operation.
+
+
+
+
+
+
+
+
+
+ Extensibility point for object formatting managed by .
+
+
+
+ Use the methods and to add and remove
+ custom type formatters.
+
+
+
+ The following example registers a custom formatter for a Foo object.
+ (x => String.Format("Foo = {0}", x.Value));
+ ]]>
+
+
+
+
+ Registers a custom formatter that represents an object in a readable text format.
+
+ The type of the object to format.
+ A delegate that performs the formatting operation.
+ Thrown if or is null.
+ Thrown if a custom formatter for the specified type was already registered.
+
+
+
+ Registers a strongly-tped custom formatter for the specified types.
+
+ The type of the object to format.
+ A delegate that performs the formatting operation.
+ Thrown if is null.
+ Thrown if a custom formatter for the specified type was already registered.
+
+
+
+ Unregisters the custom formatter for the specified type.
+
+
+
+ If no custom formatter exists for the specified type,
+ the method has no effect and no exception is thrown.
+
+
+ The searched type.
+ Thrown if is null.
+
+
+
+ Unregisters the custom formatter for the specified type.
+
+
+
+ If no custom converter exists for the specified types,
+ the method has no effect and no exception is thrown.
+
+
+ The searched type.
+
+
+
+ A condition context that is used to enable or disable plugins,
+ components and services based on characteristics of the runtime environment.
+
+
+ This condition context recognizes the following property tokens:
+
+ - "${env:ENVIRONMENTVARIABLE}": Satisfied when the environment contains
+ a variable called "ENVIRONMENTVARIABLE".
+ - "${minFramework:NET20}", "${minFramework:NET30}", "${minFramework:NET35}", "${minFramework:NET40}":
+ Satisfied when the currently running .Net runtime version is at least the specified version.
+ - "${process:PROC.EXE}", "${process:PROC.EXE_V1}", "${process:PROC.EXE_V1.2}",
+ "${process:PROC.EXE_V1.2.3}", "${process:PROC.EXE_V1.2.3.4}": Satisfied when the currently
+ running process main module is "PROC.EXE" and exactly matches the specified file version
+ components (if any).
+
+
+
+
+
+
+
+
+ Creates instances of .
+
+
+
+
+ Creates the extension.
+
+ The extension to create.
+
+
+
+ Manages the set of available test runner extensions.
+
+
+
+
+ Registers auto-activated extensions with the test runner.
+
+ The test runner.
+ Thrown if is null.
+
+
+
+ The Gallio.Runner.Extensions namespace provides a lightweight test runner
+ extension mechanism whereby custom extension types can be registered with
+ the test runner to intercept events and generate diagnostic output.
+
+
+
+
+ Provides traits for .
+
+
+
+
+ Gets or sets a condition (using the syntax of that
+ governs whether the extension provided by the factory should be automatically
+ installed on every run.
+
+
+
+ The condition may contain references to properties of the form ${env:VariableName}
+ which test whether a given environment variable has been defined.
+
+
+
+
+
+ Default implementation of
+
+
+
+
+ Creates a test runner extension manager.
+
+ The factory handles, not null.
+ The runtime, not null.
+
+
+
+
+
+
+ The Gallio.Runner namespace provides the test runner infrastructure.
+
+
+
+
+ Default implementation of a test project manager.
+
+
+
+
+ Provides services for loading and saving test projects.
+
+
+
+
+ Creates a new project.
+
+ The location of the project to be created.
+ The loaded test project.
+ Thrown if the project name is null or empty.
+
+
+
+ Loads a saved test project.
+
+ The test project file to load.
+ The loaded test project.
+ Thrown if is null.
+ Thrown if the test project cannot be loaded.
+ Thrown if the test project is malformed.
+
+
+
+ Saves a test project.
+
+ The test project.
+ The test project file to save.
+ Thrown if or
+ is null.
+ Thrown if the test project cannot be saved.
+ Thrown if the test project is malformed.
+
+
+
+ Constructor.
+
+ The file system.
+ The Xml serializer.
+
+
+
+
+
+
+
+
+
+
+
+
+ The Gallio.Runner.Projects.Schema namespace contains the project Xml schema.
+
+
+
+
+ The Gallio.Runner.Projects namespace contains types for managing Gallio project files.
+
+
+
+
+ A test project consists of a test package with a list of test files, a list
+ of test extensions, and report options.
+
+
+
+
+ The default report name format.
+
+ "test-report-{0}-{1}"
+
+
+
+ The default report directory relative path.
+
+ "Reports"
+
+
+
+ The default test runner factory name.
+
+
+
+
+
+ The file extension for Gallio project files.
+
+ ".gallio"
+
+
+
+ Creates an empty test project.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Clears the list of test filters.
+
+
+
+
+ Adds a test filter if not already added.
+
+ The filter to add.
+ Thrown if is null.
+
+
+
+ Removes a test filter.
+
+ The filter to remove.
+ Thrown if is null.
+
+
+
+ Clears the list of test runner extensions.
+
+
+
+
+ Adds a test runner extension if not already added.
+
+ The test runner extension to add.
+ Thrown if is null.
+
+
+
+ Removes a test runner extension.
+
+ The test runner extension to remove.
+ Thrown if is null.
+
+
+
+ Clears the list of test runner extension specifications.
+
+
+
+
+ Adds a test runner extension specification if not already added.
+
+ The test runner extension specification to add.
+ Thrown if is null.
+
+ for an explanation of the specification syntax.
+
+
+
+ Removes a test runner extension specification.
+
+ The test runner extension specification to remove.
+ Thrown if is null.
+
+ for an explanation of the specification syntax.
+
+
+
+ Creates a copy of the test project.
+
+ The new copy.
+
+
+
+ Applies the settings of another test project as an overlay on top of this one.
+
+
+
+ Overrides scalar settings (such as ) with those of
+ the overlay when they are specified (such as when is true).
+ Merges aggregate settings (such as lists of files).
+
+
+ The test project to overlay on top of this one.
+ Thrown if is null.
+
+
+
+ Gets or sets the test package.
+
+ Thrown if is null.
+
+
+
+ Gets a read-only list of test filters.
+
+
+
+
+ Gets a read-only list of test runner extensions.
+
+
+
+
+ Gets a read-only list of test runner extension specifications.
+
+
+ for an explanation of the specification syntax.
+
+
+
+ Gets or sets the name of a to use for constructing
+ the at test execution time.
+
+
+
+ The default value is .
+
+
+ Thrown if is null.
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ Gets or sets the folder to save generated reports to.
+
+
+
+ Relative to project location, if not absolute.
+
+
+ Thrown if is null.
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ The format for the filename of generated reports.
+
+
+
+ Within the format string, {0} is replaced by the date and {1} by the time.
+
+
+ The default value is "test-report-{0}-{1}" .
+
+
+ Thrown if is null.
+
+
+
+ Gets or sets a value indicating whether the resulting reports must be enclosed
+ in a compressed archive file (zip).
+
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ The Gallio.Runner.Reports namespace contains types for reading, writing and
+ formatting test reports.
+
+
+
+
+ The Gallio.Runner.Reports.Schema namespace contains the report Xml schema.
+
+
+
+
+ The Gallio.Runtime.ConsoleSupport namespace contains a command-line argument
+ parsing Api and a rich console abstraction.
+
+
+
+
+ The Gallio.Runtime.Conversions namespace contains types for converting
+ values from one type to another based on extensible conversion rules.
+
+
+
+
+ The Gallio.Runtime.Debugging namespace contains types for interacting with the debugger.
+
+
+
+
+ Describes characteristics used to match an assembly such as an assembly name and version range.
+
+
+
+
+ Creates an assembly signature.
+
+ The simple name of the assembly.
+ Thrown if is null.
+
+
+
+ Sets the assembly version to match.
+
+ The version to match, or null if none.
+
+
+
+ Sets the assembly version range to match.
+
+
+
+ and must
+ either both be non-null or both be null.
+
+
+ The minimum assembly version to match inclusively, or null if there is no lower bound.
+ The maximum assembly version to match inclusively, or null if there is no upper bound.
+ Thrown if is null but
+ not or vice-versa. Also thrown if
+ is greater than .
+
+
+
+ Returns true if the signature matches the specified assembly name.
+
+
+
+ When the assembly name is a partial name that omits version information, the version
+ criteria of the signature are ignored.
+
+
+ The assembly name.
+ True if the signature matches the assembly name.
+ Thrown if is null.
+
+
+
+ Parses the assembly signature from a string.
+
+
+
+ The string takes the form of following forms:
+
+ - "AssemblyName"
+ - "AssemblyName, Version=1.2.0.0"
+ - "AssemblyName, Version=1.2.0.0-1.3.65535.65535"
+
+
+
+ The string to parse.
+ The parsed signature.
+ Thrown if is null.
+ Thrown if is malformed.
+
+
+
+ Converts the signature to a string.
+
+ The signature in a format that can be subsequently parsed by .
+
+
+
+
+ Gets the simple name of the assembly.
+
+
+
+
+ Gets the minimum assembly version to match inclusively, or null if there is no lower bound.
+
+
+
+
+ Gets the maximum assembly version to match inclusively, or null if there is no upper bound.
+
+
+
+
+ Provides options that configure the debugger.
+
+
+
+
+ Creates a default set of debugger options.
+
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the options.
+
+ The copy.
+
+
+
+ Gets a read-only collection of configuration properties for the debugger.
+
+
+
+
+ The Gallio.Runtime.Extensibility namespace contains types for managing a registry
+ of plugins, services and components. The registry functions as a lightweight
+ inversion of control container for Gallio extensions.
+
+
+
+
+ Details of a plugin that has just been loaded.
+
+
+
+
+ Constructor.
+
+ The loaded plugin.
+ The base directory.
+ The plugin file path.
+
+
+
+ The loaded plugin.
+
+
+
+
+ The base directory for the plugin.
+
+
+
+
+ The file path of the plugin.
+
+
+
+
+ The Gallio.Runtime.FileTypes namespace contains types for automatically
+ determining the types of files based on extensible file type recognizer rules.
+
+
+
+
+ The Gallio.Runtime.Formatting namespace contains types for formatting
+ values as human-readable strings based on extensible formatting rules.
+
+
+
+
+ The Gallio.Runtime.Hosting namespace contains types for hosting application
+ code in isolated AppDomains and out of process.
+
+
+
+
+ Abstract base class for installers.
+
+
+
+ The base implementation does nothing.
+
+
+
+
+
+ Installs or uninstalls components on the local machine.
+
+
+
+ An installer enables plugins to register and unregister their components with
+ the operating system as needed. Typically the installers are invoked
+ by the Gallio installation package (ie. the originally downloaded MSI file)
+ but they can also be invoked by the user via the
+ utility command.
+
+
+
+
+
+ Installs components.
+
+ The progress monitor, not null.
+
+
+
+ Uninstalls components.
+
+ The progress monitor, not null.
+
+
+
+
+
+
+
+
+
+ The default installer manager implementation.
+
+
+
+
+ Performs installation tasks and manages the set of registered components.
+
+
+
+
+ Installs components.
+
+ The ids of the specific installers to include, or null to include all.
+ A privilege elevation context, or null if the installer manager should obtain its own when needed.
+ The progress monitor.
+ True on success, false if the user canceled the operation.
+ Thrown if is null.
+
+
+
+ Uninstalls components.
+
+ The ids of the specific installers to include, or null to include all.
+ A privilege elevation context, or null if the installer manager should obtain its own when needed.
+ The progress monitor.
+ True on success, false if the user canceled the operation.
+ Thrown if is null.
+
+
+
+ Creates the installer manager.
+
+ The installer handles, not null.
+ The elevation manager, not null.
+
+
+
+
+
+
+
+
+
+ An elevated command used for installation.
+
+
+
+
+ Abstract base class for implementing elevated commands.
+
+ The argument type for the command, must be serializable.
+ The result type for the command, must be serializable.
+
+
+
+ Represents a command to be executed in an elevated context.
+
+
+
+ The command parameters and results must be serializable because they may be
+ transmitted across processes.
+
+
+
+
+
+ Executes the command.
+
+ The command arguments.
+ The progress monitor, non-null.
+ The command result, must be null or serializable.
+
+
+
+
+
+
+ Executes the command.
+
+ The command arguments.
+ The progress monitor, non-null.
+ The command result, must be null or serializable.
+
+
+
+ The id of this elevated command.
+
+
+
+
+ Initializes the command.
+
+ The installer manager, not null.
+
+
+
+
+
+
+ Arguments for the command.
+
+
+
+
+ Creates the arguments.
+
+ The installer id.
+ The requested installer operation.
+ Thrown if is null.
+
+
+
+ Gets the installer id.
+
+
+
+
+ Gets the requested installer operation.
+
+
+
+
+ Specifies the installer operation.
+
+
+
+
+ Runs the install.
+
+
+
+
+ Runs the uninstall.
+
+
+
+
+ Traits for components.
+
+
+
+
+ Gets or sets whether an installer requires privilege elevation (admin access)
+ to run.
+
+
+
+ On Windows Vista and more recent operating systems, this will result in the
+ appearance of a UAC Shield icon.
+
+
+
+
+
+ The Gallio.Runtime.Installer namespace contains types for installing Gallio components.
+
+
+
+
+ Installs or uninstalls components using the .
+
+
+
+
+ Abstract base class for a utility command.
+
+ The arguments type, may be
+ for commands with no arguments.
+
+
+
+ A utility command is a small command-line tool that can be invoked
+ via the Gallio.Utility.exe program.
+
+
+
+ An example utility command is the VerifyInstallation command which checks
+ that the plugin configuration appears to be consistent.
+
+
+ The utility program provides a minor safety net in case the command throws
+ an exception. Upon catching the exception the program will log it as a fatal
+ error and terminate with a failure exit code. Of course, when a command throws
+ an exception the problem should be interpreted as a programming error.
+
+
+
+
+
+ Executes the command.
+
+ The command execution context, not null.
+ The command exit code, zero for success, non-zero for errors.
+
+
+
+ Gets the type of a class used to provide arguments to the command.
+
+
+
+ The returns type should be decorated with attributes such as
+ and
+ .
+
+
+ The argument class.
+
+
+
+ Validates the command arguments.
+
+ The arguments object, not null.
+ The error reporter, not null.
+ True if the arguments are valid.
+
+
+
+ Executes the command.
+
+ The command execution context, not null.
+ The typed command arguments, not null.
+ The command exit code, zero for success, non-zero for errors.
+
+
+
+ Validates the command arguments.
+
+ The arguments object, not null.
+ The error reporter, not null.
+ True if the arguments are valid.
+
+
+
+ Creates the command.
+
+ The installer manager, not null.
+
+
+
+
+
+
+
+
+
+ The arguments for the command.
+
+
+
+
+ When set to true, installs components.
+
+
+
+
+ When set to true, uninstalls components.
+
+
+
+
+ The ids of installers to include.
+
+
+
+
+ Locates Gallio.Loader.dll.
+
+
+
+
+ Gets the path of the Gallio.Loader assembly (unless it is in the GAC) so that it
+ can be loaded by external code using .
+
+ The path of Gallio.Loader.dll, or null if Gallio.Loader.dll is
+ installed in the GAC.
+ Thrown if the Gallio.Loader assembly is not available.
+
+
+
+ The Gallio.Runtime.Loader namespace contains types for loading the
+ Gallio runtime into applications.
+
+
+
+
+ A buffered log writer is an adapter for that writes
+ long full lines to a .
+
+
+
+
+ Creates a buffered log writer that reports a encoding.
+
+ The logger to which messages are written.
+ The log severity for messages.
+ Thrown if is null.
+
+
+
+ Creates a buffered log writer that reports a particular encoding.
+
+ The logger to which messages are written.
+ The log severity for messages.
+ The encoding to report.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A implementation that logs messages to the specified .
+
+
+
+ This can be used to write log messages to a markup stream.
+
+
+
+
+
+ Base implementation of that performs argument validation
+ and supports convenience methods.
+
+
+
+
+ Provides support for logging messages from system components.
+
+
+
+
+ Logs a message.
+
+ The log message severity.
+ The log message.
+ Thrown if is null.
+
+
+
+ Logs a message with an associated exception.
+
+ The log message severity.
+ The log message.
+ The associated exception, or null if none.
+ Thrown if is null.
+
+
+
+ Logs a message with an associated exception.
+
+ The log message severity.
+ The log message.
+ The associated exception data, or null if none.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Logs a message with an associated exception.
+
+ The log message severity.
+ The log message, not null.
+ The associated exception data, or null if none.
+
+
+
+ Creates a logger for the markup stream writer.
+
+ The markup stream writer.
+ Thrown if is null.
+
+
+
+
+
+
+ Common markup stream names.
+
+
+
+
+ The name of the standard stream for captured messages.
+
+
+
+
+ The name of the standard stream for captured messages.
+
+
+
+
+ The name of the standard stream for captured messages.
+
+
+
+
+ The name of the standard stream for diagnostic and messages.
+
+
+
+
+ The name of the standard stream for reporting warning messages.
+
+
+
+
+ The name of the standard stream for reporting failure messages and exceptions.
+
+
+
+
+ The name of the standard stream for generic log messages.
+
+
+
+ It is preferable to write log messages to this stream in place of the console
+ output and error streams.
+
+
+
+
+
+ Represents a text-encoded attachment.
+
+
+
+
+ Creates an attachment.
+
+ The attachment name, or null to automatically assign one.
+ The content type, not null.
+ The text string, not null.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the text of the attachment, not null.
+
+
+
+
+ Provides helpers for working with assemblies.
+
+
+
+
+ Gets the location of the assembly, or null if it is dynamic.
+
+ The assembly.
+ The assembly location as returned by or
+ null if the assembly is dynamic and does not have a location.
+ Thrown if is null.
+
+
+
+ Gets the local path of the assembly prior to shadow copying.
+ Returns null if the original location of the assembly is not local.
+
+ The assembly.
+ The original non-shadow copied local path of the assembly, or null if none.
+ Thrown if is null.
+
+
+
+ Gets the original local path of the assembly prior to shadow
+ copying, if it is local. Otherwise, returns the shadow-copied
+ assembly location.
+
+ The assembly.
+ The local path of the assembly, preferably its original
+ non-shadow copied location, or null if the assembly is dynamic and does not
+ have a location.
+ Thrown if is null.
+
+
+
+ If the assembly codebase is a local file, returns it as a local
+ path. Otherwise, returns the assembly codebase Uri.
+
+ The assembly.
+ The assembly's path.
+ Thrown if is null.
+
+
+
+ Gets the culture component of an assembly name.
+
+ The assembly name.
+ The culture name.
+ Thrown if is null.
+
+
+
+ Returns true if the stream represents a CLI Assembly in Microsoft PE format.
+
+
+ This function does not close the stream.
+
+ The stream.
+ True if the stream represents an assembly.
+ Thrown if is null.
+
+
+
+ Returns true if the file represents a CLI Assembly in Microsoft PE format.
+
+ The file path.
+ True if the file represents an assembly.
+ Thrown if is null.
+
+
+
+ Gets metadata about CLI Assembly in Microsoft PE format.
+
+ The stream.
+ The optional fields of the structure to populate.
+ The metadata or null if the stream does not represent a CLI assembly.
+ Thrown if is null.
+
+
+
+ Gets the Major and Minor components of the CLI runtime version of a CLI Assembly in Microsoft PE format.
+
+ The file path.
+ The optional fields of the structure to populate.
+ The version, of which only the major and minor components are populated,
+ or null if the stream does not represent a CLI assembly.
+ Thrown if is null.
+
+
+
+ Manipulates attributes described by their metadata.
+
+
+
+
+ Gets the attribute of the specified type, or null if none.
+
+ The attribute type.
+ The code element.
+ If true, includes inherited attributes.
+ The attribute, or null if none.
+ Thrown if the code element
+ has multiple attributes of the specified type.
+
+
+
+ Gets the attributes of the specified type.
+
+ The code element.
+ If true, includes inherited attributes.
+ The attribute type.
+ The attributes.
+
+
+
+ Returns true if the code element has an attribute of the specified type.
+
+ The code element.
+ If true, includes inherited attributes.
+ The attribute type.
+ True if the code element has at least one attribute of the specified type.
+
+
+
+ Gets the attribute of the specified type, or null if none.
+
+ The code element.
+ The attribute type.
+ If true, includes inherited attributes.
+ The attribute, or null if none.
+ Thrown if the code element
+ has multiple attributes of the specified type.
+
+
+
+ Gets the attributes of the specified type.
+
+ The code element.
+ The attribute type.
+ If true, includes inherited attributes.
+ The attributes.
+
+
+
+ Returns true if the code element has an attribute of the specified type.
+
+ The code element.
+ The attribute type.
+ If true, includes inherited attributes.
+ True if the code element has at least one attribute of the specified type.
+
+
+
+ Resolves all the attributes.
+
+
+
+ Omits attributes that cannot be resolved.
+
+
+ The attribute descriptions.
+ The resolved attribute instances.
+
+
+
+ Describes the kind of code element represented by a .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ The element is an .
+
+
+
+
+ Sorts code elements in various ways.
+
+
+
+
+ Sorts members such that those declared by supertypes appear before those
+ declared by subtypes.
+
+ The type of member.
+ The members to sort.
+ The sorted members.
+
+
+
+
+ Specifies the location of a code element as a position within a file.
+
+
+
+ Lines and columns are numbered starting from 1.
+
+
+
+
+
+ Gets an empty code location with a null path and no line or column number information.
+
+
+
+
+ Creates a code location.
+
+ The path or Uri of a resource that contains the code element,
+ such as a source file or assembly, or null if unknown.
+ The line number, or 0 if unknown.
+ The column number, or 0 if unknown.
+ Thrown if or
+ is less than 0.
+ Thrown if is null and
+ is non-zero, or if is 0 and is non-zero.
+
+
+
+ Converts the location to a string of the form "path(line,column)",
+ "path(line)" or "path" depending on which components are available.
+
+ The code location as a string or "(unknown)" if unknown.
+
+
+
+
+
+
+ Compares two code locations for equality.
+
+ The first code location.
+ The second code location.
+ True if the code locations are equal.
+
+
+
+ Compares two code locations for inequality.
+
+ The first code location.
+ The second code location.
+ True if the code references are not equal.
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides the Xml schema for this element.
+
+ The schema set.
+ The schema type of the element.
+
+
+
+ Allows the code location structure to control
+ its own serialization and deserialization.
+
+ The serialization info to populate with data.
+ The destination for this serialization.
+
+
+
+ Gets the path or Uri of a resource that contains the code element, such as
+ a source file or assembly, or null if unknown.
+
+
+
+
+ Gets the line number, or 0 if unknown.
+
+
+
+
+ Gets the column number, or 0 if unknown.
+
+
+
+
+ A code reference is a pointer into the structure of a .Net program for use in
+ describing the location of a certain code construct to the user. It is
+ typically used to identify the point of definition of a test component.
+
+
+
+
+ Gets an empty code reference used to indicate that the actual
+ reference is unknown.
+
+
+
+
+ Creates a code reference from strings.
+
+ The assembly name, or null if none.
+ The namespace name, or null if none.
+ The fully-qualified type name, or null if none.
+ The member name, or null if none.
+ The parameter name, or null if none.
+
+
+
+ Produces a human-readable description of the code reference.
+
+ A description of the code reference.
+
+
+
+ Creates a code reference from a method parameter.
+
+ The parameter.
+ The code reference.
+ Thrown if is null.
+
+
+
+ Creates a code reference from a member.
+
+ The member.
+ The code reference.
+ Thrown if is null.
+
+
+
+ Creates a code reference from a type.
+
+ The type.
+ The code reference.
+ Thrown if is null.
+
+
+
+ Creates a code reference from an namespace name.
+
+ The namespace name.
+ The code reference.
+ Thrown if is null.
+
+
+
+ Creates a code reference from an assembly.
+
+ The assembly.
+ The code reference.
+ Thrown if is null.
+
+
+
+
+
+
+ Compares two code references for equality.
+
+ The first code reference.
+ The second code reference.
+ True if the code references are equal.
+
+
+
+ Compares two code references for inequality.
+
+ The first code reference.
+ The second code reference.
+ True if the code references are not equal.
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides the Xml schema for this element.
+
+ The schema set.
+ The schema type of the element.
+
+
+
+ Gets the kind of code element specified by the code reference.
+
+
+
+
+ Gets the assembly name, or null if none.
+
+
+
+
+ Gets the namespace name, or null if none.
+
+
+
+
+ Gets the fully-qualified type name, or null if none.
+
+
+
+
+ Gets the member name, or null if none.
+
+
+
+
+ Gets the parameter name, or null if none.
+
+
+
+
+ Describes the kind of code element specified by a .
+
+
+
+
+ The code reference is unknown.
+
+
+
+
+ The code reference specifies an assembly.
+
+
+
+
+ The code reference specifies a namespace.
+
+
+
+
+ The code reference specifies a type.
+
+
+
+
+ The code reference specifies a constructor, method, property, field or event.
+
+
+
+
+ The code reference specifies a parameter of a constructor or method.
+
+
+
+
+ Specifies a typed constant value.
+
+
+
+
+ Creates a constant value.
+
+ The constant value type.
+ The constant value.
+ Thrown if is null.
+
+
+
+ Creates a constant value that wraps an existing native value.
+
+ The native value.
+ The constant.
+
+
+
+ Resolves the constant to a native value by replacing type references with actual
+ values, arrays of constants with values of the appropriate type,
+ and enums with values.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise the result may include unresolved types, enums or arrays.
+ The native constant value.
+ Thrown if the target cannot be resolved.
+
+
+
+ Gets the type of the constant.
+
+
+
+ The type may be an array type, an enum type, a primitive type, or the type.
+
+
+
+
+
+ Gets the value of the constant.
+
+
+
+ If is true, then this property contains the native value.
+ Otherwise it is represented differently depending upon its type.
+
+ - If the constant is a primitive value, then the value will be a primitive value such as an
+ integer, string, float or null.
+ - If the constant is an enum, then the value will be a primitive value of the underlying type of the enum.
+ - If the constant is an array, then the value will be an array of
+ objects representing the elements of the array.
+ - If the constant is a type, then the value will be a
.
+
+
+
+
+
+
+ Returns true if the contents of can be interpreted as a native value
+ or false if must be used to resolve the constant to a native value.
+
+
+
+
+ Returns true if the value is an array.
+
+
+
+
+ Returns true if the value is an enum.
+
+
+
+
+ Returns true if the value is a type.
+
+
+
+
+ A placeholder enum type used to express enum values that cannot be resolved because
+ their actual enum type cannot be resolved.
+
+
+
+
+ Sorts an members that all belong to the same type
+ such that the members declared by supertypes appear before those
+ declared by subtypes.
+
+
+ If type A derives from types B and if type C derives from B then given methods
+ A.Foo, A.Bar, B.Foo, C.Quux one possible sorted order will be:
+ B.Foo, C.Quux, A.Bar, A.Foo. The members are not sorted by name or
+ by any other criterion except by relative specificity of the
+ declaring types.
+
+
+
+
+ Gets the singleton instance of the comparer.
+
+
+
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Represents a structural element of some code base.
+
+
+
+ This interface is the base of a hierarchy of abstract reflection objects.
+ Different implementations of these objects may be used to perform
+ reflection over different sources.
+
+
+
+
+
+
+ Gets information about the code element's custom attributes of the specified type.
+
+ The attribute type, or null to return attributes of all types.
+ If true, includes inherited attributes
+ from base types (but not from interfaces, just like does).
+ The code element's attributes.
+
+
+
+ Returns true if the code element has a custom attribute of the specified type.
+
+ The attribute type, or null to search for attributes of all types.
+ If true, includes inherited attributes
+ from base types (but not from interfaces, just like does).
+ True if the code element has at least one attribute of the specified type.
+
+
+
+ Gets the code element's custom attributes of the specified type.
+
+ The attribute type.
+ If true, includes inherited attributes
+ from base types (but not from interfaces, just like does).
+ The attributes.
+
+
+
+ Gets the XML documentation associated with the code element.
+
+ The XML documentation or null if none available.
+
+
+
+ Gets the location of a resource that contains the declaration of this code element, or
+ if not available. The location may refer to the code
+ element's source code or to the location of its compiled assembly.
+
+ The code location.
+
+
+
+ Gets the name of the code element.
+
+
+
+
+ Gets the kind of code element represented by this instance.
+
+
+
+
+ Gets a for this code element.
+
+ The code reference.
+
+
+
+ Gets the of the assembly.
+
+ The assembly name.
+
+
+
+ Gets the names of the assemblies referenced by this assembly.
+
+ The names of the references assemblies.
+
+
+
+ Gets the public types exported by the assembly.
+
+ The exported types.
+
+
+
+ Gets all of the types in an assembly.
+
+ The types.
+
+
+
+ Gets a public type by name, or null if not found.
+
+ The type name.
+ The type.
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the codebase of the assembly as a local path if possible or as a Uri otherwise.
+
+
+
+
+ Gets the full name of the assembly.
+
+
+
+
+ Provides information about the contents of a custom attribute.
+
+
+
+
+ Gets an attribute field value.
+
+ The field name.
+ The value, or a default value of the field's type if the field with the specified name
+ was not initialized by the attribute declaration.
+ Thrown if there is no writable instance field with the specified name.
+
+
+
+ Gets an attribute property value.
+
+ The property name.
+ The value, or a default value of the propery's type if the property with the specified name was not
+ initialized by the attribute declaration.
+ Thrown if there is no writable instance property with the specified name.
+
+
+
+ Gets the attribute as an object.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise the result may include unresolved types, enums or arrays
+ though it still may throw an exception if the attribute class cannot be instantiated.
+ The attribute.
+ Thrown if the attribute could not be resolved.
+
+
+
+ Gets the attribute type.
+
+
+
+
+ Gets the constructor used to create the attribute.
+
+ Thrown if not supported.
+
+
+
+ Gets the initialized attribute constructor argument values.
+
+ Thrown if not supported.
+
+
+
+ Gets the initialized attribute field values.
+
+
+
+
+ Gets the initialized attribute property values.
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Gets the member to its underlying native reflection type.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The underlying native reflection type.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the declaring type of the member.
+
+
+
+ If the member not a type or is a nested type,
+ returns its containing type. If it is a generic parameter, returns the type
+ to which it (or its declaring method) belongs. Otherwise returns null.
+
+
+
+
+
+
+
+ Gets the reflected type of the member. The reflected type is the type that was
+ used to locate the member. If the member was inherited from a base class, its
+ declaring type will be the base class but its reflected type will be the inherited
+ class from which the member was accessed.
+
+
+
+ If the member not a type or is a nested type, returns its reflected containing type.
+ If it is a generic parameter, returns the declaring type to which it (or its
+ declaring method) belongs. Otherwise returns null.
+
+
+
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the method attributes.
+
+
+
+
+ Gets the calling conventions for this method.
+
+
+
+
+ Returns true if the method is abstract.
+
+
+
+
+ Returns true if the method is final.
+
+
+
+
+ Returns true if the method is static.
+
+
+
+
+ Gets a value indicating whether the method is virtual.
+
+
+
+
+ Gets a value indicating whether this method can be called by other classes in the same assembly.
+
+
+
+
+ Gets a value indicating whether access to this method is restricted to members of the class and members of its derived classes.
+
+
+
+
+ Gets a value indicating whether this method can be called by derived classes if they are in the same assembly.
+
+
+
+
+ Gets a value indicating whether this method can be called by derived classes, wherever they are, and by all classes in the same assembly.
+
+
+
+
+ Gets a value indicating whether this member is private.
+
+
+
+
+ Gets a value indicating whether this is a public method.
+
+
+
+
+ Gets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class.
+
+
+
+
+ Gets the parameters of the function.
+
+ The parameters.
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the event attributes.
+
+
+
+
+ Gets the add method of the event, or null if none.
+
+ The add method, or null if none.
+
+
+
+ Gets the raise method of the event, or null if none.
+
+ The raise method, or null if none.
+
+
+
+ Gets the remove method of the event, or null if none.
+
+ The remove method, or null if none.
+
+
+
+ Gets the event handler type.
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ A slot represents a field, property or parameter. It is used to
+ simplify the handling of data binding since all three of these types
+ are similar in that they can hold values of some type.
+
+
+
+
+ Gets the type of value held in the slot.
+
+
+
+
+ Gets the positional index of a method parameter slot, -1 if the
+ slot is a method return parameter, or 0 if the slot is of some other kind.
+
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the field attributes.
+
+
+
+
+ Returns true if the field is a literal set at compile time.
+
+
+
+
+ Returns true if the field is read-only and can only be set from the constructor.
+
+
+
+
+ Returns true if the field is static.
+
+
+
+
+ Gets a value indicating whether this field has Assembly level visibility.
+
+
+
+
+ Gets a value indicating whether this field has Family level visibility.
+
+
+
+
+ Gets a value indicating whether this field has FamilyAndAssembly level visibility.
+
+
+
+
+ Gets a value indicating whether this field has FamilyOrAssembly level visibility.
+
+
+
+
+ Gets a value indicating whether the field is private.
+
+
+
+
+ Gets a value indicating whether the field is public.
+
+
+
+
+ A reflection wrapper for generic parameters.
+ The parameter is presented as if it were a slot the accepted
+ a value of type .
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Gets all constructors of the type that satisfy the binding flags.
+
+ The binding flags.
+ The constructors.
+
+
+
+ Gets a method by name, or null if not found.
+
+ The method name.
+ The binding flags.
+ The method.
+
+
+
+ Gets all methods of the type that satisfy the binding flags.
+
+ The binding flags.
+ The methods.
+
+
+
+ Gets a property by name, or null if not found.
+
+ The property name.
+ The binding flags.
+ The property.
+
+
+
+ Gets all properties of the type that satisfy the binding flags.
+
+ The binding flags.
+ The properties.
+
+
+
+ Gets a field by name, or null if not found.
+
+ The field name.
+ The binding flags.
+ The property.
+
+
+
+ Gets all fields of the type that satisfy the binding flags.
+
+ The binding flags.
+ The fields.
+
+
+
+ Gets a event by name, or null if not found.
+
+ The event name.
+ The binding flags.
+ The event.
+
+
+
+ Gets all events of the type that satisfy the binding flags.
+
+ The binding flags.
+ The events.
+
+
+
+ Gets a nested type by name, or null if not found.
+
+ The nested type name.
+ The binding flags.
+ The nested type.
+
+
+
+ Gets all nested types of the type that satisfy the binding flags.
+
+ The binding flags.
+ The nested types.
+
+
+
+ Returns true if variables of this type can be assigned with values of the specified type.
+
+ The other type, or null if none.
+ True if the other type is not null and this type is assignable from the other type.
+
+
+
+ Returns true if this type is a subclass of the specified type.
+
+ The other type, or null if none.
+ True if the other type is not null, this type is a subclass of the other type,
+ and this type not the same as the other type.
+
+
+
+ Makes an array type of the specified rank.
+
+ The array rank.
+ The array type.
+
+
+
+ Makes a pointer type.
+
+ The pointer type.
+
+
+
+ Makes a reference type.
+
+ The reference type.
+
+
+
+ Makes a generic type instantiation.
+
+ The generic arguments.
+ The generic type instantiation.
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the assembly in which the type is declared.
+
+
+
+
+ Gets the namespace in which the type is declared.
+
+
+
+ If the type does not have a namespace, returns an object whose name is an empty string.
+ This is different from the behavior of which would ordinarily return null.
+
+
+
+
+
+ Gets the name of the namespace in which the type is declared.
+
+
+
+ If the type does not have a namespace, returns an empty string.
+ This is different from the behavior of which would ordinarily return null.
+
+
+
+
+
+ Gets the base type of the type, or null if none.
+
+
+
+
+ Gets the assembly-qualified name of the type, or null if the type is a generic parameter.
+
+
+
+
+ Gets the full name of the type, or null if the type is a generic parameter.
+
+
+
+
+ Gets the type attributes.
+
+
+
+
+ Returns true if the type is abstract and must be overridden.
+
+
+
+
+ Returns true if the type is sealed.
+
+
+
+
+ Returns true if the type is a class.
+
+
+
+
+ Returns true if the type is an interface.
+
+
+
+
+ Returns true if the type represents an enumeration.
+
+
+
+
+ Returns true if the type is a value type.
+
+
+
+
+ Returns true if the type is nested.
+
+
+
+
+ Returns true if the type is nested and is visible only within its own assembly.
+
+
+
+
+ Returns true if the type is nested and visible only to classes that belong to both its own family and its own assembly.
+
+
+
+
+ Returns true if the type is nested and visible only within its own family.
+
+
+
+
+ Returns true if the type is nested and visible only to classes that belong to either its own family or to its own assembly.
+
+
+
+
+ Returns true if the type is nested and declared private.
+
+
+
+
+ Returns true if the type is nested and declared public.
+
+
+
+
+ Returns true if the type is declared public.
+
+
+
+
+ Returns true if the type is not declared public.
+
+
+
+
+ Returns true if the type represents an array.
+
+
+
+
+ Returns true if the type represents a pointer.
+
+
+
+
+ Returns true if the type represents a type that is passed by reference.
+
+
+
+
+ Returns true if the type represents a generic type parameter.
+
+
+
+
+
+ Returns true if the type is a generic type.
+ If so, the list will be non-empty.
+
+
+
+
+ Returns true if the type is a generic type definition.
+
+
+
+
+ Returns true if the type contains unbound generic parameters.
+ If so, the list will contain one
+ or more objects.
+
+
+
+
+ Gets the generic arguments of the type.
+ The list may contain objects when
+ no type has yet been bound to a certain generic parameter slots.
+
+ The generic arguments, or an empty list if there are none.
+
+
+
+ Gets the generic type definition of this type, or null if the type is not generic.
+
+
+
+
+ Gets the rank of the array type.
+
+ Thrown if the type is not an array type.
+
+
+
+ Gets the type's .
+
+
+
+
+ Gets all of the type's interfaces.
+
+ The type's interfaces.
+
+
+
+ Gets the element type of an array, pointer or byref type, or null if none.
+
+
+
+
+ Gets the generic parameter attributes.
+
+
+
+
+ Gets the declaring generic method of a generic method parameter
+ or null for a generic type parameter.
+
+
+
+
+
+ Gets the constraints of the generic parameter.
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Makes a generic method instantiation.
+
+ The generic arguments.
+ The generic method instantiation.
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Returns true if the method is a generic method.
+ If so, the list will be non-empty.
+
+
+
+
+ Returns true if the method is a generic method definition.
+
+
+
+
+ Returns true if the method contains unbound generic parameters.
+ If so, the list will contain one
+ or more objects.
+
+
+
+
+ Gets the generic arguments of the method.
+ The list may contain objects when
+ no type has yet been bound to a certain generic parameter slots.
+
+ The generic arguments.
+
+
+
+ Gets the generic method definition of this method, or null if the method is not generic.
+
+
+
+
+ Gets the method return type.
+
+
+
+
+ Gets the method return parameter object that contains information
+ about the return value and its attributes.
+
+
+
+
+ A base reflection policy implementation that performs argument validation.
+
+
+
+
+ A reflection policy provides access to top-level reflection resources
+ such as assemblies.
+
+
+
+
+ Loads an assembly by name.
+
+ The full or partial assembly name of the assembly to load.
+ The loaded assembly.
+ Thrown if is null.
+ Thrown if the assembly could not be loaded for any reason.
+
+
+
+ Loads an assembly from a file.
+
+ The assembly file path.
+ The loaded assembly.
+ Thrown if is null.
+ Thrown if the assembly could not be loaded for any reason.
+
+
+
+
+
+
+
+
+
+ Loads an assembly.
+
+ The assembly name, not null.
+ The loaded assembly wrapper.
+ Any exception may be thrown if the loading fails.
+
+
+
+ Loads an assembly from a file.
+
+ The assembly file path, not null.
+ The loaded assembly wrapper.
+ Any exception may be thrown if the loading fails.
+
+
+
+ The static reflection policy base class is intended to assist with the implementation
+ of custom reflection policies defined over static metadata.
+
+
+
+ It flattens out the code element hierarchy to ease implementation of new policies.
+ It provides a mechanism for handling generic type substitutions to ensure a consistent and
+ correct implementation of generic type and generic method instantiations.
+
+
+ Reflection policy subclasses should not perform generic type substitutions themselves.
+ The rest of the infrastructure will take care of these details automatically. However
+ and objects
+ should be created with the type substitutions of the declaring type extended with
+ generic type arguments.
+
+
+
+
+
+ Determines if two wrappers represent the same object.
+
+ The first wrapper, not null.
+ The second wrapper, not null.
+ True if both wrapper represent the same object.
+
+
+
+ Gets a hashcode for a wrapper.
+
+ The wrapper, not null.
+ The wrapper's hash code.
+
+
+
+ Gets the custom attributes of an assembly.
+
+ The assembly, not null.
+ The attributes.
+
+
+
+ Gets the name of an assembly.
+
+ The assembly wrapper, not null.
+ The assembly name.
+
+
+
+ Gets the path of an assembly.
+
+ The assembly wrapper, not null.
+ The assembly path.
+
+
+
+ Gets the references of an assembly.
+
+ The assembly wrapper, not null.
+ The assembly references.
+
+
+
+ Gets the public types exported by an assembly.
+
+ The assembly wrapper, not null.
+ The types.
+
+
+
+ Gets all types contained in an assembly.
+
+ The assembly wrapper, not null.
+ The types.
+
+
+
+ Gets the specified named type within an assembly.
+
+ The assembly wrapper, not null.
+ The type name, not null.
+ The type, or null if none.
+
+
+
+ Gets the constructor of an attribute.
+
+ The attribute, not null.
+ The constructor.
+
+
+
+ Gets the constructor arguments of an attribute.
+
+ The attribute, not null.
+ The constructor argument values.
+
+
+
+ Gets the field arguments of an attribute.
+
+ The attribute, not null.
+ The field argument values.
+
+
+
+ Gets the property arguments of an attribute.
+
+ The attribute, not null.
+ The property argument values.
+
+
+
+ Gets the custom attributes of a member.
+
+ The member, not null.
+ The custom attributes.
+
+
+
+ Gets the short name of a member.
+ In the case of a generic type, should exclude the generic parameter count
+ part of the name. eg. "`1"
+
+ The member, not null.
+ The member's name.
+
+
+
+ Gets the source code location of a member.
+
+ The member, not null.
+ The source code location, or if not available.
+
+
+
+ Gets the attributes of an event.
+
+ The event, not null.
+ The event attributes.
+
+
+
+ Gets the add method of an event, or null if none.
+
+ The event, not null.
+ The add method, or null if none.
+
+
+
+ Gets the raise method of an event, or null if none.
+
+ The event, not null.
+ The raise method, or null if none.
+
+
+
+ Gets the remove method of an event, or null if none.
+
+ The event, not null.
+ The remove method, or null if none.
+
+
+
+ Gets the event handler type of an event.
+
+ The event, not null.
+ The event handler type.
+
+
+
+ Gets the attributes of a field.
+
+ The field, not null.
+ The field attributes.
+
+
+
+ Gets the field type.
+
+ The field, not null.
+ The field type.
+
+
+
+ Gets the attributes of a property.
+
+ The property, not null.
+ The property attributes.
+
+
+
+ Gets the property type.
+
+ The property, not null.
+ The property type.
+
+
+
+ Gets the get method of a property, or null if none.
+
+ The property, not null.
+ The get method, or null if none.
+
+
+
+ Gets the set method of a property, or null if none.
+
+ The property, not null.
+ The set method, or null if none.
+
+
+
+ Gets the attributes of a function.
+
+ The function, not null.
+ The function attributes.
+
+
+
+ Gets the calling conventions of a function.
+
+ The function, not null.
+ The function calling conventions.
+
+
+
+ Gets the parameters of a function.
+
+ The function, not null.
+ The parameters.
+
+
+
+ Gets the generic parameters of a method.
+
+ The method, not null.
+ The generic parameters.
+
+
+
+ Gets the return parameter of a method.
+
+ The method, not null.
+ The return parameter.
+
+
+
+ Gets the attributes of a parameter.
+
+ The parameter, not null.
+ The parameter attributes.
+
+
+
+ Gets the custom attributes of a parameter.
+
+ The parameter, not null.
+ The custom attributes.
+
+
+
+ Gets the name of a parameter.
+
+ The parameter, not null.
+ The parameter's name.
+
+
+
+ Gets the parameter's position, or -1 if the parameter is a return value.
+
+ The parameter, not null.
+ The parameter's position.
+
+
+
+ Gets the parameter type.
+
+ The parameter, not null.
+ The parameter type.
+
+
+
+ Gets the attributes of a type.
+
+ The type, not null.
+ The type attributes.
+
+
+
+ Gets the assembly that contains a type.
+
+ The type, not null.
+ The type's assembly.
+
+
+
+ Gets the namespace that contains a type.
+
+ The type, not null.
+ The type's namespace, or an empty string if it has none.
+
+
+
+ Gets the base type of atype.
+
+ The type, not null.
+ The base type.
+
+
+
+ Gets the interfaces directly implemented by a type.
+
+ The type, not null.
+ The type's interfaces.
+
+
+
+ Gets the generic parameters of a type, including all generic parameters
+ of its declaring types if it is nested enumerated from outside in.
+
+ The type, not null.
+ The type's generic parameters.
+
+
+
+ Gets the constructors of a type.
+ Only includes declared methods, not inherited ones.
+
+ The type, not null.
+ The type's constructors.
+
+
+
+ Gets the methods of a type including accessor methods for properties and events.
+ Only includes declared methods, not inherited ones.
+
+ The type, not null.
+ The reflected type, not null.
+ The type's methods.
+
+
+
+ Gets the properties of a type.
+ Only includes declared methods, not inherited ones.
+
+ The type, not null.
+ The reflected type, not null.
+ The type's properties.
+
+
+
+ Gets the fields of a type.
+ Only includes declared methods, not inherited ones.
+
+ The type, not null.
+ The reflected type, not null.
+ The type's fields.
+
+
+
+ Gets the events of a type.
+ Only includes declared methods, not inherited ones.
+
+ The type, not null.
+ The reflected type, not null.
+ The type's events.
+
+
+
+ Gets the nested types of a type.
+ Only includes declared nested types, not inherited ones.
+
+ The type, not null.
+ The type's nested types.
+
+
+
+ Gets the attributes of a generic parameter.
+
+ The generic parameter, not null.
+ The generic parameter attributes.
+
+
+
+ Gets the generic parameter position.
+
+ The generic parameter, not null.
+ The generic parameter position.
+
+
+
+ Gets the generic parameter constraints.
+
+ The generic parameter, not null.
+ The generic parameter constraints.
+
+
+
+ Hack to provide access to the internal structure of Cecil attributes.
+ The standard interface makes it impossible to extract arrays and types.
+
+
+
+
+ Resolves debug symbols via the CorMetaDataDispenser COM class.
+
+
+
+ This code has been adapted from the
+
+ CLR Managed Debugger sample and from
+ Mike Stall's PDB2Xml program sample . Many thanks to you!
+
+
+ We do not use the ISymWrapper implementation of the symbol store interfaces because
+ they throw COMExceptions whenever method metadata is not available. This causes
+ confusion for users because the Visual Studio Debugger Exception Assistant window
+ may pop up dozens of times while loading symbol information.
+
+
+
+
+
+ Creates a COM debug symbol resolver.
+
+ If true, avoids taking a lock on the PDB files but may use more memory or storage.
+
+
+
+
+
+
+
+
+
+ Helpers for working with .
+
+
+
+
+ Creates a new debug symbol resolver appropriate for this platform.
+
+ The debug symbol resolver.
+
+
+
+ Gets the location of a source file that contains the declaration of a type, or
+ unknown if not available.
+
+ The type.
+ The code location, or if unknown.
+ Thrown if is null.
+
+
+
+ Gets the location of a source file that contains the declaration of a method, or
+ unknown if not available.
+
+ The method.
+ The source location, or if unknown.
+ Thrown if is null.
+
+
+
+ Gets the singleton debug symbol resolver used by these utilities.
+
+
+ Because this resolver is a singleton, it's important to remember that it will
+ remain in memory for the lifetime of the process. If you only need to load
+ symbols for a short time and then discard them, use
+ to create a new resolver.
+
+
+
+
+ The default XML documentation resolver reads XML documentation files on
+ demand when available and caches them in memory for subsequent accesses.
+ It takes care of mapping member names to XML documentation conventions
+ when asked to resolve the documentation for a member.
+
+
+
+ All operations are thread-safe.
+
+
+
+
+
+ Resolves members to XML documentation contents.
+
+
+
+
+ Gets the XML documentation for a member in an assembly.
+
+ The assembly path.
+ The XML documentation id of the member.
+ The XML documentation for the member, or null if none available.
+ Thrown if or is null.
+
+
+
+ Creates an XML documentation loader.
+
+
+
+
+
+
+
+ The XML documentation gets pretty-printed with indentation by the compiler.
+ We try to recover the original formatting by stripping out the minimal leading
+ whitespace from each line.
+
+
+
+
+ This extension of is provided to enable the resolution of
+ a type with .
+
+
+
+
+ Resolves the wrapper to its native reflection target within the scope
+ of the specified method.
+
+ The method that is currently in scope, or null if none.
+ This parameter is used when resolving types that are part of the signature
+ of a generic method so that generic method arguments can be handled correctly.
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+ Implementation of a debug symbol resolver for Mono.
+
+
+
+
+ Creates a Mono debug symbol resolver.
+
+
+
+
+
+
+
+
+
+
+ Wrapper to represent a namespace.
+
+
+
+
+ A namespace reflection wrapper identified by its name.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Constructor.
+
+ The name of the namespace.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the member to which the parameter belongs.
+
+
+
+
+ Gets the parameter attributes.
+
+
+
+
+ Gets a value indicating whether this is an input parameter.
+
+
+
+
+ Gets a value indicating whether this parameter is optional.
+
+
+
+
+ Gets a value indicating whether this is an output parameter.
+
+
+
+
+ A reflection wrapper.
+
+
+
+ This wrapper enables reflection-based algorithms to be used against
+ code that may or may not be loaded into the current AppDomain.
+ For example, the target of the wrapper could be an in-memory
+ code model representation.
+
+
+
+
+
+ Resolves the wrapper to its native reflection target.
+
+ If true, throws an exception if the target could
+ not be resolved, otherwise returns a reflection object that represents an
+ unresolved member which may only support a subset of the usual operations.
+ The native reflection target.
+ Thrown if the target cannot be resolved.
+
+
+
+
+ Gets the property attributes.
+
+
+
+
+ Returns true if the property can be read.
+
+
+
+
+ Returns true if the property can be written.
+
+
+
+
+ Gets the get method of the property, or null if none.
+
+ The get method, or null if none.
+
+
+
+ Gets the set method of the property, or null if none.
+
+ The set method, or null if none.
+
+
+
+ Gets the list of index parameters for an indexer property, or
+ an empty array if none.
+
+
+
+
+ Provides helpers for enumerating attributes taking into account
+ the attribute inheritance structure.
+
+
+
+ This class is intended to assist with the implementation of new
+ reflection policies. It should not be used directly by clients of the
+ reflection API.
+
+
+
+
+
+ Creates an attribute instance from an .
+
+
+
+ This method may be used by to construct
+ an attribute instance from its raw description. Client code should
+ call instead of using this method
+ directly.
+
+
+ The attribute description.
+ If true, throws an exception if the target could
+ not be resolved, otherwise the result may include unresolved types, enums or arrays.
+ The attribute instance.
+ Thrown if the attribute could not be resolved.
+
+
+
+ Returns true if the field is assignable as a named attribute parameter.
+
+ The field.
+ True if the field is assignable.
+
+
+
+ Returns true if the property is assignable as a named attribute parameter.
+
+ The property.
+ True if the property is assignable.
+
+
+
+ Provides helpers for manipulating reflection flags enumerations.
+
+
+
+ This class is intended to assist with the implementation of new
+ reflection policies. It should not be used directly by clients of the
+ reflection API.
+
+
+
+
+
+ Adds to the enumeration
+ if is true.
+
+ The flags enumeration to update.
+ The flag to add if is true.
+ The condition to check.
+
+
+
+ Adds to the enumeration
+ if is true.
+
+ The flags enumeration to update.
+ The flag to add if is true.
+ The condition to check.
+
+
+
+ Adds to the enumeration
+ if is true.
+
+ The flags enumeration to update.
+ The flag to add if is true.
+ The condition to check.
+
+
+
+ Adds to the enumeration
+ if is true.
+
+ The flags enumeration to update.
+ The flag to add if is true.
+ The condition to check.
+
+
+
+ Adds to the enumeration
+ if is true.
+
+ The flags enumeration to update.
+ The flag to add if is true.
+ The condition to check.
+
+
+
+ Adds to the enumeration
+ if is true.
+
+ The flags enumeration to update.
+ The flag to add if is true.
+ The condition to check.
+
+
+
+ Adds to the enumeration
+ if is true.
+
+ The flags enumeration to update.
+ The flag to add if is true.
+ The condition to check.
+
+
+
+ Provides helpers for resolving abstract reflection objects to obtain
+ native ones based on the structural properties of the reflected
+ code elements.
+
+
+
+ This class is intended to assist with the implementation of new
+ reflection policies. It should not be used directly by clients of the
+ reflection API.
+
+
+
+
+
+ Resolves a reflected assembly to its native object.
+
+ The reflected assembly.
+ If true, allows the assembly to be resolved
+ by partial name if no match could be found by fullname.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved assembly object that can be detected
+ using .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Resolves a reflected type to its native object.
+
+ The reflected type.
+ The method that is currently in scope, or null if none.
+ This parameter is used when resolving types that are part of the signature
+ of a generic method so that generic method arguments can be handled correctly.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Resolves a reflected field to its native object.
+
+ The reflected type.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Resolves a reflected property to its native object.
+
+ The reflected property.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Resolves a reflected event to its native object.
+
+ The reflected event.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Resolves a reflected constructor to its native object.
+
+ The reflected constructor.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Resolves a reflected method to its native object.
+
+ The reflected method.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Resolves a reflected parameter to its native object.
+
+ The reflected parameter.
+ If true, throws an exception if resolution fails,
+ otherwise returns an unresolved .
+ The resolved .
+ Thrown if
+ is null.
+ Thrown if
+ could not be resolved.
+
+
+
+ Provides helpers for working with types and type codes.
+
+
+
+ This class is intended to assist with the implementation of new
+ reflection policies. It should not be used directly by clients of the
+ reflection API.
+
+
+
+
+
+ Determines the type code of a reflected type based on the
+ type's name.
+
+ The reflected type, or null if none.
+ The type code of the type, or
+ if was null.
+
+
+
+ Gets the default value for a reflected type.
+
+ The reflected type.
+ The default value for the type, such as 0 if
+ the type represents an integer, or null if the type
+ is a reference type or if was null.
+
+
+
+ A array type wrapper.
+
+
+
+
+ A constructed type wrapper.
+
+
+
+
+
+
+
+ A type wrapper that represents a special type
+ that is either constructed from other types or derived from them as with a generic parameter.
+
+
+
+
+
+
+ A type wrapper.
+
+
+
+
+ A member wrapper.
+
+
+
+
+ A code element wrapper.
+
+
+
+
+ A wrapper.
+
+
+
+ A wrapper holds an underlying reflection object. Its behavior is
+ derived from by primitive operations on the defined by the
+ particular implementation that is in use.
+
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+ Compares the policy and handle of this wrapper with those of another
+ using .
+
+ The other wrapper.
+
+
+
+
+
+
+ Gets the reflection policy.
+
+
+
+
+ Gets the underlying reflection object.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets all attributes that appear on this code element, excluding inherited attributes.
+
+ The attribute wrappers.
+
+
+
+ Gets all pseudo custom attributes associated with a member.
+
+
+
+ These attributes do not really exist as custom attributes in the metadata. Rather, they are
+ realizations of other metadata features in attribute form. For example,
+ is represented in the metadata as a
+ flag. Pseudo custom attributes preserve the illusion of these attributes.
+
+
+ The pseudo custom attributes.
+
+
+
+ Gets an enumeration of elements from which this code element inherits.
+
+ The inherited code elements.
+
+
+
+ Appends a list of parameters to a signature.
+
+
+
+
+ Appends a list of generic parameters to a signature.
+
+
+
+
+ Gets the name of a type for use in a ToString signature of an event, field,
+ property, method, or constructor.
+
+
+
+
+ Determines whether a type should be represented by its short name
+ for the purposes of creating a signature.
+
+ The reflected type.
+ True if the type is primitive.
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type, or null if none.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Implementation of
+
+
+
+
+ Gets the type substitution for generic parameters.
+
+
+
+
+
+
+
+
+
+
+ Gets the declaring type, or null if none.
+
+
+
+
+ Gets the reflected type, or null if none.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type, or null if none.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Applies a type substitution and returns the resulting type.
+
+ The substitution.
+ The type after substitution has been performed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Internal implementation of .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the element type, or null if none.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type, or null if none.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The element type.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the suffix to append to the name of the constructed type.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The element type.
+ The array rank.
+ Thrown if or is null.
+ Thrown if is less than 1.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A assembly wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if the internal members of this assembly are visible to the specified assembly.
+
+ The other assembly.
+ True if the other assembly can see internal members of this assembly.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A attribute wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A by-ref type wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The element type.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A constructor wrapper.
+
+
+
+
+ A function wrapper.
+
+
+
+
+ A member wrapper for members that are not types,
+ generic parameters or nested types. These members must be declared by types, so
+ they all share the constraint that the declaring type and reflected type must not be null.
+ In particular, the reflected type may be a subtype of the declaring type in the case
+ of inherited members.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type.
+ The reflected type.
+ Thrown if , ,
+ , or is null.
+
+
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type.
+ The reflected type, or null if none.
+ Thrown if , ,
+ , or is null.
+
+
+
+
+
+
+ Implementation of
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type.
+ Thrown if , ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A declared type wrapper such as a
+ class, struct, enum or interface definition.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type, or null if none.
+ The type substitution for generic parameters.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets an enumeration of all base types.
+
+ The enumeration of base types.
+
+
+
+ Composes the substitution of the type with the specified substitution and returns a new wrapper.
+
+ The substitution.
+ The new wrapper with the composed substitution.
+
+
+
+
+
+
+
+
+
+ The .Net framework handles several built-in types in a special way. Basically,
+ to inheritors, certain 'extern' private methods appear to vanish. We deal
+ with those cases uniformly here. There may yet be others!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the base type, or null if none.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A event wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type.
+ The reflected type.
+ Thrown if , ,
+ , or is null.
+
+
+
+ Gets the events that this one overrides or hides.
+ Only includes overrides that appear on class types, not interfaces.
+
+ If true, only returns overrides.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A field wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type.
+ The reflected type.
+ Thrown if , ,
+ , or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A generic parameter wrapper.
+
+
+
+
+ Creates a wrapper for a generic type parameter.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type, which must be a generic type definition.
+ Thrown if ,
+ or is null.
+
+
+
+ Creates a wrapper for a generic method parameter.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring method, which must be a generic method definition.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the declaring method, or null if the generic parameter belongs to a type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A method wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type.
+ The reflected type.
+ The type substitution for generic parameters.
+ Thrown if , ,
+ or or is null.
+
+
+
+ Gets the methods that this one overrides or hides.
+ Only includes overrides that appear on class types, not interfaces.
+
+ If true, only returns overrides.
+
+
+
+ Returns true if this method hides the specified method.
+
+
+
+ This method assumes that is defined by
+ a base type of this method's declaring type. It determines whether
+ method hiding has taken place based on the method's name and its signature
+ (when IsHideBySig is true).
+
+
+ The other method.
+ True if this method hides the other method.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if this method overrides another.
+
+
+
+
+ A parameter wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The member to which the parameter belongs.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the member to which the parameter belongs.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A pointer type wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The element type.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A property wrapper.
+
+
+
+
+ Creates a wrapper.
+
+ The reflection policy.
+ The underlying reflection object.
+ The declaring type.
+ The reflected type.
+ Thrown if , ,
+ , or is null.
+
+
+
+ Gets the properties that this one overrides or hides.
+ Only includes overrides that appear on class types, not interfaces.
+
+ If true, only returns overrides.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A type substitution specifies how generic parameters are replaced by other types.
+ It is used by implementors of when returning
+ types that may be represented as generic parameters.
+
+
+
+
+ Gets the empty type substitution.
+
+
+
+
+ Applies a type substitution to the specified type.
+
+ The type to substitute.
+ The substituted type.
+ Thrown if is null.
+
+
+
+ Applies a type substitution to the specified generic parameter.
+
+ The generic parameter to substitute.
+ The substituted type.
+ Thrown if is null.
+
+
+
+ Applies a type substitution to the specified list of types.
+
+ The types to substitute.
+ The substituted types.
+ Thrown if is null.
+
+
+
+ Returns a new substitution with the specified generic parameters replaced by their respective generic arguments.
+
+
+
+ The extended type substitution is normalized so that generic parameters that
+ are idempotently replaced with themselves are excluded from the substitution altogether.
+
+
+ The generic parameters.
+ The generic arguments.
+ The resulting substitution.
+ Thrown if or is null
+ or contain nulls.
+ Thrown if does not have the same
+ number of elements as .
+
+
+
+ Returns a new substitution formed by composing this substitution with the specified one.
+ That is to say, each replacement type in this substitution is replaced as described
+ in the specified substitution.
+
+ The substitution to compose.
+ The new substitution.
+
+
+
+ Returns true if this substitution does not contain any of the specified generic parameters.
+
+ The generic parameters.
+ True if none of the generic parameters are in the substitution.
+ Thrown if is null.
+
+
+
+ Compares two static type substitutions for equality.
+
+ The first substitution.
+ The second substitution.
+ True if the substitutions are equal.
+
+
+
+ Compares two static type substitutions for inequality.
+
+ The first substitution.
+ The second substitution.
+ True if the substitutions are equal.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if the type substitution does not contain any replacements.
+
+
+
+
+ Helpers for working with .
+
+
+
+
+ Gets the XML documentation for a member.
+
+ The member.
+ The XML documentation for the member, or null if none available.
+ Thrown if is null.
+
+
+
+ Gets the XML documentation id of a member.
+
+ The member.
+ The XML documentation id of the member.
+ Thrown if is null.
+
+
+
+ Gets the XML documentation resolver.
+
+
+
+
+ This assembly loader loads assemblies externally for reflection only.
+
+
+
+ This implementation ensures that the assembly files do not remain locked on disk and are not
+ cached in memory outside of the scope of the loader. Consequently the Garbage Collector will
+ automatically reclaim the loader and its contents when they become unreferenced.
+
+
+ In contrast, that of the standard .Net reflection-only load context
+ ( ) does not allow assemblies to be reclaimed
+ until the is unloaded.
+
+
+ The loader considers all assemblies in the specified search path as well as any that
+ can be located using the current AppDomain's assembly resolvers.
+
+
+
+
+
+ Creates an assembly loader.
+
+
+
+
+ Adds a hint directory to search for loading assemblies.
+
+ The search directory to add.
+ Thrown if is null.
+
+
+
+ Gets the reflection policy used to load and access the assemblies.
+
+
+
+
+ The type of exception thrown when a reflection info object or reference cannot
+ be resolved.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception for a code element that could not be resolved.
+
+ The code element that could not be resolved.
+ Thrown if is nul.
+
+
+
+ Creates an exception for a code element that could not be resolved.
+
+ The code element that could not be resolved.
+ The inner exception, or null if none.
+ Thrown if is nul.
+
+
+
+ Creates an exception for an attribute that could not be resolved.
+
+ The attribute that could not be resolved.
+ Thrown if is nul.
+
+
+
+ Creates an exception for an attribute that could not be resolved.
+
+ The attribute that could not be resolved.
+ The inner exception, or null if none.
+ Thrown if is nul.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Provides functions for working with reflection.
+
+
+
+
+ Gets the assembly that declares the code element, or the
+ code element itself if it is an .
+
+ The code element, possibly null.
+ The assembly, or null if not found.
+
+
+
+ Gets the namespace that declares the code element, or the
+ code element itself if it is an .
+
+ The code element, possibly null.
+ The namespace, or null if not found.
+
+
+
+ Gets the type that declares the code element, or the
+ code element itself if it is an .
+
+ The code element, possibly null.
+ The type, or null if not found.
+
+
+
+ Gets the non-type member that declares the code element, or the
+ code element itself if it is an
+ other than a .
+
+ The code element, possibly null.
+ The member, or null if not found.
+
+
+
+ Gets the parameter that declares the code element, or the
+ code element itself if it is an .
+
+ The code element, possibly null.
+ The parameter, or null if not found.
+
+
+
+ Finds the assembly name of the directly referenced assembly with the specified display name.
+
+ The assembly to search.
+ The display name of the referenced assembly to find.
+ The referenced assembly name or null if none.
+
+
+
+ Determines if the type can be instantiated using a public constructor.
+
+ The type.
+ True if the type can be instantiated.
+
+
+
+ Determines if the method is public, non-static and is non-abstract so it can be invoked.
+
+ The method.
+ True if the method can be invoked.
+
+
+
+ Determines if the property has public, non-static and non-abstract getter
+ and setter functions.
+
+ The property.
+ True if the property can be get and set.
+
+
+
+ Returns true if a type is derived from another type with the specified qualified name.
+
+ The type to check.
+ The qualified type name.
+ True if is derived from
+
+
+
+ Gets the default value for a type.
+
+ The type.
+ The default value for the type, such as 0 if
+ the type represents an integer, or null if the type
+ is a reference type or if was null.
+
+
+
+ Gets the default value of a type with a given type code.
+
+ The type code.
+ The default value of the type associated with the
+ specified type code.
+
+
+
+ Returns true if the named type is assignable from the specified type.
+
+ The search type.
+ The candidate type.
+ True if the search type is assignable from the candidate type.
+ Thrown if
+ or is null.
+
+
+
+ Workaround for a bug in which causes it ignore
+ the binding flags when searching for events.
+
+
+ https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=522960
+
+
+
+
+ Determines whether the specified type represents a nullable value.
+
+ The type to evaluate.
+ True if it is nullable; otherwise false.
+
+
+
+ Wraps reflection types using the reflection adapter interfaces.
+ Also resolves code references.
+
+
+
+
+ Resolves the specified .
+
+ The code reference.
+ If true, throws an exception on error.
+ The associated code element, or null if the code reference
+ is of kind
+ Thrown if
+ is true and cannot be resolved.
+
+
+
+ Obtains a reflection wrapper for an assembly.
+
+ The assembly, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a namespace.
+
+ The namespace name, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a type.
+
+ The type, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a list of types.
+
+ The types, or null if none.
+ The reflection wrappers, or null original list was null.
+
+
+
+ Obtains a reflection wrapper for a member.
+
+ The member, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a function.
+
+ The function, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a constructor.
+
+ The constructor, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a method.
+
+ The method, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a property.
+
+ The property, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a field.
+
+ The field, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for an event.
+
+ The event, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for a parameter.
+
+ The parameter, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Obtains a reflection wrapper for an attribute instance.
+
+ The attribute, or null if none.
+ The reflection wrapper, or null if none.
+
+
+
+ Creates a code element from the executing function.
+
+
+
+ This information may be unreliable if the compiler has inlined
+ the executing method into its caller because the stack frame
+ information will be incomplete. This can can occur when compiler
+ optimizations are turned on and the method body is simple.
+
+
+ The inlining problem can be circumvented like this:
+
+
+
+ The code reference.
+
+
+
+ Creates a code element from the caller of the executing function.
+
+
+
+ This information may be unreliable if the compiler has inlined
+ the executing or calling method into its caller because the stack frame
+ information will be incomplete. This can can occur when compiler
+ optimizations are turned on and the method body is simple.
+
+
+ The inlining problem can be circumvented like this:
+
+
+
+ The code reference.
+
+
+
+ Creates a code element representing a function from a particular frame on the current stack.
+
+ The number of frames to skip. If this number is 0,
+ the code reference will refer to the direct caller of this method;
+ if it is 1, it will refer to the caller's caller, and so on.
+ The code reference.
+ Thrown if is less than zero.
+
+
+
+ Returns true if the target represents an unresolved assembly with
+ limited support for reflection.
+
+
+ The assembly, or null if none.
+ True if the target is unresolved.
+
+
+
+ Returns true if the target represents an unresolved member with
+ limited support for reflection.
+
+
+ The member, or null if none.
+ True if the target is unresolved.
+
+
+
+ Returns true if the target represents an unresolved parameter with
+ limited support for reflection.
+
+
+ The parameter, or null if none.
+ True if the target is unresolved.
+
+
+
+ Gets the singleton instance of the native
+ based on .Net reflection.
+
+
+
+
+ Describes the name of a type and allows partial type names to be compared with one another.
+
+
+
+
+ Creates a type name from a type.
+
+ The type.
+ Thrown if is null.
+ Thrown if does not have a valid FullName property
+ (for example, it represents a generic type parameter).
+
+
+
+ Creates a type name from type info.
+
+ The type info.
+ Thrown if is null.
+ Thrown if does not have a valid FullName property
+ (for example, it represents a generic type parameter).
+
+
+
+ Creates a type name from its assembly-qualified name.
+
+ The assembly-qualified name of the type, including
+ its namespace and assembly.
+ Thrown if is null.
+ Thrown if is malformed or
+ does not contain a valid assembly name.
+
+
+
+ Creates a type name from its full name and assembly name.
+
+ The full name of the type, including its namespace.
+ The full or partial name of the assembly that contains the type.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Resolves the type named by this instance.
+
+ The type.
+ Thrown if the type could not be resolved.
+
+
+
+ Returns a type name that has a partial assembly name instead of the full assembly name.
+
+ The type name.
+
+
+
+ Gets the assembly-qualified name of the type, including its namespace and assembly.
+
+
+
+
+ Gets the full name of the type, including its namespace.
+
+
+
+
+ Gets the full or partial name of the assembly that contains the type.
+
+
+
+
+ Returns true if the associated is a partial name only.
+
+
+
+
+ Describes the difference between a range of the left document and a range of the right document.
+
+
+
+ Each diff is accompanied by a that indicates whether it represents
+ an identical region or one with changes.
+
+
+
+
+
+ Creates a diff.
+
+ The diff kind which indicates whether there is a change over the range covered by the diff.
+ The range of the left document that is affected.
+ The range of the right document that is affected.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if two diffs are equal.
+
+ The first diff to compare.
+ The second diff to compare.
+ True if the diffs are equal.
+
+
+
+ Returns true if two diffs are not equal.
+
+ The first diff to compare.
+ The second diff to compare.
+ True if the diffs are not equal.
+
+
+
+
+
+
+ Gets the diff kind which indicateds whether there is a change over the range covered by the diff.
+
+
+
+
+ Gets the range of the left document that is affected.
+
+
+
+
+ Gets the range of the right document that is affected.
+
+
+
+
+ Describes whether a difference represents a changed or unchanged region.
+
+
+
+
+ Indicates there is no change between the left and right documents over the ranges described by the diff.
+
+
+
+
+ Indicates there is a change between the left and right documents over the ranges described by the diff.
+ Text may have been added, removed, or edited.
+
+
+
+
+ A diff set consists of a sequence of differences between a left document and a right document
+ that indicate changed and unchanged regions.
+
+
+
+ If the changes are applied in order to the left document, the right document will be
+ reproduced. If the inverse changes are applied in order to the right document, the
+ left document will be reproduced.
+
+
+ This implementation is based on Myers' O((M + N) * D) time and O(M + N) space algorithm
+ for computing the longest common subsequence from his paper
+ "An O(ND) Difference Algorithm and Its Variations."
+ (http://citeseer.ist.psu.edu/myers86ond.html)
+
+
+ There were two other sources for inspiration although this implementation is not
+ a direct port of either of them.
+
+ - The org.eclipse.compare.internal.LCS class in Eclipse (http://www.eclipse.org) from
+ which we borrow the concept of limiting the number of differences to produce an approximate
+ result with a reduced time bound for large data sets. Since the Eclipse implementation
+ of the LCS follows Myers' algorithm pretty closely, it was also very useful as a point
+ of comparison for finding bugs.
+ - Neil Fraser's "Diff Match and Patch" algorithm (http://code.google.com/p/google-diff-match-patch/).
+ We borrow some ideas about semantic cleanup from here.
+
+
+
+
+
+
+ Constructs a diff set.
+
+ The list of differences that indicate the changed and
+ unchanged regions between the left and right documents. The diffs span
+ the entire range of the left and right documents and are listed in document order.
+ The left document.
+ The right document.
+ Thrown if ,
+ or is null.
+ Thrown if does not
+ completely cover the left and right documents or are not listed in the correct order.
+
+
+
+ Gets the set of differences between a left document and a right document.
+
+ The left document.
+ The right document.
+ The set of differences.
+ Thrown if or
+ is null.
+
+
+
+ Writes the diffs using the
+ presentation style and no limits on the context length.
+
+
+
+ For the purposes of determining additions and deletions, the left document
+ is considered the original and the right document is the considered to be the
+ one that was modified. Changes are annotated by markers:
+ by ,
+ and .
+
+
+ The test log stream writer to receive the highlighted document.
+ Thrown if if null.
+
+
+
+ Writes the diffs using the specified
+ presentation style and no limits on the context length.
+
+
+
+ Changes are annotated by markers: ,
+ and .
+
+
+ If the style is then the left document
+ is considered the original and the right document is the considered to be the
+ one that was modified so deletions appear within the left and additions within the right.
+
+
+ If the style is or
+ then only the deletion and changed markers are used.
+
+
+ The test log stream writer to receive the highlighted document.
+ The presentation style.
+ Thrown if if null.
+
+
+
+ Writes the diffs using the specified presentation style and max context length.
+
+
+
+ Changes are annotated by markers: ,
+ and .
+
+
+ If the style is then the left document
+ is considered the original and the right document is the considered to be the
+ one that was modified so deletions appear within the left and additions within the right.
+
+
+ If the style is or
+ then only the deletion and changed markers are used.
+
+
+ The test log stream writer to receive the highlighted document.
+ The presentation style.
+ The maximum number of characters of unchanged regions
+ to display for context, or for no limit. Extraneous context
+ is split in two with an ellipsis inserted in between both halves.
+ Thrown if if null.
+ Thrown if
+ is negative.
+
+
+
+ Simplifies the diff for presentation.
+
+
+
+ This method applies a series of heuristics to make the diff easier to read
+ but perhaps less optimal, including the following:
+
+ - Adjacent diffs of the same kind are combined.
+ - Small unchanged regions sandwiched between larger changed regions are
+ converted to larger changed regions. This improves the case when only
+ a few scattered characters coincidentally match between the two documents.
+
+
+
+ Returns a simplified diff.
+
+
+
+ Gets the list of differences that indicate the changed and
+ unchanged regions between the left and right documents.
+
+
+
+ The diffs span the entire range of the left and right documents and are listed in document order.
+
+
+
+
+
+ Gets the left document.
+
+
+
+
+ Gets the right document.
+
+
+
+
+ Returns true if the list of differences contains changed regions.
+
+
+
+
+ Returns true if the list of differences is empty which can only occur when
+ both document being compared are empty.
+
+
+
+
+ Specifies the presentation style for a .
+
+
+
+
+ Display the left and right document contents and diffs fully interleaved.
+
+
+
+
+ Display only the left document contents.
+
+
+
+
+ Display only the right document contents.
+
+
+
+
+ A range denotes a segment of a string or other indexed data structure.
+
+
+
+
+ Creates a range of indices.
+
+ The starting index of the range.
+ The number of characters within the range, may be 0.
+ Thrown if
+ or is negative.
+
+
+
+ Creates a new range between the start index (inclusively) and end index (exclusively).
+
+ The start index.
+ The end index.
+ The new range.
+ Thrown if
+ is negative or greater than .
+
+
+
+ Gets a substring of the specified text using this range.
+
+ The source text.
+ The substring of the source text that represents this range.
+ Thrown if is null.
+
+
+
+ Extends a range into an adjacent range and returns the combined range.
+
+ The adjacent range.
+ The extended range.
+ Thrown if is not an adjacent range.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if two ranges are equal.
+
+ The first range to compare.
+ The second range to compare.
+ True if the ranges are equal.
+
+
+
+ Returns true if two ranges are not equal.
+
+ The first range to compare.
+ The second range to compare.
+ True if the ranges are not equal.
+
+
+
+
+
+
+ Gets the starting index of the range.
+
+
+
+
+ Gets the ending index of the range, which is the start index plus the length.
+ The ending index is one past the last character within the range.
+
+
+
+
+ Gets the length of the range.
+
+
+
+
+ A substring provides a convenient representation for a range within a larger string.
+
+
+
+
+ Creates a substring object defined over the entire range of a string.
+
+ The string.
+ Thrown if is null.
+
+
+
+ Creates a substring object.
+
+ The string.
+ The range within the string.
+ Thrown if is null.
+ Thrown if is outside the bounds of the string.
+
+
+
+ Returns a substring of the substring.
+
+ The index at which to start.
+ The substring.
+ Thrown if is negative or
+ if is greater than .
+
+
+
+ Returns a substring of the substring.
+
+ The index at which to start.
+ The length of the substring to produce.
+ The substring.
+ Thrown if or
+ are negative or if their sum is greater than .
+
+
+
+ Finds the length of the common prefix of this substring and another one.
+
+ The other substring.
+ The common prefix length, or 0 if the substrings have no prefix in common.
+
+
+
+ Finds the length of the common suffix of this substring and another one.
+
+ The other substring.
+ The common suffix length, or 0 if the substrings have no suffix in common.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if two substrings are equal.
+
+ The first substring to compare.
+ The second substring to compare.
+ True if the substrings are equal.
+
+
+
+ Returns true if two substrings are not equal.
+
+ The first substring to compare.
+ The second substring to compare.
+ True if the substrings are not equal.
+
+
+
+ Returns the whole string.
+
+
+
+
+ Returns the range of the underlying string represented by the substring.
+
+
+
+
+ Gets the length of the substring.
+
+
+
+
+ Gets the character with a particular index.
+
+ The index.
+ The character.
+ Thrown if the index is out of range.
+
+
+
+ The diagnostic log provides services for writing diagnostic messages to the console
+ or runtime log during a test run.
+
+
+
+ Diagnostic messages will appear in the test report but they are not associated with
+ any particular tests. Unlike the messages may not include rich
+ content such as attachments or embedded images.
+
+
+ If you use the diagnostic log to report progress messages, keep in mind that they
+ will all be preserved in the report, making the report larger.
+
+
+
+
+
+
+ Writes a message to the diagnostic log.
+
+ The message to write, may be null.
+
+
+
+ Writes a formatted message to the diagnostic log.
+
+
+ The message format string, may be null.
+ The message arguments.
+
+
+
+ An implementation of a test model builder that is used for reflection only and
+ does not actually support building tests.
+
+
+
+
+ A test model builder applies contributions to a test model under construction.
+
+
+
+
+ Provides support for performing deferred build actions.
+
+
+
+
+ Registers a deferred action to be performed when is called.
+
+
+
+ Typically used to enable decorations to be applied in a particular order.
+
+
+ The associated code element, used to report errors if the deferred action throws an exception.
+ The order in which the action should be applied, from least order to greatest.
+ The action to perform.
+ Thrown if
+ or is null.
+
+
+
+
+ Applies all pending deferred in order and clears the list.
+
+
+
+
+ Adds an annotation to the test model.
+
+ The annotation to add.
+ Thrown if is null.
+
+
+
+ Adds an assembly resolver to the test model's assembly loading policy.
+
+ The resolver to add.
+ Thrown if is null.
+
+
+
+ Publishes an exception as an annotation about a particular code element.
+
+ The code element, or null if none.
+ The exception to publish.
+
+
+
+ Gets the underlying test model.
+
+ The underlying test model.
+
+
+
+ Gets the reflection policy for the model.
+
+
+
+
+ Gets the builder of the root test.
+
+ The builder for the root test.
+
+
+
+ Creates a test model builder.
+
+ The reflection policy.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ A test builder applies contributions to a test under construction.
+
+
+
+
+ A test component builder applies contributions to a test or test parameter under construction.
+
+
+
+
+ Adds a metadata key value pair.
+
+ The metadata key.
+ The value to add.
+ Thrown if or is null.
+
+
+
+
+
+ Gets the underlying test component.
+
+ The underlying test component.
+
+
+
+ Gets the stable unique identifier of the component.
+
+
+
+ The identifier must be unique across all components
+ within a given test project. It should also be stable so that the
+ identifier remains valid across recompilations and code changes that
+ do not alter the underlying declarations (insofar as is possible).
+
+
+ The identifier does not refer to a specific instance of ,
+ but rather incorporates enough information so that we can unambiguously find a
+ corresponding instance in a model that has been populated. When we rebuild
+ the model, assuming the code hasn't changed too much, the objects in the model
+ will have the same identifier as before. This allows the identifier
+ to be saved in project files to construct lists of components. We can also use
+ it to refer to components remotely.
+
+
+
+
+
+ Gets or sets the name of the component.
+
+
+ Thrown if is null.
+
+
+
+ Gets a reference to the point of definition of this test
+ component in the code, or null if unknown.
+
+
+
+
+ Creates a child test and returns its builder.
+
+ The test name.
+ The associated code element, or null if none.
+ The data context builder for the new test.
+ The builder for the child test.
+ Thrown if or is null.
+
+
+
+ Creates a test parameter and returns its builder.
+
+ The test parameter name.
+ The associated code element, or null if none.
+ The data context builder for the new test parameter.
+ The builder for the test parameter.
+ Thrown if or is null.
+
+
+
+ Gets a test parameter builder by name.
+
+ The test parameter name.
+ The builder for the test parameter, or null if none.
+ Thrown if is null.
+
+
+
+ Adds a test dependency.
+
+ The test to add as a dependency.
+ Thrown if is null.
+
+
+
+ Gets the underlying test.
+
+ The underlying test.
+
+
+
+ Gets or sets the value of the
+ metadata entry. (This is a convenience method.)
+
+
+ One of the constants.
+
+
+
+
+ Gets or sets the apartment state to be used to run the test.
+
+
+
+ If the apartment state is
+ the test will inherit the apartment state of its parent. Otherwise
+ it will run in a thread with the specified apartment state.
+
+
+ The test runner guarantees that the root test runs with the
+ apartment state. Consequently the apartment state only needs to be overridden to run
+ a test in some mode that may differ from that which it would ordinarily inherit.
+
+
+
+ The default value of this property is .
+
+
+
+
+ Gets or sets the maximum amount of time the whole test including
+ its setup, teardown and body should be permitted to run.
+
+
+
+ If the test runs any longer than this, it will be aborted by the framework.
+ The timeout may be null to indicate the absence of a timeout.
+
+
+ Thrown if
+ represents a negative time span.
+ The timeout. Default value is null.
+
+
+
+ Gets whether this test represents an individual test case
+ as opposed to a test container such as a fixture or suite.
+
+
+
+ The value of this property can be used by the test harness to avoid processing containers
+ that have no test cases. It can also be used by the reporting infrastructure
+ to constrain output statistics to test cases only.
+
+
+ Not all test cases are leaf nodes in the test tree and vice-versa.
+
+
+ This value is defined as a property rather than as a metadata key because it
+ significantly changes the semantics of test execution.
+
+
+
+
+
+ Gets or sets whether the test is parallelizable.
+
+
+ True if the test is parallelizable. The default value of this property is false .
+
+
+
+
+ Gets or sets a number that defines an ordering for the test with respect to its siblings.
+
+
+
+ Unless compelled otherwise by test dependencies, tests with a lower order number than
+ their siblings will run before those siblings and tests with the same order number
+ as their siblings with run in an arbitrary sequence with respect to those siblings.
+
+
+ Some test frameworks may choose to ignore test order or may impose their own ordering schemes.
+
+
+ The test execution order with respect to siblings, initially zero.
+
+
+
+ Gets a locally unique identifier for this test that satisfies some specific conditions.
+
+
+ The local identifier must satisfy the following conditions:
+
+
+ - The identifier is unique among all siblings of this test belonging to the same parent.
+ - The identifier is likely to be stable across multiple sessions including
+ changes and recompilations of the test projects.
+ - The identifier is non-null.
+
+
+
+ The local identifier may be the same as the test's name. However since the name is
+ intended for display to end-users, it may contain irrelevant details (such as version
+ numbers) that would reduce its long-term stability. In that case, a different
+ local identifier should be selected such as one based on the test's
+ and an ordering condition among siblings
+ to guarantee uniqueness.
+
+
+ The locally unique property may be used to generate the
+ globally unique property of a test by combining
+ it with the locally unique identifiers of its parents.
+
+
+ The locally unique identifier.
+
+
+
+ Gets or sets a suggested hint, or null if none.
+
+
+
+ The value returned by this method will be checked for uniqueness and amended as necessary
+ to produce a truly unique .
+
+
+
+ The default value of this property is null which causes the
+ property to be used as the local id hint.
+
+ The local id hint.
+
+
+
+ Gets the set of actions that describe the behavior of the test.
+
+
+
+
+ Gets the set of actions that describe the behavior of the test's instances.
+
+
+
+
+ Provides information about a particular pattern test framework extension.
+
+
+
+
+ Creates an information object.
+
+ The unique id of the extension.
+ The display name of the extension.
+ Thrown if or
+ is null.
+
+
+
+ Gets the unique id of the extension.
+
+
+
+
+ Gets the display name of the extension.
+
+
+
+
+ Gets or sets the extension's test kind which is used to decorate the test
+ assembly test when a test assembly only contains tests that belong to one
+ particular framework. May be null if none.
+
+
+
+
+ This exception type is used to signal that a test has been terminated with
+ a particular outcome.
+
+
+
+ The exception message, if present, should explain the reason that the test was terminated.
+
+
+
+
+
+ This exception type is an abstract base class for exceptions that are used to
+ explicitly signal the outcome of a test.
+
+
+
+ The test framework uses the value of the property to set the test
+ result instead of applying the standard behavior for unexpected exceptions.
+
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+
+
+
+ Returns true if the test exception has a non-default message
+
+
+
+ The message parameter was not null in the constructor arguments.
+
+
+
+
+
+ Gets the outcome of the test.
+
+
+
+
+ Returns true if the outcome and message (if any) should be used but the exception
+ stack trace should not be logged.
+
+
+
+
+ Creates a silent test exception with the specified outcome.
+
+ The test outcome.
+
+
+
+ Creates a silent test exception with the specified outcome.
+
+ The test outcome.
+ The message, or null if none.
+
+
+
+ Creates an exception.
+
+ The test outcome.
+ The message, or null if none.
+ The inner exception, or null if none.
+
+
+
+ Creates a exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+
+
+
+
+
+
+ Abstract base class for typical builder implementations.
+
+
+
+
+
+
+
+
+
+
+ Gets the test model builder.
+
+ The test model builder.
+
+
+
+ Default implementation of a test model builder.
+
+
+
+
+ Abstract base class for test component builders.
+
+
+
+
+ Creates a test component builder.
+
+ The associated test model builder.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets the underlying test component.
+
+ The test component.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a test builder.
+
+ The test model builder.
+ The underlying test.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Default implementation of a test data context builder.
+
+
+
+
+ A test data context builder applies contributions to a test data context under construction.
+
+
+
+
+ Defines a new data source within this data context if one does not exist.
+ Otherwise returns the existing one.
+
+ The data source name, or an empty string if it is anonymous.
+ The defined data source.
+ Thrown if is null.
+
+
+
+ Creates a child data context.
+
+ The builder for the child context.
+
+
+
+ Gets the underlying pattern test data context.
+
+ The underlying pattern test data context.
+
+
+
+ Gets or sets the offset to add to a test parameter's implicit data binding index to map it
+ into the containing data context.
+
+
+
+ This property is used to determine the data binding index of a test parameter that
+ has not been explicitly bound. The offsets are summed cumulatively to produce an implicit
+ data binding index while traversing the chain of containing data contexts while locating the
+ first anonymous data source.
+
+
+ For example, suppose Y is the second parameter of a test method. If Y does not
+ have an explicit data binding, we will apply implicit data binding rules as follows.
+
+ - If
Y 's data context contains an anonymous data source, then the implicit data binding index will be 0.
+ - Otherwise, if
Y 's containing data context contains an anonymous data source, then the implicit data
+ binding index will equal the offset specified in Y 's data context: 1 (since it is the second parameter).
+ - Otherwise, we continue searching containing data contexts and summing their offsets until we find an
+ anonymous data source. If none is found, then data binding will fail.
+
+
+
+
+
+
+ Creates a test data context builder.
+
+ The associated test model builder.
+ The underlying test data context.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Default implementation of a test model builder.
+
+
+
+
+ Creates a test model builder.
+
+ The reflection policy.
+ The underlying test model.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Default implementation of a test parameter builder.
+
+
+
+
+ A test builder applies contributions to a test under construction.
+
+
+
+
+ Gets the underlying test parameter.
+
+ The underlying test parameter.
+
+
+
+ Gets the test data context builder for the test parameter.
+
+
+
+
+ Gets the set of actions that describe the behavior of the test parameter.
+
+
+
+
+ Gets or sets the data binder for the parameter.
+
+
+
+ The default value is a bound to the anonymous
+ data source using a whose path is the name of this parameter and whose
+ index is the implicit index computed by the pararameter's data context.
+
+
+ Thrown if is null.
+
+
+
+ Creates a test parameter builder.
+
+ The test model builder.
+ The underlying test parameter.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Populates components lazily.
+
+
+
+ A populator function takes one parameter to specify a hint for the particular
+ code element whose patterns should be processed to generate components. If the hint
+ is null or unrecognized then the populator should proceed to generate all remaining
+ components.
+
+
+ The code element hint to identify the location of the
+ particular components to populate, or null to populate them all.
+
+
+
+ A pattern test parameter handler provides the logic that implements the various
+ phases of the test parameter binding lifecycle.
+
+
+
+ Each method represents the behavior to be performed during a particular phase.
+ Different actions are permitted during each phase. Consult the
+ documentation the appropriate method of this interface for restrictions.
+
+
+ The phases generally run in the following order. Some phases may be skipped
+ due to exceptions or if there is no work to be done.
+
+ - -- for each test instance --
+
+
+ - -- end --
+
+
+
+
+
+
+ Binds a value to a test parameter.
+
+
+
+ The following actions are typically performed during this phase:
+
+ - Associated a value with a slot on the test fixture or test method.
+ - Storing the object for later use during the test run.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+ The test instance state, never null.
+ The value to bind to the parameter.
+
+
+
+ Unbinds a test parameter.
+
+
+
+ The following actions are typically performed during this phase:
+
+ - Releasing any resources used by the test parameter.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+ The test instance state, never null.
+ The value that was bound to the test parameter.
+
+
+
+ A pattern evaluator maintains state that is needed to interpret patterns.
+
+
+
+ It is used by the to populate a
+ during test enumeration.
+
+
+
+
+
+
+ Registers the scope so that it can be resolved later by .
+
+ The scope.
+ Thrown if is null.
+
+
+
+ Finds scopes that are associated with the specified
+ and returns an enumeration of their objects.
+
+ The code element.
+ The enumeration of scopes.
+ Thrown if is null.
+
+
+
+ Finds tests that are declared by the specified .
+
+ The code element.
+ The enumeration of tests.
+ Thrown if is null.
+
+
+
+ Gets the test parts represented by a code element.
+
+
+
+ If an exception occurs while enumerating the pattern attributes,
+ this method returns an empty array.
+
+
+ The code element.
+ The default primary pattern to use, if none can be resolved
+ for the code element. May be null if none.
+ The test parts, or an empty array if none.
+
+
+
+
+ Consumes the specified code element.
+
+
+
+ Any exceptions thrown by a pattern are caught and manifested as annotations
+ associated with the code element.
+
+
+ The containing scope.
+ The code element to consume.
+ If true, instructs the primary pattern to defer populating child tests.
+ The default primary pattern to use, if none can be resolved
+ for the code element. May be null if none.
+ Thrown if
+ or is null.
+
+
+
+
+ Processes the specified code element.
+
+
+
+ Any exceptions thrown by a pattern are caught and manifested as annotations
+ associated with the code element.
+
+
+ The scope.
+ The code element to process.
+ Thrown if is null.
+
+
+
+
+ Returns true if a code element has one or more associated patterns.
+
+ The code element.
+ True if the code element has an associated pattern.
+ Thrown if is null.
+
+
+
+ Gets all patterns associated with a code element.
+
+ The code element.
+ The enumeration of patterns, or null if none.
+ Thrown if is null.
+
+
+
+ Gets the primary pattern associated with a code element, or null if none.
+
+ The code element.
+ The primary pattern, or null if none.
+ Thrown if is null.
+ Thrown if there are multiple primary patterns associated with the code element.
+
+
+
+ Gets the builder for the test model under construction.
+
+
+
+
+ Gets the scope of the root test.
+
+ The root scope.
+
+
+
+ A pattern scope describes the environment in which the pattern is being evaluated.
+
+
+
+ A pattern is always evaluated in some scope which determines its ultimate effect
+ on declarations of tests, test parameters and test data contexts.
+
+
+
+
+
+ Creates and registers a scope for a test component.
+
+ The code element to associate with the scope.
+ The test builder.
+ The test parameter builder, or null if the scope
+ is to be associated to the test only.
+ The test data context builder.
+ If true, the scope represents the point of declaration
+ of the test component with which it is associated.
+ The new scope.
+ Thrown if ,
+ ,
+ or is null.
+
+
+
+ Creates a child test with its own child data context derived from the
+ builders of this scope. Returns the scope of the newly created child test.
+
+ The test name.
+ The associated code element, or null if none.
+ The scope of the newly created child test.
+ Thrown if is null.
+ Thrown if is null.
+
+
+
+ Creates a test parameter for the test in scope with its own
+ child data context derived from the builders of this scope. Returns
+ the scope of the newly created test parameter.
+
+ The test parameter name.
+ The associated code element, or null if none.
+ The scope of the newly created test parameter.
+ Thrown if is null.
+ Thrown if is null.
+
+
+
+ Creates a child test data context derived from the builders of this scope.
+ Returns the scope of the newly created child test data context.
+
+ The associated code element, or null if none.
+ The scope of the newly created child test data context.
+
+
+
+ Adds an action to the scope that enables a pattern to lazily populate the test model
+ with components generated in nested scopes. This is used when
+ is called with the option to skip children.
+
+ A supplied by the pattern to populate
+ its components lazily.
+ Thrown if is null.
+
+
+
+
+ Asks all registered deferred component populators to build components whose
+ construction had previously been deferred.
+
+ The code element hint to identify the location of the
+ particular components to populate, or null to populate them all.
+
+
+
+
+ Consumes the specified code element using this scope as the containing scope.
+
+
+
+ This is a convenience method that calls .
+
+
+ The code element to consume.
+ If true, instructs the primary pattern to defer populating child tests.
+ The default primary pattern to use, if none can be resolved
+ for the code element. May be null if none.
+ Thrown if is null.
+
+
+
+ Processes the specified code element using this scope as the current scope.
+
+
+
+ This is a convenience method that calls .
+
+
+ The code element to process.
+ Thrown if is null.
+
+
+
+ Gets the pattern evaluator.
+
+
+
+
+ Gets the code element associated with the scope, or null if none.
+
+
+
+
+ Returns true if the scope represents a test declaration.
+
+
+
+ An arbitrary scope nested within a test declaration scope is not itself considered a
+ test declaration scope unless it also represents a test declaration.
+
+
+
+
+
+ Returns true if the scope represents a test parameter declaration.
+
+
+
+ An arbitrary scope nested within a test parameter declaration scope is not itself considered a
+ test parameter declaration scope unless it also represents a test parameter declaration.
+
+
+
+
+
+ Returns true if a child test can be added to the test within scope.
+
+
+
+
+ Returns true if a test parameter can be added to the test within scope.
+
+
+
+
+ Gets a builder for applying contributions to the test currently being
+ constructed within this scope. Never null.
+
+
+
+
+ Gets a builder for applying contributions to the test parameter currently being
+ constructed within this scope, if there is one, or null if there is no
+ test parameter in scope.
+
+
+
+
+ Gets a builder for applying contributions to the test component currently being
+ constructed within this scope.
+
+
+
+ The component may be a test or a test parameter. It will never be null.
+
+
+
+
+
+ Gets a builder for applying contributions to the current test data context within the scope.
+
+
+
+ A test data context is essentially a lexically scoped environment for the declaration of
+ data sources used by parameterized tests.
+
+
+ Typically a new data context will be introduced at the point of declaration of a test
+ or test parameter, but it may also be introduced by other lexical scopes. For example,
+ a test fixture constructor may declare a new test data context which provides data sources
+ that can be used for data binding by the constructor's parameters (but are not visible
+ to any other part of the fixture).
+
+
+ Since there is always a test component in scope, the test data context builder can never be null.
+
+
+
+
+
+ Gets a builder for applying contributions to the test model.
+
+
+
+
+ Configures runtime parameters while executing tests within a test assembly.
+
+
+
+
+ Resets the globals to default values.
+
+
+
+
+ Specifies the maximum number of concurrent threads to use when tests are run in parallel.
+
+ The degree of parallelism. Defaults to or 2, whichever is greater.
+ Thrown if is less than 1.
+
+
+
+ Specifies the default test case timeout or null if none.
+
+ The default timeout for test cases or null if none. Defaults to 10 minutes.
+
+
+
+
+ An implementation of based on
+ actions that can be sequenced and composed as chains.
+
+
+ for documentation about the behaviors themselves.
+
+
+
+ Creates a test parameter actions object initially configured with empty action chains
+ that do nothing.
+
+
+
+
+
+
+
+
+
+
+ Gets the chain of actions.
+
+ for details about the semantics of these actions.
+
+
+
+ Gets the chain of actions.
+
+ for details about the semantics of these actions.
+
+
+
+ A function chain captures a sequence of actions to be performed as
+ part of a complex multi-part process.
+
+ The function argument type.
+ The function result type.
+
+
+
+ Creates a function chain.
+
+ The initial function.
+ Thrown if is null.
+
+
+
+ Registers a function decorator to perform around all other actions
+ currently in the chain. The contained part of the chain
+ is passed in as a function to the decorator that the decorator
+ can choose to run (or not) as needed.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified around
+ the current .
+
+
+ The decorator to register.
+ Thrown if is null.
+
+
+
+ Gets or sets a representation of the chain as a single function.
+
+
+
+ The function is progressively augmented as new contributions are
+ registered . By default the action is whatever was
+ passed into the constructor.
+
+
+ Thrown if is null.
+
+
+
+ Represents a delegate that decorates a function.
+
+ The type of object the function is performed upon.
+ The type of the function result.
+ The object to act upon.
+ The function to decorate which should be called in
+ the middle of applying the decoration.
+
+
+
+ Describes the context in which an assertion is being evaluated.
+
+
+
+
+ Submits an assertion failure.
+
+
+
+ The behavior of this method depends upon the current setting of
+ . Typically this method will
+ throw an but it might do
+ other things. Do not assume that it will throw an exception!
+
+
+ The assertion failure.
+ Thrown if
+ is null.
+
+
+
+ Performs an action and returns an array containing the assertion failures
+ that were observed within the block.
+
+
+
+ If the action throws an exception it is reported as an assertion failure
+ unless the exception is a (except )
+ in which case the exception is rethrown by this method. This behavior enables special
+ test exceptions such as to be used to terminate
+ the test at any point instead of being reported as assertion failures.
+
+
+ The set of failures captured will depend on the setting of .
+
+ - If set to
or
+ , then only
+ the first failure will be captured since execution will be immediately aborted when it happens.
+ - If set to
or
+ , then all
+ failures will be captured until the block terminates or throws an exception for some other reason.
+ - If set to
, then no failures
+ will be captured since they will all be ignored!
+
+
+
+ The action to invoke.
+ The assertion failure behavior to use while
+ executing the block.
+ Specifies whether to represent an exception
+ as an assertion failure, otherwise it is rethrown.
+ The array of failures, may be empty if none.
+ Thrown if is null.
+
+
+
+ Gets the pending failures within the current assertion scope.
+
+ The pending failures, or an empty array if none.
+
+
+
+ Gets the current assertion context, or null if there is no current context.
+
+
+
+
+ Gets the associated test context.
+
+
+
+
+ Gets the current assertion failure behavior.
+
+
+
+ The value of this property may change during invocations of .
+
+
+
+
+
+ The exception type used by the Gallio assertion framework to signal assertion failures.
+
+
+
+
+ This exception type is used to signal that a test has failed to satisfy
+ some predetermined condition established by the test author.
+
+
+
+ For example, an assertion failure may be signaled using a
+ to distinguish it from other application or runtime errors that a test might encounter
+ at runtime.
+
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Returns .
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ An assertion failure is an immutable description of a failed assertion and its
+ cause. It takes into account information about labeled values such as the expected
+ and actual value.
+
+
+
+ Use an to generate an instance of this type.
+
+
+
+
+
+
+ Gets the maximum length of label that can be presented before truncation occurs.
+
+ 100
+
+
+
+ Gets the maximum length of formatted value that can be presented before truncation occurs.
+
+ 2000
+
+
+
+ Creates an assertion failure object.
+
+
+
+
+ Writes the assertion failure to a test log stream.
+
+ The test log stream.
+ Thrown if is null.
+
+
+
+ Formats the failure as a string.
+
+ The formatted string.
+
+
+
+ Writes the details about the assertion failure to the structured text writer.
+
+ The structured text writer, not null.
+
+
+
+ Gets the description of the assertion failure.
+
+
+
+
+ Gets the user-supplied message about the assertion failure,
+ or null if none.
+
+
+
+
+ Get the stack track of the failure, or null if none.
+
+
+
+
+ Gets formatted representations of labeled values as key/value pairs.
+
+
+
+
+ Gets information about the exceptions.
+
+
+
+
+ Gets the nested assertion failures that contributed to the composite assertion
+ failure described by this instance.
+
+
+
+
+ A labeled value describes a named assertion parameter.
+
+
+
+ The label indicates the purpose of the value, such as "Expected Value".
+ The value itself should be formatted to emphasize structural characteristics.
+
+
+ For additional emphasis, such as for comparison purposes (ie. diffs), the value may
+ be formatted as structured text to include highlights and other markup.
+
+
+
+
+
+ Creates a labeled value with plain text.
+
+ The label.
+ The formatted value as plain text.
+ Thrown if or
+ is null.
+ Thrown if is empty.
+
+
+
+ Creates a labeled value with structured text.
+
+ The label.
+ The formatted value as structured text.
+ Thrown if or
+ is null.
+ Thrown if is empty.
+
+
+
+
+
+
+ Gets the label.
+
+
+
+
+ Gets the formatted value as structured text.
+
+
+
+
+ Specifies the behavior that should take place when a
+ is submitted to the .
+
+
+
+ There are three orthogonal dimensions to the assertion failure behavior:
+
+ / No- : Log the failure when reported, or do not log it.
+ / No- : Throw an exception to abort computation, or allow it to continue
+ / No- (aka. ): Discard the failure when finished reporting it, or capture it in a list for further processing
+
+
+
+
+
+
+ When an assertion failure is reported, capture it in a list, log it, and allow
+ the computation to continue.
+
+ 1
+
+
+
+ When an assertion failure is reported, capture it in a list, then throw an
+ to immediately abort the current computation.
+
+ 2
+
+
+
+ When an assertion failure is reported, capture it in a list, log it, then throw an
+ to immediately abort the current computation.
+
+
+
+ This is the default behavior for assertion contexts.
+
+
+ 3
+
+
+
+ When an assertion failure is reported, discard it (instead of capturing it in a list)
+ and allow the current computation to continue.
+
+ 4
+
+
+
+ When an assertion failure is reported, capture it in a list and allow the current
+ computation to continue.
+
+
+
+ This is the opposite of , and is an alias for the case where none
+ of the other flags are specified.
+
+
+ 0
+
+
+
+ An assertion failure builder is used to construct a complete description
+ of an assertion failure that has occurred. It takes into account information about
+ the expected and actual value, as well as additional labeled values and exceptions.
+
+
+
+
+ Creates an assertion failure builder with the default formatter.
+
+ The description of the failure.
+ Thrown if
+ is null.
+
+
+
+ Creates an assertion failure builder with the specified formatter.
+
+ The description of the failure.
+ The formatter to use.
+ Thrown if or
+ is null.
+
+
+
+ Sets the user-supplied assertion failure message.
+
+ The user-supplied assertion failure message, or null if none.
+ The builder, to allow for fluent method chaining.
+
+
+
+ Sets the user-supplied assertion failure message to a formatted value.
+
+ The user-supplied assertion failure message format
+ string, or null if none.
+ The format arguments, or null or empty if none.
+ The builder, to allow for fluent method chaining.
+
+
+
+ Sets the stack trace.
+
+ The stack trace, or null if none.
+ The builder, to allow for fluent method chaining.
+
+
+
+ Adds the raw expected value to be formatted using .
+
+
+
+ The order in which this method is called determines the order in which this
+ value will appear relative to other labeled values.
+
+
+ This is a convenience method for setting a labeled value called "Expected Value".
+
+
+ The expected value.
+ The builder, to allow for fluent method chaining.
+
+
+
+ Adds the raw actual value to be formatted using .
+
+
+
+ The order in which this method is called determines the order in which this
+ value will appear relative to other labeled values.
+
+
+ This is a convenience method for setting a labeled value called "Actual Value".
+
+
+ The actual value.
+ The builder, to allow for fluent method chaining.
+
+
+
+ Adds the raw expected and actual values to be formatted using
+ and includes formatting of their differences.
+
+
+
+ The order in which this method is called determines the order in which the
+ values will appear relative to other labeled values.
+
+
+ This is a convenience method for setting a pair of labeled values called "Expected Value"
+ and "Actual Value" with diffs.
+
+
+ The expected value.
+ The actual value.
+ The builder, to allow for fluent method chaining.
+
+
+
+ Adds two raw labeled values formatted using and includes
+ formatting of their differences.
+
+
+
+ The order in which this method is called determines the order in which the
+ values will appear relative to other labeled values.
+
+
+ The left label.
+ The left value.
+ The right label.
+ The right value.
+ The builder, to allow for fluent method chaining.
+ Thrown if or
+ is null.
+
+
+
+ Adds a raw labeled value to be formatted using .
+
+
+
+ The order in which this method is called determines the order in which this
+ labeled value will appear relative to other labeled values.
+
+
+ The label.
+ The raw unformatted value.
+ The builder, to allow for fluent method chaining.
+ Thrown if is null.
+ Thrown if is empty.
+
+
+
+ Adds a labeled value as plain text.
+
+
+
+ The order in which this method is called determines the order in which this
+ labeled value will appear relative to other labeled values.
+
+
+ The label.
+ The formatted value.
+ The builder, to allow for fluent method chaining.
+ Thrown if or is null.
+ Thrown if is empty.
+
+
+
+ Adds a labeled value as structured text.
+
+
+
+ The order in which this method is called determines the order in which this
+ labeled value will appear relative to other labeled values.
+
+
+ The label.
+ The formatted value as structured text.
+ The builder, to allow for fluent method chaining.
+ Thrown if or is null.
+ Thrown if is empty.
+
+
+
+ Adds a labeled value.
+
+
+
+ The order in which this method is called determines the order in which this
+ value will appear relative to other labeled values.
+
+
+ The labeled value.
+ The builder, to allow for fluent method chaining.
+
+
+
+ Adds an exception to the assertion failure.
+
+ The exception to add.
+ The builder, to allow for fluent method chaining.
+ Thrown if is null.
+
+
+
+ Adds an exception to the assertion failure.
+
+ The exception data to add.
+ The builder, to allow for fluent method chaining.
+ Thrown if is null.
+
+
+
+ Adds a nested assertion failure that contributed to the composite assertion failure
+ described by this instance.
+
+ The inner assertion failure to add.
+ The builder, to allow for fluent method chaining.
+ Thrown if is null.
+
+
+
+ Adds an enumeration of nested assertion failures that contributed to the composite
+ assertion failure described by this instance.
+
+ The enumeration of inner assertion failures to add.
+ The builder, to allow for fluent method chaining.
+ Thrown if is null or
+ contains a null.
+
+
+
+ Generates an immutable object that describes the failure.
+
+ The assertion failure.
+
+
+
+ Creates an assertion failure object.
+
+
+
+ Subclasses may override this method to define custom extended assertion
+ failure objects.
+
+
+
+
+
+ Gets the formatted used by the builder.
+
+
+
+
+ An exception type that wraps a .
+
+
+
+ This exception is used in two ways:
+
+ - The exception may be "silent" when it is used to cause a test to terminate due to
+ an assertion failure that has already been logged or otherwise conveyed to the user.
+ - Otherwise the exception will be reported the user in the typical manner.
+
+
+
+
+
+
+ Creates an exception for a given assertion failure.
+
+ The assertion failure.
+ True if the assertion failure exception should not be logged because
+ the information it contains has already been conveyed to the user.
+ Thrown if is null.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+
+
+
+ Gets the associated assertion failure, never null.
+
+
+
+
+ Returns true if the assertion failure exception should not be logged because
+ the information it contains has already been conveyed to the user.
+
+
+
+
+
+
+
+
+
+
+ Provides utilities to assist with the implementation of new asserts.
+
+
+
+
+ Verifies that an assertion succeeded.
+
+
+
+ The assertion function should return null to indicate that the assertion has passed
+ or to indicate that it has failed.
+
+
+ If the assertion function throws an exception it is reported as an assertion failure
+ unless the exception is a (except )
+ in which case the exception is rethrown by this method. This behavior enables special
+ test exceptions such as to be used to terminate
+ the test at any point instead of being reported as assertion failures.
+
+
+ When an assertion failure is detected, it is submitted to
+ which may choose to throw a or do something else.
+
+
+ Using this method enables the system to track statistics about assertions
+ and to ensure that assertion failures are reported uniformly.
+
+
+ It is important to note that not all failures will result in a
+ being thrown. Refer to for details.
+
+
+ The assertion function to evaluate.
+ Thrown if is null.
+
+
+
+ Submits a failure if the assertion failure object is non-null.
+
+ Failure to be submited, or null if none.
+
+
+
+ Performs an action and returns an array containing the assertion failures
+ that were observed within the block. If the block throws an exception, it
+ is reified as an assertion failure.
+
+
+
+ If the action throws an exception it is reported as an assertion failure
+ unless the exception is a (except )
+ in which case the exception is rethrown by this method. This behavior enables special
+ test exceptions such as to be used to terminate
+ the test at any point instead of being reported as assertion failures.
+
+
+ The assertion failure behavior while the action runs is
+ so the action terminates on the first failure. The assertion failure itself is returned
+ but it is not logged.
+
+
+ This method is very useful for composing assertions because it enables assertions to be
+ evaluated, and, when they fail, the failure can be recorded as an inner assertion failure
+ of some larger composite assertion. For example, this makes it possible to create an assertion
+ over a collection of items by composing an assertion over a single item.
+
+
+ The action to invoke.
+ The array of failures, may be empty if none.
+ Thrown if is null.
+
+
+
+ Performs an action and returns an array containing the assertion failures
+ that were observed within the block.
+
+
+
+ If the action throws an exception it is reported as an assertion failure
+ unless the exception is a (except )
+ in which case the exception is rethrown by this method. This behavior enables special
+ test exceptions such as to be used to terminate
+ the test at any point instead of being reported as assertion failures.
+
+
+ The action to invoke.
+ The assertion failure behavior to use while the action runs.
+ The array of failures, may be empty if none.
+ Thrown if is null.
+ Thrown if there is no current assertion context.
+
+
+
+ Performs an action and combines the possible assertion failures
+ that were observed within the block, into a single outer failure with
+ a common explanation.
+
+ The action to invoke.
+ A function that takes an array of inner failures and
+ returns a single outer failure with a common explanation.
+ Thrown if is null.
+ Thrown if is null.
+
+
+
+ Abstract base class for that validates
+ input arguments before passing them on to the implementation.
+
+
+
+
+ A data binder specifies how to produce values that are suitable for data binding
+ in some context.
+
+
+
+ The typical lifecycle is as follows:
+
+ - First, a
is created.
+ - Next the client calls
for each
+ , supplying the
+ and a for resolving data sources.
+ - Then the client calls
and
+ begins enumerating over the items.
+ - For each item, the client calls
+ using the produced by the s
+ to obtain the bound values.
+ - When finished with an item, the client disposes it.
+
+
+
+ The lifecycle may also be explained in terms of three phases from the perspective
+ of a .
+
+ -
+
Prebinding : The method is called to register
+ interest in particular s with the .
+
+ -
+
Binding : The method is called to obtain
+ bound values from a .
+
+ -
+
Unbinding : The 's method
+ is called to release resources used by the bound values.
+
+
+
+
+ Several data binders may be composed to generate complex values that
+ are produced using contributions from other data binders. For example,
+ a simple data binder might select a single value from a data source and
+ convert it to the right time. A composite data binder may then use the
+ values produced by several of these simple data binders to initialize
+ the fields of a composite object. Thus a composite data binder facilitates
+ the production of relatively complex object graphs that are generated from
+ primitive data binding units.
+
+
+
+
+
+ Registers the 's requests to query particular
+ s with the .
+
+ The data binding context.
+ The data source resolver.
+ The data binding accessor to use for obtaining bound values
+ from s produced by the .
+ Thrown if or is null.
+
+
+
+
+
+
+ Implementation of .
+
+ The data binding context, not null.
+ The data source resolver, not null.
+ The data binding accessor.
+
+
+
+ A base implementation of that
+ performs argument validation.
+
+
+
+
+ A data accessor extracts a value from a .
+
+
+
+
+ Gets a value derived from the .
+
+ The data item.
+ The value.
+ Thrown if the data binding fails.
+ Thrown if is null.
+
+
+
+
+
+
+ Internal implementation of after argument
+ validation has been performed.
+
+ The data item, not null.
+ The value.
+ Thrown if the data binding fails.
+
+
+
+ An implementation of that
+ returns a constant value, ignoring the data item it is passed.
+
+
+
+
+ Creates a data accessor that returns a specified constant value.
+
+ The constant value to be returned by .
+
+
+
+
+
+
+ A tracks a list of s and
+ s that are used to produce s.
+
+
+
+ In typical usage, a registers interest in obtaining
+ data from a particular by providing a corresponding .
+ The then adds the requested
+ to its list and returns a .
+ When is called, the produces
+ an enumeration of . Data-bound values can then
+ be obtained from the via the
+ method of each accessor.
+
+
+
+
+
+
+ Creates a data binding context.
+
+ The converter.
+ Thrown if is null.
+
+
+
+ Registers a data binding for a given data set and adds the data set
+ to the list of data sets to be enumerated during data binding.
+ Returns a that may be used to
+ retrieve the values associated with the binding.
+
+
+
+ A uses this method to register interest
+ in querying a particular . It must do so
+ before is called to ensure that the
+ is included in the enumeration.
+
+
+ The data set.
+ The data binding.
+ Thrown if or is null.
+
+
+
+ Gets an enumeration of s.
+
+
+
+ The contents of each item may be inspected using a
+ as returned by . When the client is finished with
+ an item, it should dispose it by calling the
+ method of the .
+
+
+ A client typically registers its s with the
+ then enters a loop to enumerate the items.
+ For each item, the client will call
+ to retrieve the values of interest. When it is finished with an item, it
+ disposes it and proceeds on to the next one or stops. In this manner, a
+ client may apply multiple s within the same
+ .
+
+
+ If no data bindings have been registered ( is false),
+ this method returns exactly one data item consisting of a .
+
+
+ If true, includes items that may be dynamically
+ generated in the result set. Otherwise excludes such items and only returns
+ those that are statically known a priori.
+ The enumeration of data items.
+
+
+
+ Gets the converter service.
+
+
+
+ The data binding context does not use the converter itself, but it may be
+ used by data binders to perform any required internal conversions.
+
+
+
+
+
+ Returns true if the data binding context contains registered data bindings.
+
+
+
+ If the context contains no data bindings then by definition it also contains
+ no data sets. In the absence of bindings, will produce
+ exactly one (a ) and no data
+ binding work will actually need to be performed by the client. Consequently a
+ client may choose to treat this situation as a special case and may adopt a different
+ (possibly simpler) algorithm in response.
+
+
+
+
+
+ Gets the immutable list of data sets to be enumerated during data binding.
+
+
+
+ These are the s from which the raw data for binding will
+ be retrieved.
+
+
+
+
+
+ Gets or sets the to use for combining the
+ together.
+ By default the strategy is .
+
+ Thrown if is null.
+
+
+
+ A data row is a simple immutable value type that encpasulates an
+ array of values along with associated metadata for use in data binding expressions.
+ It presents a fluent interface that users may find more convenient than
+ other implementations.
+
+
+
+ The data in a is always considered dynamic.
+
+
+
+
+
+ Abstract base class for data items.
+
+
+
+
+ A data item is an opaque representation of a collection of values
+ and metadata that may be retrieved using data bindings that encode
+ the appropriate lookup rules into the item.
+
+
+
+ Data items may have very different forms:
+
+ - Scalar-like items: Items that always yield a single value, possibly a constant
+ - Row-like items: Items that yield several values in response to index-based
+ data bindings or named column paths
+ - Structured items: Items that yield values by binding to paths within the item
+ or by resolving custom data binding expressions
+
+
+
+
+
+
+
+ Populates the specified metadata map with key/value pairs associated with
+ the data item, if any.
+
+
+
+ For example, the metadata may contain a description that serves
+ as documentation of the contents of the data item or of the test
+ scenario that is exercised by the contents of the data item.
+ This metadata may be injected into test instances created with
+ the contents of this data item.
+
+
+ The metadata map.
+
+
+
+ Gets the value of the specified binding.
+
+ The data binding, never null.
+ The value.
+ Thrown if the
+ cannot be resolved or if its value cannot be obtained.
+
+
+
+ Gets an enumeration of the data bindings that may be queried to informally describe
+ its contents. The enumeration of bindings may not be complete.
+
+ The enumeration of bindings.
+
+
+
+ Returns true if the item contains data that is obtained dynamically from sources
+ whose content may change over time or may be expensive to query ahead of time.
+
+
+
+ For example, data obtained from a database should be considered dynamic.
+ On the other hand, data obtained from declarative metadata defined as part
+ of the test should be considered static.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Implements .
+
+ The binding, never null.
+ The associated value.
+
+
+
+ Implements .
+
+ The metadata map to populate, never null.
+
+
+
+
+
+
+ Creates a data row with the specified array of values.
+
+ The array of values.
+
+
+
+ Returns an augmented data row with added metadata.
+
+
+
+ The original data row is not modified.
+
+
+ The metadata key.
+ The metadata value.
+ The augmented data row.
+ Thrown if
+ or is null.
+
+
+
+ Returns an augmented data row with added metadata from the
+ specified metadata map.
+
+
+
+ The original data row is not modified!
+
+
+ The metadata map.
+ The augmented data row.
+ Thrown if
+ is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Utilities for .
+
+
+
+
+ Gets the metadata associated with a data item.
+
+ The data item.
+ The associated metadata.
+
+
+
+ A factory data set generates data items by invoking a factory delegate
+ and interpreting its output in accordance with the factory kind.
+
+
+
+ Multiple different interpretations are supported. Refer to the documentation
+ of the enumeration for more details about each kind.
+
+
+
+
+
+ Abstract base class for that validates
+ input arguments before passing them on to the implementation.
+
+
+
+
+ A data set provides data items for data binding and describes whether
+ is supports particular bindings.
+
+
+
+
+ A data provider generates an enumeration of s
+ given a collection of s to satisfy.
+
+
+
+
+ Gets an enumeration of data items that can supply values for a given collection of bindings.
+ It should produce items even if some of the requested bindings cannot be fulfilled.
+
+ The bindings that are requested.
+ If true, includes items that may be dynamically
+ generated in the result set. Otherwise excludes such items and only returns
+ those that are statically known a priori.
+ The enumeration of data items.
+ Thrown if is null.
+
+
+
+ Returns true if the data set can provide a value for the specified binding.
+
+ The binding.
+ True if the data set can provide a value for the binding.
+ Thrown if is null.
+
+
+
+ Gets the number of columns in an indexed data set.
+
+
+
+
+
+
+
+
+
+
+ Determines whether a binding can be satisfied by the data set.
+
+ The data binding, not null.
+ True if the binding can be satisfied.
+
+
+
+ Enumerates the data items in the data set.
+
+ The data bindings, not null.
+ If true, includes dynamic items.
+ The enumeration of data items in the combined data set.
+
+
+
+
+
+
+ Creates a factory data set.
+
+ The factory delegate.
+ The kind of factory.
+ The number of columns in the data items produced
+ by the factory or 0 if unknown.
+ Thrown if is null.
+ Thrown if
+ is invalid or if is less than 0.
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the kind of factory member referenced by .
+
+
+
+ Each kind of factory expresses its contents by returning enumerations of data sets,
+ data items, object arrays and single objects.
+
+
+ The kind of a factory may be automatically determined or it may be explicitly
+ specified in cases where it may be ambiguous.
+
+
+
+
+
+ Automatically determines the type of factory based on the type of element
+ returned by the enumeration.
+
+
+
+
+ - If the element is a
then it is processed in the
+ same manner as .
+ - If the element is a
(such as ,
+ or ) then it is
+ processed in the same manner as .
+ - If the element is an array then it is processed in the same manner as
+
.
+ - Otherwise the element is process in the same manner as
.
+
+
+
+ Refer to the other factory kinds for usage examples.
+
+
+
+
+
+ Specifies that the factory returns an enumeration s
+ whose items are to be consumed.
+
+
+ MyFactory
+ {
+ get
+ {
+ yield return new MyCustomDataSet(1);
+ yield return new MyCustomDataSet(2);
+ }
+ }
+
+ [Test, Factory("MyFactory", Kind=FactoryKind.DataSet)]
+ public void MyTest(object value)
+ {
+ // test logic...
+ }
+ ]]>
+
+
+
+
+ Specifies that the factory returns an enumeration of s
+ (such as , , or ).
+
+
+ MyFactory
+ {
+ get
+ {
+ yield return new DataRow(1);
+ yield return new DataRow(42)
+ .WithMetadata(MetadataKeys.ExpectedException, typeof(CustomException).FullName);
+ }
+ }
+
+ [Test, Factory("MyFactory", Kind=FactoryKind.DataItem)]
+ public void MyTest(int value)
+ {
+ // test logic...
+ }
+ ]]>
+
+
+
+
+ Specifies that the factory returns an enumeration of object arrays
+ that describe successive items.
+
+
+ MyFactory
+ {
+ get
+ {
+ yield return new object[] { "abc", 123 };
+ yield return new object[] { "def", 456 };
+ }
+ }
+
+ [Test, Factory("MyFactory", Kind=FactoryKind.ObjectArray)]
+ public void MyTest(string value, int count)
+ {
+ // test logic...
+ }
+ ]]>
+
+
+
+
+ Specifies that the factory returns an enumeration of single object values.
+
+
+ MyFactory
+ {
+ get
+ {
+ yield return "abc";
+ yield return "def";
+ }
+ }
+
+ [Test, Factory("MyFactory", Kind=FactoryKind.Object)]
+ public void MyTest(string value)
+ {
+ // test logic...
+ }
+ ]]>
+
+
+
+
+ An object data binder creates objects and binds values to its slots such as
+ generic type parameters, constructor parameters, fields and properties.
+
+
+
+
+ Creates an object data binder initially without slot binders.
+
+ The type.
+ Thrown if is null.
+
+
+
+ Sets the binder for a slot.
+
+ The slot.
+ The binder.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ A that simply accesses a value contained
+ by a data item using a particular .
+
+
+
+
+ Creates a bound data accessor.
+
+ The binding to query.
+ Thrown if is null.
+
+
+
+
+
+
+ A scalar data binder queries a specified data source with a data binding
+ and converts the resulting value to the requested type.
+ It does nothing during unbinding.
+
+
+
+
+ Creates a scalar data binder.
+
+ The data binding.
+ The data source name to query, or an empty string if it is anonymous.
+
+
+
+
+
+
+ An implementation of that stores the dynamic flag
+ and metadata.
+
+
+
+
+ Creates a data item.
+
+ The metadata key/value pairs for the item, or null if none.
+ True if the item is dynamic.
+
+
+
+
+
+
+
+
+
+
+
+
+ Constructor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets a function for subtracting values of a given type.
+
+ The type of values to be compared.
+ The type of the difference produced when the values are
+ subtracted, for numeric types this is the same as but it
+ may differ for other types.
+ The subtraction function.
+ Thrown if no subtraction function exists
+ or if the difference type is incorrect.
+
+
+
+ The process isolation object saves global process-level context
+ information when it is created and restores it when it is disposed.
+
+
+
+ The following context information is saved and restored:
+
+ - The current working directory
+
+
+
+
+
+
+ Saves global process state to be subsequently restored when disposed.
+
+
+
+
+ Restores the saved process state.
+
+
+
+
+ Performs one primitive action of a test and returns its outcome.
+
+ The outcome of the action.
+
+
+
+ Subtracts the right value from the left and returns the difference.
+
+ The type of values to be compared.
+ The type of the difference produced when the values are
+ subtracted, for numeric types this is the same as but it
+ may differ for other types.
+ The left value.
+ The right value.
+ The difference when the right value is subtracted from the left.
+
+
+
+ Default implementation of a test framework manager.
+
+
+
+
+ Provides services based on the installed set of test frameworks.
+
+
+
+
+ Gets an aggregate test driver for selected frameworks.
+
+ The test framework selector.
+ The logger for the test driver.
+ The test driver.
+ Thrown if
+ or is null.
+
+
+
+ Selects the test frameworks to use for a collection of files.
+
+ The test framework selector.
+ The test files.
+ The map of test framework selections to their associated test files.
+ Thrown if
+ or is null or contains null.
+
+
+
+ Selects the test frameworks to use for a collection of code elements.
+
+ The test framework selector.
+ The code elements.
+ The map of test framework selections to their associated code elements.
+ Thrown if
+ or is null or contains null.
+
+
+
+ Gets handles for all registered test frameworks.
+
+
+
+
+ Gets the handle of the fallback test framework used when no other
+ framework supports a given test file.
+
+
+
+
+ Creates a test framework manager.
+
+ The test framework handles.
+ The fallback test framework handle.
+ The file type manager.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Specifies an inclusion or exclusion filter rule.
+
+
+
+
+ Creates a filter rule.
+
+ The rule type: inclusion or exclusion.
+ The filter.
+ Thrown if is null.
+
+
+
+ Gets the filter rule type: inclusion or exclusion.
+
+
+
+
+ Gets the filter.
+
+
+
+
+ Specifies whether a filter rule is an inclusion or exclusion rule.
+
+
+
+
+
+ The filter rule is an inclusion rule.
+
+
+
+
+ The filter rule is an exclusion rule.
+
+
+
+
+ A filterset combines zero or more filters as a sequence of inclusion and exclusion rules.
+
+
+
+
+ Creates a filter set consisting of a single inclusion filter.
+
+ The inclusion filter.
+ Thrown if is null.
+
+
+
+ Creates a filter set consisting of a collection of rules.
+
+ The filter rules.
+ Thrown if is null.
+
+
+
+ Evaluates the rules of this filter set and indicates whether the item is included, excluded
+ or not matched by the list of rules.
+
+ The item.
+ The result.
+
+
+
+ Formats the filter set to a string suitable for parsing by .
+
+
+
+ The empty filter is represented by an empty string.
+
+
+ The formatted filter set expression.
+
+
+
+
+
+
+ Returns an empty filter set.
+
+
+
+ An empty filter set neither includes nor excludes any values on its own.
+ However when filtering tests, Gallio applies an implicit inclusion rule when
+ none is otherwise specified so the net effect if that all tests will be
+ included (although "explicit" tests will not be selected explicitly so they
+ will not run).
+
+
+
+
+
+ Gets the read-only list of filter rules.
+
+
+
+
+ Returns true if the filter set is empty.
+
+
+
+
+ Returns true if the filter set has at least one inclusion rule.
+
+
+
+
+ Specifies whether a filter set includes, excludes or does not match a particular item.
+
+
+
+
+ The filter set neither includes nor excludes the item.
+
+
+
+
+ The filter set includes the item.
+
+
+
+
+ The filter set excludes the item.
+
+
+
+
+ Defines the test ordering strategy.
+
+
+
+ This default strategy first compares test by explicit ordering (using )
+ then defines an implicit ordering by name (using ).
+
+
+ Why implicitly order tests by name instead of randomly?
+
+
+ It is my belief that ordering tests by name significantly eases test result interpretation
+ because the test results are produced in a meaningful and predictable order. If the implicit
+ order is known, then it's easier for a tester to guage test progress by inspecting the name
+ of the currently executing test (in addition to using cues provided by progress monitors, of course).
+ Related tests also tend to have similar names or share a common prefix so sorting by name
+ can effectively cluster these tests together thereby providing feedback about related topics
+ around the same time.
+
+
+ A tester may of course take advantage of this known ordering to produce tests that are
+ dependent upon one another without making that clear in the code by specifying explicit test
+ dependencies or ordering. When a test is renamed, the implicit ordering will change, possibly
+ causing other tests to fail. However, it is not Gallio's objective to police
+ testers, who may well adopt any number of inadvisable practices to meet their ends.
+
+
+ Nevertheless, any test framework is still free to produce a random ordering of independent tests.
+ It suffices for the framework to initialize the property of each of its
+ testsw to a distinct random number. Problem solved.
+
+
+ Perhaps someday we can also offer the user a global choice among alternative test ordering strategies.
+
+
+
+
+
+
+
+
+ The type of exception thrown when a filter cannot be parsed.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Describes traits of an component.
+
+
+
+
+ Creates test framework traits.
+
+ The framework's display name.
+ Thrown if is null.
+
+
+
+ Returns true if at least one of the assembly references is in .
+
+ The assembly references.
+ True if the framework is compatible.
+ Thrown if is null.
+
+
+
+ Returns true if the file type is the same or a subtype of one of those specified by .
+
+ The file type.
+ The file type manager used to resolve file type ids to file types.
+ True if the framework is compatible.
+ Thrown if or is null.
+
+
+
+ Gets the framework's display name.
+
+
+
+
+ Gets or sets the framework's icon, or null if none.
+
+
+
+
+ The version of the test framework.
+
+
+
+
+ Gets or sets the list of framework assembly signatures that are recognized and supported
+ by this framework component.
+
+
+
+ The framework manager consults this list to determine whether the framework component
+ should participate in test exploration. If none of the named framework assemblies are found
+ among the test assembly references then the framework component will not be instantiated
+ during test exploration in order to improve performance.
+
+
+ Refer to for a description of the format of an assembly signature.
+
+
+ Thrown if is null.
+
+
+
+ Gets or sets the list of file types ids recognized by the framework as test files.
+
+
+
+ The framework manager consults this list to determine whether the framework component
+ should participate in test exploration. If none of the file types match the files
+ specified by the test source then the framework component will not be instantiated
+ during test exploration in order to improve performance.
+
+
+ For .Net-based test frameworks, the list of file types should probably include "Assembly"
+ or one of its subtypes.
+
+
+ Thrown if is null.
+
+
+
+ A test package specifies the test files, assemblies, and configuration options
+ that govern test execution.
+
+
+
+
+ Creates an empty test package.
+
+
+
+
+ Creates a copy of the test package.
+
+ The new copy.
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Resets to its default value and sets to false.
+
+
+
+
+ Clears the list of test files.
+
+
+
+
+ Adds a test file if it is not already in the test package.
+
+ The file to add.
+ Thrown if is null.
+
+
+
+ Removes a test file.
+
+ The file to remove.
+ Thrown if is null.
+
+
+
+ Clears the list of hint directories.
+
+
+
+
+ Adds a hint directory if it is not already in the test package.
+
+ The directory to add.
+ Thrown if is null.
+
+
+
+ Removes a hint directory.
+
+ The directory to remove.
+ Thrown if is null.
+
+
+
+ Clears the list of excluded test framework ids.
+
+
+
+
+ Adds an excluded test framework id if it is not already in the test package.
+
+ The test framework id to add.
+ Thrown if is null.
+
+
+
+ Removes an excluded test framework id.
+
+ The test framework id to remove.
+ Thrown if is null.
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a host setup based on the package properties.
+
+ The host setup.
+
+
+
+ Creates a test framework selector based on the package properties.
+
+
+ Considers the , ,
+ and .
+
+ The test framework selector.
+
+
+
+ Applies the settings of another test package as an overlay on top of this one.
+
+
+
+ Overrides scalar settings (such as ) with those of
+ the overlay when they are specified (such as when is true).
+ Merges aggregate settings (such as lists of files).
+
+
+ The test package to overlay on top of this one.
+ Thrown if is null.
+
+
+
+ Gets the read-only list of test files.
+
+
+
+
+ Gets the read-only list of hint directories used to resolve test assemblies and other files.
+
+
+
+
+ Gets the read-only list of test framework IDs that are to be excluded from the test
+ exploration process.
+
+
+
+
+ Gets a read-only collection of properties for the test runner.
+
+
+
+
+ Gets or sets the test framework options.
+
+ Thrown if is null.
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ Gets or sets the test framework fallback mode.
+
+ The test framework fallback mode. Default is TestFrameworkFallbackMode.Default .
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ Gets or sets whether assembly shadow copying is enabled.
+
+ True if shadow copying is enabled. Default is false .
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ Gets or sets the debugger setup options, or null if not debugging.
+
+ The debugger setup options. Default is null .
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ Gets or sets the application base directory, or null to use the directory
+ containing each group of test files or some other suitable default chosen by the test framework.
+
+
+ The application base directory. Default is null .
+
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ Gets or sets the working directory, or null to use the directory containing
+ each group of test files or some other suitable default chosen by the test framework.
+
+
+ The working directory. Default is null .
+
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ Gets or sets the .Net runtime version, or null to auto-detect.
+
+ The runtime version, eg. "v2.0.50727". Default is null .
+
+
+
+ Returns true if has been set explicitly.
+
+
+
+
+ An immutable record that holds two values.
+
+ The type of the first value.
+ The type of the second value.
+
+
+
+ Creates a pair.
+
+ The first value.
+ The second value.
+
+
+
+ Gets the first value.
+
+
+
+
+ Gets the second value.
+
+
+
+
+ Provides support for working with different versions of the .Net framework.
+
+
+
+
+ Gets the .Net framework version installed and currently running.
+
+ The framework version.
+
+
+
+ Specifies the .Net runtime type.
+
+
+
+
+
+ Using the Microsoft CLR.
+
+
+
+
+ Using the Mono runtime.
+
+
+
+
+ Arguments for an event raised to signal that a test was discovered and added to the test model.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test at the top of the subtree that was added.
+ Thrown if is null.
+
+
+
+ Gets the report.
+
+
+
+
+ Gets the test at the top of the subtree that was merged.
+
+
+
+
+ Arguments for an event raised to signal that an annotation has been discovered and
+ added to the test model.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The annotation that was added.
+ Thrown if is null.
+
+
+
+ Gets the report.
+
+
+
+
+ Gets the annotation that was added.
+
+
+
+
+ Arguments for an event raised to indicate that the test runner disposal has finished.
+
+
+
+
+ Base arguments for events raised to indicate the completion of an operation.
+
+
+
+
+ Initializes the event arguments.
+
+ True if the operation completed successfully.
+
+
+
+ Returns true if the operation completed successfully.
+
+
+
+
+ Initializes the event arguments.
+
+ True if the disposal was completed successfully.
+
+
+
+ Arguments for an event raised to indicate that the test runner disposal has started.
+
+
+
+
+ Initializes the event arguments.
+
+
+
+
+ Arguments for an event raised to indicate that test exploration has finished.
+
+
+
+
+ Initializes the event arguments.
+
+ True if test exploration was successful.
+ The report, including test model data on success.
+ Thrown if is null.
+
+
+
+ Gets the report, including test model data on success.
+
+
+
+
+ Arguments for an event raised to indicate that test exploration has started.
+
+
+
+
+ Initializes the event arguments.
+
+ The test package configuration.
+ The test exploration options.
+ The report lock-box which may be used to access the report asynchronously during execution.
+ Thrown if
+ or is null.
+
+
+
+ Gets the test package.
+
+
+
+
+ Gets the test exploration options.
+
+
+
+
+ Gets the report lock-box which may be used to access the report asynchronously during execution.
+
+
+
+
+ Arguments for an event raised to indicate that a marker block has been started within a test step log stream.
+
+
+
+
+ Base arguments for an event raised to indicate that a test step log stream has been modified in some way.
+
+
+
+
+ Base arguments for an event raised to provide information about a test step.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets the kind of step described using the metadata key.
+
+ The step kind.
+
+
+
+ Gets the report.
+
+
+
+
+ Gets the test data of the test that contains the test step.
+
+
+
+
+ Gets the test step run.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The log stream name.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets the log stream name.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The log stream name.
+ The marker.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets the marker.
+
+
+
+
+ A test runner extension plugs augments the behavior of a
+ by attaching new behaviors to its event handlers.
+
+
+
+ Typical extension use-cases:
+
+ - Custom logging by listening for events of interest and writing messages
+ to a file or to another location.
+ - Custom configuration of test package loading, test exploration
+ and test execution options by listening for the starting events of the phase
+ and modifying the options in place.
+
+
+
+ More complex extensions such as integration of new test frameworks are typically
+ performed by plugins because new runtime services must be registered to support them.
+
+
+
+
+
+ Installs the extension into a test runner.
+
+ The test runner events, not null.
+ The logger, not null.
+
+
+
+ Gets or sets configuration parameters for the extension.
+
+
+
+
+ Abstract implementation of a test runner extension.
+ for more details.
+
+
+
+
+
+
+
+ Initializes the extension as part of extension installation.
+
+
+
+
+ Gets the test runner event extension point.
+
+
+
+
+ Gets the logger.
+
+
+
+
+
+
+
+ Provides utilities for manipulating test runner extensions.
+
+
+
+
+ Creates an extension from its specification.
+
+
+
+ An extension specification has the form "[Namespace.]Type,Assembly[;Parameters]".
+ The extension class must implement . The namespace may be omitted
+ if the assembly contains exactly one class with the specified name. The parameter string is passed
+ to the extension exactly as written.
+
+
+ Examples:
+
+ - "MyExtensions.MyExtension,MyExtensions.dll;Parameter1,Parameter2"
+ - "CustomLogger,MyExtensions"
+
+
+
+ The extension specification.
+ The extension.
+ Thrown if the extension cannot be instantiated and configured.
+ Thrown if is null.
+
+
+
+ A default implementation of .
+
+
+
+
+ A test runner provides the basic functionality for loading, exploring and running tests.
+
+
+
+ It abstracts away most concerns having to do with the execution of tests
+ in isolated (possibly remote) domains.
+
+
+ The basic usage pattern of a test runner is as follows:
+
+ - As a precondition, ensure that the runtime environment has been initialized.
+ - Create the test runner.
+ - Add event handlers and register extensions.
,
+ - Initialize the runner.
+ - Explore and/or Run the tests.
and
+ - Dispose the test runner.
+ - Save or format the report contents as required using the reporting APIs.
+
+
+
+ Multiple test runs may be performed between initialization and disposal of the test runner.
+
+
+
+
+
+ Registers a test runner extension.
+
+
+
+ The extension should already have been configured before this method
+ is called. Its method will be
+ called to register the extension with the test runner as part of the initialization
+ of the test runner.
+
+
+ The test runner extension to register.
+ Thrown if is null.
+ Thrown if the test runner has already been initialized.
+
+
+
+ Initializes the test runner.
+
+ The test runner options.
+ The logger.
+ The progress monitor.
+ Thrown if ,
+ or is null.
+ Thrown if the runner is already initialized.
+ Thrown if the runner has been disposed.
+
+
+
+ Explores tests in a test package.
+
+
+
+ Returns a report that contains test package and test model information only.
+
+
+ The test package.
+ The test exploration options.
+ The progress monitor.
+ The test report.
+ Thrown if ,
+ , or is null.
+ Thrown if the operation failed.
+ Thrown if the runner has been disposed.
+
+
+
+ Explores and runs tests in a test package.
+
+
+
+ Returns a report that contains test package, test model and test run data.
+
+
+ The test package.
+ The test exploration options.
+ The test execution options.
+ The progress monitor.
+ The test report.
+ Thrown if ,
+ , , or is null.
+ Thrown if the operation failed.
+ Thrown if the runner has been disposed.
+
+
+
+ Disposes the test runner. Does nothing if already disposed or if not initialized.
+
+ The progress monitor.
+ Thrown if is null.
+
+
+
+ Gets the event dispatcher for the test runner.
+
+
+
+
+ Creates a test runner.
+
+ The test isolation provider.
+ The test framework manager.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the logger, or null if the test runner has not been initialized.
+
+
+
+
+ Gets the test runner options, or null if the test runner has not been initialized.
+
+
+
+
+
+
+
+ In some situations, we may receive a report that a test step representing an
+ inner node of the test tree failed and therefore prevented other test cases
+ from running. When this happens, we automatically promote the test step to
+ behave as if it were a test case and report the failure.
+
+
+ This is really a hack to make up for the fact that most of the information
+ presented to users is about test cases rather than test suites and other inner
+ nodes of the test tree. Because test cases can be constructed dynamically,
+ we have a bit of a problem counting and presenting them when inner nodes fail.
+ I hope someday we come up with a better solution to this issue with our test model.
+ Perhaps we could introduce a "blocked" status.
+ -- Jeff.
+
+
+
+
+ Arguments for an event raised to indicate that the test runner initialization has finished.
+
+
+
+
+ Initializes the event arguments.
+
+ True if the test runner was successfully initialized.
+
+
+
+ Arguments for an event raised to indicate that the test runner initialization has started.
+
+
+
+
+ Initializes the event arguments.
+
+ The test runner options.
+ Thrown if is null.
+
+
+
+ Gets the test runner options.
+
+
+
+
+ Declares all of the events that may be raised by a .
+
+
+
+
+ The event raised to indicate that a log message was written by the test runner.
+
+
+
+ The runner automatically writes out these log messages to the logger with which it
+ is initialized. These events are raised to allow other subscribers to receive
+ log messages as well.
+
+
+
+
+
+ The event raised to indicate that a raw message was received by the test runner.
+
+
+
+
+ The event raised to indicate that the test runner initialization has started.
+
+
+
+
+ The event raised to indicate that the test runner initialization has finished.
+
+
+
+
+ The event raised to indicate that the test runner disposal has started.
+
+
+
+
+ The event raised to indicate that the test runner disposal has finished.
+
+
+
+
+ The event raised to indicate that test exploration has started.
+
+
+
+
+ The event raised to indicate that test exploration has finished.
+
+
+
+
+ The event raised to indicate that test execution has started.
+
+
+
+
+ The event raised to indicate that test execution has finished.
+
+
+
+
+ The event raised to indicate that a subtree of tests was merged into the test model.
+
+
+
+
+ The event raised to indicate that an annotation was added to the test model.
+
+
+
+
+ The event raised to indicate that a test step has started execution.
+
+
+
+
+ The event raised to indicate that a test step has finished execution.
+
+
+
+
+ The event raised to indicate that a test step has entered a new lifecycle phase.
+
+
+
+
+ The event raised to indicate that a test step dynamically added metadata to itself.
+
+
+
+
+ The event raised to indicate that an attachment has been added to a test step log.
+
+
+
+
+ The event raised to indicate that text has been written to a test step log stream.
+
+
+
+
+ The event raised to indicate that an attachment has been embedded into a test step log stream.
+
+
+
+
+ The event raised to indicate that a section has been started within a test step log stream.
+
+
+
+
+ The event raised to indicate that a marker has been started within a test step log stream.
+
+
+
+
+ The event raised to indicate that a block has finished within a test step log stream.
+
+
+
+
+ Arguments for an event raised to indicate that test execution has finished.
+
+
+
+
+ Initializes the event arguments.
+
+ True if test execution was successful.
+ The report, including test package run data on success.
+ Thrown if is null.
+
+
+
+ Gets the report, including test package run data on success.
+
+
+
+
+ Arguments for an event raised when a raw message is received.
+
+
+
+
+ Initializes the event arguments.
+
+ The message that was received.
+ Thrown if is null.
+
+
+
+ Gets the message that was received.
+
+
+
+
+ Describes a log entry for reporting purposes.
+
+
+
+
+ Gets or sets the log message severity.
+
+
+
+
+ Gets or sets the log message.
+
+
+
+
+ Gets or sets the log message details, such as an exception.
+
+
+
+
+ Provides options to report formatters.
+
+
+
+
+ Creates a default set of options.
+
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the options.
+
+ The copy.
+
+
+
+ Gets a read-only collection of configuration properties for the report formatter.
+
+
+
+
+ Describes traits of an component.
+
+
+
+
+ Creates report formatter traits.
+
+ The unique name of the report format.
+ The description of report format.
+
+
+
+ Gets the unique name of the report format.
+
+
+
+
+ Gets the description of the report format.
+
+
+
+
+ Describes traits of an component.
+
+
+
+
+ Creates test runner factory traits.
+
+ The unique name of the kind of test runner created by the factory.
+ The description of test runner created by the factory.
+
+
+
+ Gets the unique name of the kind of test runner created by the factory.
+
+
+
+
+ Gets the description of test runner created by the factory.
+
+
+
+
+ Converts arrays from one-dimensional arrays of one element type to another.
+
+
+
+
+
+
+
+
+
+
+ An abstract base class implementation of
+ that mostly validates arguments and provides a default implement for
+ based on .
+
+
+
+
+ A converter converts a value from a source type to a target type.
+
+
+
+
+ Determines whether the converter can convert a value of type
+ to type .
+
+ The source type.
+ The target type.
+ True if the converter supports this conversion.
+ Thrown if or
+ is null.
+
+
+
+ Gets the cost of converting a value of type
+ to type .
+
+ The source type.
+ The target type.
+ Thrown if or
+ is null.
+ The conversion cost.
+
+
+
+ Converts the value to type .
+
+ The value to convert.
+ The target type.
+ The converted value.
+ Thrown if is null.
+ Thrown the requested conversion was not supported.
+
+
+
+
+
+
+
+
+
+
+
+
+ Implements .
+
+
+
+ The default implementation returns true if
+ returns a valid conversion cost.
+
+
+ The source type, never null.
+ The target type, never null.
+ True if the conversion is supported.
+
+
+
+ Implements .
+
+ The source type, never null.
+ The target type, never null.
+ The conversion cost.
+
+
+
+ Implements
+
+ The source value.
+ The target type, never null.
+ The converted value.
+
+
+
+ Describes the relative cost of performing a conversion so that different
+ conversions can be ranked by cost.
+
+
+
+ A typical direct conversion should have
+ a cost of one. Lossy conversions should be more costly.
+
+
+
+
+
+ The conversion has zero cost because no work is required.
+
+ The associated cost value is 0.
+
+
+
+ The conversion is the best possible conversion available.
+
+
+
+ Built-in conversions should not use this value. It should be reserved for
+ user-created conversions that are intended to override the built-in conversions.
+
+
+ The associated cost value is 1.
+
+
+
+ The conversion costs a typical amount of work to perform.
+
+
+
+ It may yet be trumped by a conversion that costs less.
+
+
+ The associated cost value is 1000.
+
+
+
+ The conversion is a poor default choice. It costs a sufficient number of units
+ of work to perform to ensure that a non-default conversion will be chosen if possible.
+
+ The associated cost value is 1000000.
+
+
+
+ The conversion costs the maximum possible amount of work to perform.
+
+ The associated cost value is 1000000000.
+
+
+
+ The conversion is not supported.
+
+ The associated cost value is .
+
+
+
+ Creates a conversion cost.
+
+ The number of units of work required by the conversion.
+ Thrown if is negative.
+
+
+
+
+
+
+ Adds this conversion cost with the other and returns the sum.
+
+ The other conversion cost.
+ The summed conversion cost.
+
+
+
+
+
+
+ Gets the cost value.
+
+
+
+
+ Returns true if the conversion is not supported.
+
+
+
+
+ Converts values among types.
+
+
+
+
+
+
+
+
+
+
+ Service locator for .
+
+
+
+
+ Gets the global converter singleton.
+
+
+
+
+ A null implementation of a converter that does not actually support
+ converting values.
+
+
+
+ Consequently returns
+ false whenever a conversion would be required.
+
+
+
+
+
+ Gets a singleton instance of the null converter.
+
+
+
+
+
+
+
+
+
+
+ Converts an into a using .
+
+
+
+
+
+
+
+
+
+
+ A rule-based converter uses a set of s to
+ perform conversions.
+
+
+
+ It caches the best path it determines for each conversion
+ so that it only needs to compute the conversion cost once.
+
+
+
+
+
+ Creates a rule-based converter.
+
+ The entry point for framework extensions.
+ The rules to use.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Converts a into an assuming
+ the string is valid xml.
+
+
+
+
+
+
+
+
+
+
+ Converts objects to objects.
+
+
+
+
+
+
+
+
+
+
+ Converts an into a by value or outer xml.
+
+
+
+
+
+
+
+
+
+
+ Converts objects to XML serializable
+ objects that have the .
+
+
+
+
+
+
+
+
+
+
+ Describes different possible outcomes from attaching a debugger to a process.
+
+
+
+
+ The debugger could not attach to the process.
+
+
+
+
+ The debugger was already attached to the process.
+
+
+
+
+ The debugger has just been attached to the process.
+
+
+
+
+ Default implementation of a debugger manager.
+
+
+
+
+ Obtains a reference to a debugger.
+
+
+
+
+ Gets a debugger.
+
+ The debugger setup options.
+ The logger for writing progress and failure messages.
+ The debugger.
+ Thrown if or is null.
+
+
+
+
+
+
+ Describes different possible outcomes from detaching a debugger from a process.
+
+
+
+
+ The debugger could not be detached from the process and remains attached.
+
+
+
+
+ The debugger was already detached from the process.
+
+
+
+
+ The debugger has just been detached from the process.
+
+
+
+
+ Provides control over a debugger.
+
+
+
+
+ Returns true if the debugger is attached to a process.
+
+ The process to which the debugger should be attached.
+ True if the debugger is already attached.
+ Thrown if is null.
+
+
+
+ Attaches the debugger to a process.
+
+ The process to which the debugger should be attached.
+ A result code to indicate whether the debugger was attached.
+ Thrown if is null.
+
+
+
+ Detaches the debugger from a process.
+
+
+
+ Does nothing if the process was not attached.
+
+
+ The process from which the debugger should be detached.
+ A result code to indicate whether the debugger was detached.
+ Thrown if is null.
+
+
+
+ Launches a process and attaches the debugger.
+
+ The process start information.
+ The process that was started, or null if the process could not be launched with the debugger.
+ Thrown if is null.
+
+
+
+ A null implementation of a debugger. All services return do nothing results.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An assembly binding specifies the name and location of an assembly as well
+ as some properties to control how the .Net assembly loader resolves
+ particular assembly versions.
+
+
+
+
+ Creates an assembly binding with the specified assembly name.
+
+ The assembly name.
+ Thrown if is null.
+
+
+
+ Creates an assembly binding using the name and codebase of the specified assembly.
+
+ The assembly.
+ Thrown if is null.
+
+
+
+ Adds a binding redirect.
+
+ The binding redirect to add.
+ Thrown if is null.
+
+
+
+ Gets the assembly name.
+
+
+
+
+ Gets or sets the assembly codebase, or null if unknown.
+
+ Thrown if
+ is not null and is not an absolute Uri.
+
+
+
+ Gets or sets whether the assembly full name should be used to qualify all partial
+ name references to the assembly.
+
+
+
+
+ Gets or sets whether to apply the assembly publisher policy. Default is true .
+
+
+
+
+ Gets the mutable list of assembly binding redirects.
+
+
+
+
+ Specifies an old version range for an assembly binding redirect.
+
+
+
+
+ Creates an assembly binding redirect.
+
+
+
+ Accepts a version number like "1.2.3.4" or a range like "1.0.0.0-1.1.65535.65535".
+
+
+ The old assembly version number or range.
+ Thrown if is null.
+ Thrown if is not a valid version or version range.
+
+
+
+ Gets the old assembly version number or range.
+
+
+
+ Accepts a version number like "1.2.3.4" or a range like "1.0.0.0-1.1.65535.65535".
+
+
+ Thrown if is null.
+
+
+
+ A caching plugin loader.
+
+
+
+ The cache alleviates the need to search, load and preprocess individual plugin files
+ by storing an aggregate summary of the plugin files into the per-user local
+ application data path based on a hash of the plugin paths and preprocessor constants.
+
+
+
+
+
+ Loads plugins by recursively scanning plugin paths in the file system
+ for *.plugin files that contain plugin metadata.
+
+
+
+
+ Populates a plugin catalog with plugin metadata.
+
+
+
+
+ Adds a plugin path.
+
+
+
+ If the plugin path refers to a specific plugin file, it will be loaded when
+ the catalog is populated. Otherwise if the plugin path refers to a directory,
+ then the directory will be scanned for *.plugin files when the catalog is
+ populated.
+
+
+ The plugin path to add.
+ Thrown if is null.
+
+
+
+ Adds a plugin definition as XML.
+
+ The plugin xml.
+ The plugin base directory.
+ Thrown if
+ or is null.
+
+
+
+ Defines a constant to be used by the preprocessor.
+
+ The constant name.
+ Thrown if is null.
+
+
+
+ Populates a catalog with plugin metadata derived from the currently
+ registered plugin data sources.
+
+ The plugin catalog to populate.
+ Thrown if
+ is null.
+
+
+
+ Gets or sets the installation id.
+
+
+
+
+ Creates a file system plugin loader.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loads plugins by recursively searching the plugin paths for *.plugin files.
+
+ A function that receives plugin metadata as it
+ becomes available, not null.
+
+
+
+
+
+
+ Gets the list of plugin paths.
+
+
+
+
+ Gets the collection of initial preprocessor constants.
+
+
+
+
+ The plugin callback type used by .
+
+
+
+
+ Creates a caching plugin loader.
+
+
+
+
+ Clears the plugin cache belonging to the current user.
+
+
+
+
+
+
+
+ Provides information used to register a component.
+
+
+
+
+ Creates a component registration.
+
+ The plugin to which the component will belong.
+ The service implemented by the component.
+ The component id.
+ The component type name, or null to use the default component type specified by the service.
+ Thrown if , ,
+ is null.
+
+
+
+ Gets or sets the plugin to which the component will belong.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the service implemented by the component.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the component id.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the component type name, or null to use the default component type specified by the service.
+
+
+
+
+ Gets or sets the component properties.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the component handler factory.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the traits properties.
+
+ Thrown if is null.
+
+
+
+ Resolves object dependencies that are discovered during dependency injection
+ with the help of a service locator, a resource locator, and a built in set of conversions.
+
+
+
+ To resolve dependencies, the object dependency resolver applies the following rules:
+
+ - If a configuration argument value was provided then it is converted to an instance
+ of the parameter type (see below).
+ - If the service locator can resolve a service of the parameter type, or if the parameter type
+ is an array and the service locator can resolve one or more services of the array's element type,
+ then those services will be resolved and injected.
+ - If the parameter type is
or an array
+ of that type and the service locator can resolve an a service of the requested type,
+ then the associated services will be resolve and injected as component handles.
+
+
+
+ To convert string configuration arguments to the parameter type, the object factory applies the following rules:
+
+ - If the parameter type is an array type, then the configuration argument is split on semicolons
+ (';') and each part is independently converted to a value of the array's element type and then
+ packaged into an array.
+ - If the parameter type is a string, then no conversion is required so the value is used as-is.
+ - If the value looks like "${component.id}" and there is a component registered with the specified
+ component id that satisfies the service described by the parameter type then that component is injected.
+ Similarly if the parameter is of type
and the component
+ implements the requested service type then a handle of that component is injected.
+ - If the parameter type is an enum then the value is parsed to a
+ value of that enum type, case-insensitively.
+ - If the parameter type is
then the value is parsed into a version.
+ - If the parameter type is
then the value is parsed into a guid.
+ - If the parameter type is
then the value is parsed into a condition.
+ - If the parameter type is
then the value is treated as a Uri
+ to a resource and the image is loaded from the resource locator.
+ - If the parameter type is
then the value is treated as a Uri
+ to a resource and the icon is loaded from the resource locator.
+ - If the parameter type is
or then the
+ value is treated as a Uri to a file or directory resource and an instance of the
+ appropriate file/directory info type is injected using the full path obtained from the resource locator.
+ - If the parameter type is
then the value is interpreted the name of an assembly which is loaded using .
+ - If the parameter type is
then the value is interpereted as the assembly-qualified name of a type which is obtained using .
+ - If the parameter type is
then the value is parsed into an assembly name.
+ - If the parameter type is
then the value is parsed into an assembly signature.
+ - Otherwise, the value is converted using
if possible.
+
+
+
+ For information about how the Uri is resolved to a path, see .
+
+
+
+
+
+ Resolves object dependencies and parameters.
+
+
+
+
+ Resolves a dependency.
+
+ The parameter name.
+ The parameter type.
+ An optional configuration argument that supplies a value
+ for the parameter or describes the means by which the value should be obtained, or null if none.
+ An object that describes whether the dependency was satisfied and the value it was assigned.
+ Thrown if or
+ is null.
+
+
+
+ Creates an object dependency resolver.
+
+ The service locator.
+ The resource locator.
+ Thrown if ,
+ is null.
+
+
+
+
+
+
+ Default plugin implementation.
+
+
+
+
+ Represents an activated plugin.
+
+
+
+ The runtime provides a default implementation of this interface for plugins.
+ However, plugins authors may choose to provide a custom implementation
+ to control the plugin lifecycle and provide additional services to the
+ runtime. Initialization concerns should be performed by the constructor
+ and disposal should be performed by implementing .
+
+
+
+
+
+
+
+
+
+
+ Specifies the result of an attempt to resolve a dependency.
+
+
+
+
+ Creates a result object that represents a satisfied dependency.
+
+ The value provided for the dependency.
+ The result object.
+
+
+
+ Creates a result object that represents an unsatisfied dependency.
+
+ The result object.
+
+
+
+ Returns true if the dependency was satisfied.
+
+
+
+
+ Returns the value used to satisfy the dependency.
+
+ Thrown if the dependency was not satisfied.
+
+
+
+ A handle for a lazily instantiated component and its traits.
+
+
+
+
+
+ Creates an instance of a typed component handle for the specified descriptor.
+
+ The component descriptor.
+ The appropriately typed component handle.
+ Thrown if is null.
+ Thrown if the described component's service type or traits type cannot be resolved.
+
+
+
+ Creates an instance of a typed component handle for the specified descriptor.
+
+ The component descriptor.
+ The appropriately typed component handle.
+ The service type.
+ The traits type.
+ Thrown if is null.
+ Thrown if the described component's service or traits are not compatible with a handle of this type.
+ Thrown if the described component's service type or traits type cannot be resolved.
+
+
+
+ Creates an instance of a typed component handle for the specified component and traits instance.
+ The component handle will have a stub component descriptor for testing purposes.
+
+ The component id.
+ The component instance.
+ The component traits.
+ The service type.
+ The traits type.
+ The appropriately typed component handle.
+ Thrown if ,
+ or is null.
+ Thrown if the described component's service or traits are not compatible with a handle of this type.
+ Thrown if the described component's service type or traits type cannot be resolved.
+
+
+
+ Returns true if the specified type is a component handle type.
+
+ The type to examine.
+ True if the type is a component handle type.
+ Thrown if is null.
+
+
+
+ Gets the component instance.
+
+ The component instance.
+ Thrown if the component cannot be resolved.
+
+
+
+ Gets the component traits.
+
+ The component traits.
+ Thrown if the traits cannot be resolved.
+
+
+
+ Returns the component's id.
+
+ The component id.
+
+
+
+ Gets the component descriptor.
+
+
+
+
+ Gets the component id.
+
+
+
+
+ Gets the service type.
+
+ The service type.
+
+
+
+ Gets the traits type.
+
+ The traits type.
+
+
+
+ Describes a component.
+
+
+
+ The descriptor is used to query declarative information about the component
+ and to load associated code and resources.
+
+
+
+
+
+ Resolves the component type.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The component type.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the component handler.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The component handler.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the component instance.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The component instance.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the traits handler.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The traits handler.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the component traits.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The specific subclass of returned by this method is
+ detemined by the service's traits type as obtained by .
+
+
+ The component traits.
+ Thrown if an error occurs during resolution.
+
+
+
+ Gets the descriptor of the plugin that provides the component.
+
+
+
+
+ Gets the descriptor of the service implemented by the component.
+
+
+
+
+ Gets the component's id.
+
+
+
+
+ Gets the component type name.
+
+
+
+
+ Gets the component handler factory.
+
+
+
+
+ Gets the parameter properties.
+
+
+
+
+ Gets the traits properties.
+
+
+
+
+ Returns true if the plugin that provides the component is disabled
+ or if the service implemented by the component is disabled.
+
+
+
+
+ Gets the reason the component was disabled.
+
+ Thrown if is false.
+
+
+
+ A typed handle for a lazily instantiated component and its traits.
+
+ The type of service implemented by the component.
+ The type of traits provided by the component.
+
+
+
+ Gets the component instance.
+
+ The component instance.
+ Thrown if the component cannot be resolved.
+
+
+
+ Gets the component traits.
+
+ The component traits.
+ Thrown if the traits cannot be resolved.
+
+
+
+
+
+
+
+
+
+ A resource locator implementation based on a registry.
+
+
+
+
+ Locates resources owned by plugins and other components.
+
+
+
+
+ Resolves a resource Uri to a full path.
+
+
+
+ - file: Maps to the file's local path.
+ - plugin: Maps to a resource within the plugin's base directory, specified in the form: "plugin://Plugin.Id/RelativePath/To/Resource.txt".
+
+
+ The resource Uri.
+ The resolved full path of the resource.
+ Thrown if is null.
+ Thrown if the uri cannot be resolved.
+
+
+
+ Creates a resource locator based on a registry.
+
+ The registry.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the registry.
+
+
+
+
+ A handler factory for pre-manufactured instances.
+
+
+
+
+ A handler factory creates handlers for activating plugin, component and traits instances.
+
+
+
+
+ Creates a handler.
+
+ The object dependency resolver, not null.
+ The contract type: the handler will ensure that the objects it produces are subclasses or implementations of the contract type.
+ The object type: the handler will produce objects that are (possibly decorated) instances of the object type.
+ The configuration properties for the objects produced by the handler.
+ The handler.
+
+
+
+ Creates an instance handler factory given a particular pre-manufactured instance.
+
+ The instance to be returned by the handler.
+ Thrown if is null.
+
+
+
+
+
+
+ A handler activates instances of a plugin, component or traits object.
+
+
+
+
+ Activates the instance.
+
+ The activated instance.
+
+
+
+ A plugin catalog describes the configuration of a collection of plugins that
+ are to be installed in a registry.
+
+
+
+
+ Adds a plugin to the catalog.
+
+ The plugin to add.
+ The plugin base directory.
+ Thrown if
+ or is null.
+
+
+
+ Registers the contents of the catalog into the specified registry.
+
+ The registry.
+ Thrown if is null.
+
+
+
+ Builds objects and performs dependency injection via a service locator.
+
+
+
+ The object factory examines the object type to discover required and optional
+ dependencies that are to be injected. Required dependencies are specified by
+ the parameters of the constructor with the most parmaeters. Optional dependencies
+ are specified by settable properties.
+
+
+ If an optional dependency cannot be resolved then that dependency is ignored.
+ If any required dependency cannot be satisifed then the object construction fails and a
+ is thrown.
+
+
+ To resolve each dependency, the factory consults an
+ given the name of the parameter, its type, and the optional configuration property value specified
+ in the object property set whose key matches the dependency parameter name case insensitively.
+
+
+
+
+
+ Creates an object factory.
+
+ The dependency resolver.
+ The object type.
+ The object properties.
+ Thrown if ,
+ or is null.
+
+
+
+ Creates an instance of the object described by this factory.
+
+ The instance, not null.
+
+
+
+ A plugin catalog implementation that verifies plugin dependencies and assembly references.
+
+
+
+
+ Creates an empty plugin catalog.
+
+
+
+
+
+
+
+
+
+
+ Preprocesses XML based on the presence of processing instructions.
+
+
+
+ Recognizes the following directives:
+
+
+ <?ifdef CONSTANT?>: Begins conditional block whose contents are output only if CONSTANT is defined.
+ <?ifndef CONSTANT?>: Begins conditional block whose contents are output only if CONSTANT is not defined.
+ <?else?>: Begins alternative conditional block whose contents are output only if the previous ifdef/ifndef condition was not met.
+ <?endif?>: Ends conditional block.
+ <?define CONSTANT?>: Defines a new constant.
+
+
+
+
+
+ Creates an Xml preprocessor.
+
+
+
+
+ Defines a preprocessor constant.
+
+ The constant.
+ Thrown if
+ is null.
+
+
+
+ Returns true if the specified preprocessor constant is defined.
+
+ The constant.
+ Thrown if
+ is null.
+ True if the constant is defined.
+
+
+
+ Preprocesses and copies an Xml document from a reader into a writer.
+
+ The Xml reader.
+ The Xml writer.
+ Thrown if
+ or is null.
+ Thrown if the input Xml is malformed
+ such as if it contains unbalanced ifdef/endif pairs.
+
+
+
+ Provides information used to register a service.
+
+
+
+
+ Creates a service registration.
+
+ The plugin to which the service will belong.
+ The service id.
+ The service type name.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets or sets the plugin to which the service will belong.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the service id.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the service type name.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the default component type name, or null if none.
+
+
+
+
+ Gets or sets the traits handler factory.
+
+ Thrown if is null.
+
+
+
+ Provides a view of registered components along with methods for resolving them.
+
+
+
+
+ Gets descriptors for all components that implement a service with a given id.
+
+ The service id.
+ The list of component descriptors.
+ Thrown if is null.
+
+
+
+ Gets descriptors for all components that implement a service of a given type.
+
+ The service type.
+ The list of component descriptors.
+ Thrown if is null.
+
+
+
+ Gets descriptors for all components that implement a service of a given type by name.
+
+ The service type name.
+ The list of component descriptors.
+ Thrown if is null.
+
+
+
+ Gets a component descriptor by its id, or null if not found.
+
+ The component id.
+ The component descriptor, or null if not found.
+ Thrown if is null.
+
+
+
+ Provides information used to register a plugin.
+
+
+
+
+ Creates a plugin registration.
+
+ The plugin id.
+ The plugin type name.
+ The plugin base directory.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets or sets the plugin id.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the plugin type name.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the base directory.
+
+ Thrown if is null.
+
+
+
+ Gets or sets a condition governing the activation of the plugin,
+ or null if there is no condition. The plugin will be disabled if a
+ condition is provided but is not satisfied.
+
+
+
+
+ Gets or sets the recommended installation path for the plugin files relative to
+ the runtime installation directory, or null if there is no preference.
+
+
+
+
+ Gets or sets the paths of files that belong to the plugin relative to the
+ plugin base directory.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the list of plugin assembly bindings.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the list of probing paths in which to
+ attempt to locate referenced assemblies.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the list of plugin dependencies.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the plugin properties.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the traits properties.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the plugin handler factory.
+
+ Thrown if is null.
+
+
+
+ Provides a configurable registry of plugins, services and components.
+
+
+
+
+ A registry of plugins, services and components.
+
+
+
+ The registry is used to enumerate and resolve plugins, services and components
+ in the system. There is typically one registry singleton in any given process
+ which holds references to all other components as required.
+
+
+ At this time, the components managed by the runtime all have a singleton
+ lifecycle. This behavior may change in the future to permit the construction
+ of transient or context-dependent components.
+
+
+
+
+
+ Registers a plugin and returns its descriptor.
+
+ The plugin registration.
+ The new plugin descriptor.
+ Thrown if is null.
+ Thrown if there is already a plugin registered with the same id
+ or if the registration contains errors.
+
+
+
+ Registers a service and returns its descriptor.
+
+ The service registration.
+ The new service descriptor.
+ Thrown if is null.
+ Thrown if there is already a service registered with the same id or type name
+ or if the plugin does not belong to this registry.
+
+
+
+ Registers a component and returns its descriptor.
+
+ The component registration.
+ The new component descriptor.
+ Thrown if is null.
+ Thrown if there is already a component registered with the same id
+ or if the plugin or service does not belong to this registry or if the component implements a service
+ provided by a plugin that was not listed as a plugin dependency of the component's plugin.
+
+
+
+ Gets a view of all registered plugins.
+
+
+
+
+ Gets a view of all registered components.
+
+
+
+
+ Gets a view of all registered services.
+
+
+
+
+ Gets a service locator based on the contents of the registry.
+
+
+
+
+ Gets a resource locator based on the contents of the registry.
+
+
+
+
+ Creates an empty registry.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Disposes the registry.
+
+ True if disposing.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides a view of registered plugins along with methods for resolving them.
+
+
+
+
+ Gets a plugin descriptor by its id, or null if not found.
+
+ The plugin id.
+ The plugin descriptor, or null if not found.
+ Thrown if is null.
+
+
+
+ Stores the data managed by the registry so that it can be safely guarded by a reader/writer lock.
+
+
+
+
+ Provides a view of registered components along with methods for resolving them.
+
+
+
+
+ Gets a service descriptor by its type, or null if not found.
+
+ The service type.
+ The service descriptor, or null if not found.
+ Thrown if is null.
+
+
+
+ Gets a service descriptor by its type name, or null if not found.
+
+ The service type name.
+ The service descriptor, or null if not found.
+ Thrown if is null.
+
+
+
+ Gets a service descriptor by its id, or null if not found.
+
+ The service id.
+ The service descriptor, or null if not found.
+ Thrown if is null.
+
+
+
+ Describes a service.
+
+
+
+ The descriptor is used to query declarative information about the service
+ and to load associated code and resources.
+
+
+
+
+
+ Resolves the service type.
+
+
+
+ The service type is usually an interface but it may also be an abstract class.
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The service type.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the traits type.
+
+
+
+ The traits type is a subclass of .
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ This method effectively performs two lookups. First it resolves the service
+ type then it searches for the associated on
+ the service. Consequently it is not possible to obtain the traits type
+ name without loading the assembly in which the service and traits have been defined.
+
+
+ The traits type.
+ Thrown if an error occurs during resolution.
+
+
+
+ Gets the descriptor of the plugin that provides the service.
+
+
+
+
+ Gets the service's id.
+
+
+
+
+ Gets the service type name.
+
+
+
+ The service type is usually an interface but it may also be an abstract class.
+
+
+
+
+
+ Gets the default component type name for this service, or null if there is no default component type.
+
+
+
+ The default type must be a concrete class.
+
+
+
+
+
+ Gets the traits handler factory.
+
+
+
+
+ Returns true if the plugin that provides the service is disabled.
+
+
+
+
+ Gets the reason the service was disabled.
+
+ Thrown if is false.
+
+
+
+ Describes a plugin.
+
+
+
+ The descriptor is used to query declarative information about the plugin
+ and to load associated code and resources.
+
+
+
+
+
+ Gets an enumeration of all absolute paths to be searched in order to find a given resource.
+
+
+
+ The enumeration consists of all combinations of the base directory and probing paths, including
+ the use of an optional "bin" directory. For example, if the base directory is "C:\Base", and the
+ probing paths list contains "Probing", and we are looking for "resource.dll" then this method will
+ return the following paths: "C:\Base\resource.dll", "C:\Base\bin\resource.dll", "C:\Base\Probing\resource.dll"
+ and "C:\Base\Probing\bin\resource.dll".
+
+
+ If the resource path is absolute then the returned search paths will consist of just that absolute path.
+
+
+ The relative or absolute path of the resource to find or null to return
+ the paths of the search directories themselves.
+ An enumeration of search paths.
+
+
+
+ Resolves the plugin type.
+
+
+
+ The plugin type should be a class that implements .
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The plugin type.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the plugin handler.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The plugin handler.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the plugin instance.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The plugin instance.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the traits handler.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The traits handler.
+ Thrown if an error occurs during resolution.
+
+
+
+ Resolves the plugin traits.
+
+
+
+ This method may cause plugin resources to be loaded. The caller
+ should therefore assume that the operation is potentially time-consuming
+ and may fail.
+
+
+ The plugin traits.
+ Thrown if an error occurs during resolution.
+
+
+
+ Disables the plugin.
+
+ The reason the plugin was disabled.
+ Thrown if is null.
+
+
+
+ Gets the plugin's id.
+
+
+
+
+ Gets the plugin type name.
+
+
+
+ The plugin type should be a class that implements .
+
+
+
+
+
+ Gets the plugin handler factory.
+
+
+
+
+ Gets the base directory that contains the plugin's definition and associated resources.
+
+
+
+
+ Gets the list of plugin assembly bindings.
+
+
+
+
+ Gets the plugin properties.
+
+
+
+
+ Gets the traits properties.
+
+
+
+
+ Returns true if the plugin is disabled.
+
+
+
+
+ Gets the reason the plugin was disabled.
+
+ Thrown if is false.
+
+
+
+ Gets the list of plugins upon which this plugin depends directly or indirectly.
+
+
+
+
+ Gets the list of additional relative or absolute probing paths in which to attempt to locate
+ referenced assemblies.
+
+
+
+
+ Gets a condition governing the activation of the plugin,
+ or null if there is no condition. The plugin will be disabled if a
+ condition is provided but is not satisfied.
+
+
+
+
+ Gets the recommended installation path for the plugin files relative to
+ the runtime installation directory, or null if there is no preference.
+
+
+
+
+ Gets the paths of files that belong to the plugin relative to the
+ plugin base directory.
+
+
+
+
+ Describes the traits of a component.
+
+
+
+
+ Creates a plugin traits object.
+
+ The localized display name of the plugin.
+
+
+
+ Gets the localized display name of the plugin.
+
+
+
+
+ Gets or sets the plugin version number, or null if none.
+
+
+
+
+ Gets or sets the plugin icon, or null if none.
+
+
+
+ The image should be 32x32 pixels in size.
+
+
+
+
+
+ Gets or sets the localized plugin description, or null if none.
+
+
+
+
+ A handler factory for singletons.
+
+
+
+
+
+
+
+ Specifies the traits class associated with a service contract.
+
+
+
+ This attribute enables the runtime to bind a service contract to its traits.
+ If no attribute is specified then it is presumed that the service has an empty
+ traits class (represented by ).
+
+
+
+
+
+ Binds a traits interface to a service contract.
+
+ The traits type, a subclass of .
+ Thrown if
+ is null.
+ Thrown if
+ is not a class or if it is not derived from .
+
+
+
+ Gets the traits type, a subclass of .
+
+
+
+
+ Recognizes .Net assemblies by looking for the CLR header within the file.
+
+
+
+
+ Recognizes the type of a file.
+
+
+
+
+ Returns true if the recognizer recognizes the file described by the file inspector.
+
+
+
+ This method is guaranteed to be called only when the file already matches the
+ constraints described by the file type recognizer's traits. For example, if the
+ traits specify a file name regular expression then the recognizer will only be
+ called if the file in question actually has a matching name.
+
+
+ The file inspector, never null.
+ True if the file type was recognized.
+
+
+
+
+
+
+ Describes a file type.
+
+
+
+ File type objects are unique and can be compared for equality by reference.
+
+
+
+
+
+ Creates a file type object.
+
+ The file type id.
+ The file type description.
+ The super type of the file type, or null if none.
+ Thrown if
+ or is null.
+ Thrown if is empty.
+
+
+
+ Returns true if this file type is equal to or is a subtype of some other type.
+
+ The other type.
+ True if the condition is satisfied.
+ Thrown if is null.
+
+
+
+ Returns true if this file type is equal to or is a subtype of any of the specified other types.
+
+ The other types.
+ True if the condition is satisfied.
+ Thrown if is null
+ or contains a null.
+
+
+
+
+
+
+ Gets the id of the file type.
+
+
+
+
+ Gets the file type description.
+
+
+
+
+ Gets the super type of this file type, or null if none.
+
+
+
+
+ A built-in file type manager that identified file types based on a
+ set of registered components.
+
+
+
+
+ Provides services related to determining the type of a file.
+
+
+
+
+ Gets information about a registered file type by its id.
+
+ The file type id.
+ The associated file type information, or null if not found.
+ Thrown if is null.
+
+
+
+ Gets information about all registered file types.
+
+ The list of all registered file types.
+
+
+
+ Identifies the type of a file by consulting the set of all registered file types.
+
+ The file to identify.
+ The file type of the file, or type if unidentified.
+ Thrown if is null.
+ Thrown if the file cannot be accessed.
+
+
+
+ Identifies the type of a file by consulting the set of all registered file types.
+
+ The file inspector for the file to identify.
+ The file type of the file, or type if unidentified.
+ Thrown if is null.
+ Thrown if the file cannot be accessed.
+
+
+
+ Identifies the type of a file by consulting only the specified list of file type candidates.
+
+
+
+ This is more efficient when we are interested in only a few possible results.
+
+
+ The file to identify.
+ The collection of specific file type candidates to consider.
+ The file type of the file, or type if unidentified
+ among the candidates considered.
+ Thrown if or
+ is null.
+ Thrown if the file cannot be accessed.
+
+
+
+ Identifies the type of a file by consulting only the specified list of file type candidates.
+
+
+
+ This is more efficient when we are interested in only a few possible results.
+
+
+ The file inspector for the file to identify.
+ The collection of specific file type candidates to consider.
+ The file type of the file, or type if unidentified
+ among the candidates considered.
+ Thrown if or
+ is null.
+ Thrown if the file cannot be accessed.
+
+
+
+ Gets a file type used to identify a file of unknown type.
+
+
+
+
+ Creates a file type manager.
+
+ The file type recognizer component handles.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides a mechanism for inspecting the metadata and contents of a particular file.
+
+
+
+
+ Tries to get the file info associated with the original path of the file.
+
+ Returns the file info when available, or null otherwise.
+ True if the file info was available.
+
+
+
+ Tries to get the contents of the file as a string.
+
+ Returns the file contents when available, or null otherwise.
+ True if the file contents were available.
+
+
+
+ Tries to get the file stream opened for reading.
+
+
+
+ The caller does not need to close the stream; it will be automatically
+ released by the file inspector when finished.
+
+
+ Returns the file stream when available, or null otherwise.
+ True if the file stream was available.
+
+
+
+ Provides metadata about a .
+
+
+
+
+ Creates traits for a file type recognizer.
+
+ The file type id.
+ The file type description.
+ Thrown if or
+ is null.
+ Thrown if is empty.
+
+
+
+ Gets the file type id.
+
+
+
+
+ Gets the file type description.
+
+
+
+
+ Gets or sets the id of the file type, or null if none.
+
+
+
+
+ Specifies a regular expression used to identify the type of a file by its name,
+ or null if none. The matching is performed case-insensitively.
+
+
+
+
+ Specifies a regular expression used to identify the type of a file by its contents,
+ or null if none. The matching is performed case-insensitively.
+
+
+
+
+ A file inspector that opens a file only on demand as needed.
+
+
+
+
+ Creates a file inspector for the file describe the specified file info object.
+
+ The file to inspect.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Disposes the inspector.
+
+ True if was called directly.
+
+
+
+ A simple file type recognizer that does not perform any filtering
+ beyond that which is already specified by its associated traits.
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as "true" or "false".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as two digit hex values like "0xa5".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as literals like: "'x'" or "'\n'".
+
+
+
+
+
+
+
+
+
+
+
+ A default formatting rule for objects based on using the
+ to convert the value to a string.
+
+
+
+ This rule has minimum priority so that
+ all other formatting rules should override it in principle.
+
+
+
+
+
+ Creates a conversion to string formatting rule.
+
+ The converter to use.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values in the invariant round-trip format like: "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffzz".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as "dbnull".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values like: "5.6m".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as "\"key\": \"value\"".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values like: "5.6".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as "[1, 2, 3]".
+
+
+
+
+
+
+
+
+
+
+
+ Service locator for .
+
+
+
+ Handles the case where the runtime is not initialized by returning a
+ .
+
+
+
+
+
+ Gets the global formatter singleton.
+
+
+
+
+ Typical priority values to use as guidelines.
+
+
+
+
+ The default formatting rule priority.
+
+
+
+ A rule with this priority will be overridden by all other matching rules.
+
+
+
+
+
+
+ Generic rule priority.
+
+
+
+ Represents a generic rule that can represent objects
+ of any type structurally.
+
+
+ -20
+
+
+
+ Fallback rule priority.
+
+
+
+ Represents a rule to be applied if the typical case fails.
+
+
+ -10
+
+
+
+ Typical rule priority.
+
+
+
+ This is a good starting point for rule priorities.
+
+
+ 0
+
+
+
+ A better than typical rule.
+
+
+
+ This value should be used for cases where the typical rule is not quite precise enough.
+
+
+ 10
+
+
+
+ The best possible formatting rule priority.
+
+
+
+ A rule with this priority will override all other matching rules.
+
+
+
+
+
+
+ A formatting rule for , , ,
+ , , and .
+
+
+
+ Formats values like: "5", "123", "-12".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as "\"key\": \"value\"".
+
+
+
+
+
+
+
+
+
+
+
+ A rule-based formatter uses a set of s to
+ format values appropriately.
+
+
+
+
+ Creates a rule-based formatter.
+
+ The rules to use.
+ The entry point for framework extensions.
+ Thrown if is null.
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as two digit signed hex values like "0x55" and "-0x55".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values like: "5.6f".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as literals like: ""abc\ndef"".
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule that describes the structure of objects in terms of their constituent
+ properties and fields.
+
+
+
+ Describes the object using a format similar to a C# property initializer syntax.
+
+
+ {Foo.SomeType: Property = "Value", Field = "Other value"}
+
+
+
+
+
+
+
+
+
+
+
+ A formatter that is used when the runtime is not initialized.
+
+
+
+
+ Creates a stub formatter using only a few built-in formatting rules.
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values like: string, MyType.Nested, int[], byte*, similar to C#.
+
+
+
+
+
+
+
+
+
+
+
+ A formatting rule for .
+
+
+
+ Formats values as "<root />".
+
+
+
+
+
+
+
+
+
+
+
+ Specifies where a should store the temporary configuration file
+ it generates when it is being initialized.
+
+
+
+
+ Do not create a configuration file.
+
+
+
+
+ Stores the configuration file in the user's temporary directory.
+
+
+
+
+ Stores the configuration file in the application base directory of the hosted components.
+
+
+
+
+ Resolves runtime services.
+
+
+
+
+ Resolves a single component instance that implements a given service type.
+
+ The service type.
+ The component instance that implements the service.
+ Thrown if no component was found
+ or if a component could not be resolved.
+
+
+
+ Resolves a single component instance that implements a given service type.
+
+ The service type.
+ The component instance that implements the service.
+ Thrown if is null.
+ Thrown if no component was found
+ or if a component could not be resolved.
+
+
+
+ Resolves all component instances that implement a given service type.
+
+ The service type.
+ The list of component instances that implement the service.
+ Thrown if a component could not be resolved.
+
+
+
+ Resolves all component instances that implement a given service type.
+
+ The service type.
+ The list of component instances that implement the service.
+ Thrown if is null.
+ Thrown if a component could not be resolved.
+
+
+
+ Resolves a single component instance with a given component id.
+
+ The component id.
+ The component instance.
+ Thrown if no component was found
+ or if a component could not be resolved.
+ Thrown if is null.
+
+
+
+ Resolves a handle for a single component that implements a given service type.
+
+ The service type.
+ The traits type.
+ The handle for the component that implements the service.
+ Thrown if no component was found
+ or if a component could not be resolved.
+
+
+
+ Resolves a handle for a single component that implements a given service type.
+
+ The service type.
+ The handle for the component implements the service.
+ Thrown if is null.
+ Thrown if no component was found
+ or if a component could not be resolved.
+
+
+
+ Resolves handles for all components that implement a given service type.
+
+ The service type.
+ The traits type.
+ The list of handles of components that implement the service.
+ Thrown if a component could not be resolved.
+
+
+
+ Resolves handles for all components that implement a given service type.
+
+ The service type.
+ The list of handles of components that implement the service.
+ Thrown if is null.
+ Thrown if a component could not be resolved.
+
+
+
+ Resolves a handle for a single component with a given component id.
+
+ The component id.
+ The component handle.
+ Thrown if no component was found
+ or if a component could not be resolved.
+ Thrown if is null.
+
+
+
+ Returns true if the there is a service registered with the specified type and it has not been disabled.
+
+
+
+ When this method returns true it does not guarantee that there are any non-disabled components
+ registered that implement the service neither does it guarantee that those components can actually
+ be resolved without error.
+
+
+ The service type.
+ True if there is at least one component registered for the given service type.
+ Thrown if is null.
+
+
+
+ Returns true if there is a component registered with the given component id and it has not been disabled.
+
+
+
+ When this method returns true it does not guarantee that the component can actually be resolved
+ without error.
+
+
+ The component id.
+ True if there is a component registered with the given component id.
+ Thrown if is null.
+
+
+
+ A logger that dispatches log messages via events and listeners.
+
+
+
+
+ Adds a log listener that will receive log messages dispatched to the runtime logger.
+
+ The log listener to add.
+ Thrown if is null.
+
+
+
+ Removes a log listener so that it will no longer receive log messages dispatched to the runtime logger.
+
+ The log listener to remove.
+ Thrown if is null.
+
+
+
+
+
+
+ An event that is fired when a log message is received.
+
+
+
+
+ Event arguments for the
+
+
+
+
+ Creates a log event.
+
+ The log severity.
+ The log message.
+ The exception data, or null if none.
+ Thrown if is null.
+
+
+
+ Gets the log severity.
+
+
+
+
+ Gets the log message.
+
+
+
+
+ Gets the exception, or null if none.
+
+
+
+
+ Provides options that control the operation of the test runner.
+
+
+
+
+ Creates a default set of options.
+
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the options.
+
+ The copy.
+
+
+
+ Gets a read-only collection of configuration properties for the test runner.
+
+
+
+
+ Dispatches test runner events to listeners.
+
+
+
+ Each notification function ensures that the event is safely dispatched
+ via .
+
+
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Dispatches the event.
+
+ The event arguments.
+
+
+
+ Subscribes to another event object such that the events will be forwarded
+ to the handlers registered on this dispatcher.
+
+ The other events object.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Arguments for an event raised to indicate that a test step has finished execution.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ Thrown if ,
+ or is null.
+
+
+
+ Arguments for an event raised to indicate that a test step has entered a new lifecycle phase.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The lifecycle phase name.
+ Thrown if ,
+ , or is null.
+
+
+
+ Gets the lifecycle phase name.
+
+
+
+
+
+ Arguments for an event raised to indicate that an attachment has been embedded into a test step log stream.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The log stream name.
+ The name of the attachment that was embedded.
+ Thrown if ,
+ , , or is null.
+
+
+
+ Gets the name of the attachment that was embedded.
+
+
+
+
+ Arguments for an event raised to indicate that a block has been finished within a test step log stream.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The log stream name.
+ Thrown if ,
+ or is null.
+
+
+
+ Arguments for an event raised to indicate that a section has been started within a test step log stream.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The log stream name.
+ The name of the section that was started.
+ Thrown if ,
+ , , or is null.
+
+
+
+ Gets the name of the section that was started.
+
+
+
+
+ Arguments for an event raised to indicate that text has been written to a test step log stream.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The log stream name.
+ The text that was written.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets the text that was written.
+
+
+
+
+ Arguments for an event raised to indicate that an attachment has been added to a test step log.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The attachment.
+ Thrown if ,
+ or is null.
+
+
+
+ Gets the attachment.
+
+
+
+
+ Arguments for an event raised to indicate that a test step dynamically added metadata to itself.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ The metadata key.
+ The metadata value.
+ Thrown if ,
+ , or is null.
+
+
+
+ Gets the metadata key.
+
+
+
+
+
+ Gets the metadata value.
+
+
+
+
+ Arguments for an event raised to indicate that a test step has started execution.
+
+
+
+
+ Initializes the event arguments.
+
+ The report.
+ The test data.
+ The test step run.
+ Thrown if ,
+ or is null.
+
+
+
+ Allows control of command line parsing.
+
+
+
+ Attach this attribute to instance fields of types used
+ as the destination of command line argument parsing.
+
+
+ Command line parsing code from
+
+ Peter Halam .
+
+
+
+
+
+ Allows control of command line parsing.
+
+ Specifies the error checking to be done on the argument.
+
+
+
+ The error checking to be done on the argument.
+
+
+
+
+ Returns true if the argument did not have an explicit short name specified.
+
+
+
+
+ The short name of the argument.
+
+
+
+
+ Returns true if the argument did not have an explicit long name specified.
+
+
+
+
+ The long name of the argument.
+
+
+
+
+ The description of the argument.
+
+
+
+
+ The description of the argument value.
+
+
+
+
+ Gets or sets an array of additional synonyms that are silently accepted.
+
+
+
+
+ Used to control parsing of command line arguments.
+
+
+
+ Command line parsing code from
+
+ Peter Halam ,
+
+
+
+
+
+ Indicates that this field is required. An error will be displayed
+ if it is not present when parsing arguments.
+
+
+
+
+ Only valid in conjunction with Multiple.
+ Duplicate values will result in an error.
+
+
+
+
+ Inidicates that the argument may be specified more than once.
+ Only valid if the argument is a collection
+
+
+
+
+ The default type for non-collection arguments.
+ The argument is not required, but an error will be reported if it is specified more than once.
+
+
+
+
+ For non-collection arguments, when the argument is specified more than
+ once no error is reported and the value of the argument is the last
+ value which occurs in the argument list.
+
+
+
+
+ The default type for collection arguments.
+ The argument is permitted to occur multiple times, but duplicate
+ values will cause an error to be reported.
+
+
+
+
+ Parser for command line arguments.
+
+
+
+ The parser specification is infered from the instance fields of the object
+ specified as the destination of the parse.
+ Valid argument types are: int, uint, string, bool, enums
+ Also argument types of Array of the above types are also valid.
+
+
+ Error checking options can be controlled by adding a CommandLineArgumentAttribute
+ to the instance fields of the destination object.
+
+
+ At most one field may be marked with the DefaultCommandLineArgumentAttribute
+ indicating that arguments without a '-' or '/' prefix will be parsed as that argument.
+
+
+ If not specified then the parser will infer default options for parsing each
+ instance field. The default long name of the argument is the field name. The
+ default short name is the first character of the long name. Long names and explicitly
+ specified short names must be unique. Default short names will be used provided that
+ the default short name does not conflict with a long name or an explicitly
+ specified short name.
+
+
+ Arguments which are array types are collection arguments. Collection
+ arguments can be specified multiple times.
+
+
+ Command line parsing code adapted from
+
+ Peter Halam .
+
+
+
+
+
+ Creates a new command line argument parser.
+
+ The argument type containing fields decorated
+ with .
+ Thrown if is null.
+
+
+
+ Creates a new command line argument parser.
+
+ The argument type containing fields decorated
+ with
+ The delegate to use for reading response files instead of the default,
+ or null to disable reading from response files.
+ Thrown if is null.
+
+
+
+ Parses an argument list.
+
+ The arguments to parse.
+ The destination of the parsed arguments.
+ The error reporter.
+ True if no parse errors were encountered.
+
+
+
+ Prints a user friendly usage string describing the command line argument syntax.
+
+ The command line output.
+
+
+
+ Prints a user friendly usage string describing the command line argument syntax in a message box.
+
+ The message box caption.
+ Thrown if is null.
+
+
+
+ A delegate used in error reporting.
+
+
+
+ Command line parsing code from
+
+ Peter Halam ,
+
+
+
+
+
+ Responsible for creating output.
+
+
+
+
+ Initializes new instance of CommandLineOutput.
+
+ The console.
+
+
+
+ Initializes new instance of CommandLineOutput that outputs to specified stream.
+
+ Text writer.
+
+
+
+ Initializes new instance of CommandLineOutput that outputs to specified stream.
+
+ Text writer.
+ The output width.
+
+
+
+ Prints out a new line.
+
+
+
+
+ Outputs text with specified indentation.
+
+ Text to output possibly including newlines.
+ Number of blank spaces to indent the first line.
+
+
+
+ Outputs text with specified indentation.
+
+ Text to output possibly including newlines.
+ Number of blank spaces to indent all but the first line.
+ Number of blank spaces to indent the first line.
+
+
+
+ Prints help for a specified argument.
+
+ The argument prefix, such as "/", or null or empty if none.
+ The argument's long name, or null or empty if none.
+ The argument's short short name, or null or empty if none.
+ The argument's description, or null or empty if none.
+ The argument's value label such as "path", or null or empty if none.
+ The argument's value type, or null if none.
+
+
+
+ Output Stream
+
+
+
+
+ Maximum line length allowed before the text will be wraped.
+
+
+
+
+ A base class for implementing robust console applications.
+
+
+
+ The subclass should provide a Main method that creates an instance and
+ calls .
+
+
+
+
+
+
+
+
+ Runs the program.
+
+ The console.
+ The command-line arguments.
+ Thrown if
+ or is null.
+ Thrown if the program has already started running.
+
+
+
+ Runs the program.
+
+ The command-line arguments.
+ The program exit code.
+
+
+
+ Handles a fatal exception that escaped the method.
+
+ The exception.
+ The exit code to return.
+
+
+
+ Parses the arguments.
+
+ The command-line arguments.
+ True if the arguments were parsed successfully.
+
+
+
+ Displays an error message to the console.
+
+ The error message.
+
+
+
+ Displays help text to the console.
+
+
+
+
+ Gets the console, or null if the program is not running.
+
+
+
+
+ Gets or sets the parsed command-line arguments.
+
+
+
+ These argument may be modified prior to calling to
+ override the initial argument settings.
+
+
+ Thrown if is null.
+
+
+
+ Gets the argument parser.
+
+
+
+
+ Gets the command-line output formatter, or null if the program is not running.
+
+
+
+
+ Gets or sets the application name.
+
+ The name, by default this is the program assembly's name
+ Thrown if is null.
+
+
+
+ Gets or sets the application version.
+
+ The version, by default this is the program assembly's version derived
+ using .
+ Thrown if is null.
+
+
+
+ Get or sets the application title.
+
+ The title, by default this is constructed from the application's name and version
+ using .
+ Thrown if is null.
+
+
+
+ Indicates that this argument is the default argument.
+
+
+
+ '/' or '-' prefix only the argument value is specified.
+
+
+ Command line parsing code from
+
+ Peter Halam ,
+
+
+
+
+
+ Indicates that this argument is the default argument.
+
+ Specifies the error checking to be done on the argument.
+
+
+
+ When set to true, the default argument will consume any unrecognized command switches.
+ Otherwise an error will be thrown if an unrecognized switch is used.
+
+
+
+
+ A rich console provides a number of services that enable a console to be
+ shared among several cooperating tasks that are independently updating
+ different portions of the display.
+
+
+
+ One task can be writing to the main body of text while another updates a footer.
+
+
+ The rich console also supports intelligent cancelation of tasks. When
+ the user presses control-C, a cancelation flag is set and an event handler
+ is invoked. Tasks can check for the presence of the cancelation flag even if
+ they started execution after the control-C itself occurred. This provides
+ protection against dropped cancelation requests due to race conditions.
+ If the user presses control-C 3 times within a short interval
+ the rich console assumes that the program has become non-responsive and
+ terminates it.
+
+
+ Finally, the rich console interface can be mocked for testing purposes
+ unlike the standard API.
+
+
+
+
+
+ Resets the console colors.
+
+
+
+
+ Sets a pair of delegates that together display a footer at the bottom
+ of the console.
+
+
+
+ The footer can be hidden so that new text can be written
+ from that point. Removes the previous footer and displays the new
+ one automatically if the footer is visible.
+
+
+ A delegate to display the footer.
+ A delegate to hide the footer, leaving the custor at
+ the beginning of the line where the footer used to begin.
+
+
+
+ Writes a character.
+
+ The character to write.
+
+
+
+ Writes a string.
+
+ The string to write.
+
+
+
+ Writes a new line.
+
+
+
+
+ Writes a string followed by a new line.
+
+ The string to write.
+
+
+
+ Gets a synchronization object that a task can lock to ensure
+ that it is the only thread currently accessing the console.
+
+
+
+
+ Gets or sets whether the cancelation function is enabled.
+ If false, cancelation events will not be sent.
+
+
+
+
+ Gets or sets whether cancelation has occurred.
+
+
+
+ The event handlers will be called
+ when the value of transitions from
+ false to true. The value will remain true unless it is reset.
+
+
+
+
+
+ Returns true if the console is being redirected and therefore the
+ output should be as simple as possible.
+
+
+
+ In particular, it may not be possible to set the cursor position,
+ console color or other properties.
+
+
+ Trying to set the console color while output is redirected is tolerated
+ by the system and won't cause an error; but it is pointless. On the other
+ hand cursor positioning or attempting to listen to Ctrl-C will fail with an
+ .
+
+
+
+
+
+ Gets the error stream writer.
+
+
+
+
+ Gets the output stream writer.
+
+
+
+
+ Gets or sets the foreground color of the console.
+
+
+
+
+ Gets the zero-based column index the cursor is located at.
+
+ Thrown if is true.
+
+
+
+ Gets the zero-based row index the cursor is located at.
+
+ Thrown if is true.
+
+
+
+ Gets or sets the console's title.
+
+ Thrown if is true.
+
+
+
+ Gets the width of the console.
+
+
+
+ Returns 80 if the console is being redirected.
+
+
+
+
+
+ Gets or sets whether the footer is visible.
+
+
+
+
+ The event raised when console cancelation occurs.
+
+
+
+ If the console cancelation signal is already set when
+ an event handler is added, the event handler will be
+ automatically invoked.
+
+
+
+
+
+ An implementation of that targets the
+ native .
+
+
+
+ This implementation offers protection against redirection of the
+ and streams. This object will continue to refer to the
+ standard output and error streams even if they are redirected after its initialization.
+
+
+
+
+
+ The application will forcibly terminate if the cancel key is pressed
+ times within no more than
+ milliseconds.
+
+
+
+
+ The application will forcibly terminate if the cancel key is pressed
+ times within no more than
+ milliseconds.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the singleton instance of the native console.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reads the contents of a response file.
+
+ The response file name, never null.
+ The plain text contents of the file.
+
+
+
+ A logger that sends all output to the console and displays messages in color
+ according to their status.
+
+
+
+
+ Creates a logger.
+
+ The console.
+ Thrown if is null.
+
+
+
+
+
+
+ A configuration section handler for Gallio used to register
+ Gallio components in applications and in plugins.
+
+
+
+
+ The name of the Gallio section: "gallio".
+
+
+
+
+
+
+
+ Utilities for working with AppDomains.
+
+
+
+
+ Creates an AppDomain.
+
+ The application name for the new AppDomain, or null if none.
+ The application base directory for the new AppDomain, or null to use the current one.
+ The configuration file for the new AppDomain, or null to use the current one.
+ If true, enables shadow copying within the AppDomain.
+ The new AppDomain.
+
+
+
+ Creates a remote instance of a type within another AppDomain.
+
+
+ This method first uses to
+ try create an instance of the type. If that fails, it uses
+ to load the assembly that contains the type into the AppDomain then create an instance of the type.
+
+ The AppDomain in which to create the instance.
+ The type to instantiate.
+ The constructor arguments for the type.
+ The remote instance.
+ Thrown if or
+ is null.
+
+
+
+ Base implementation of that performs argument validation.
+
+
+
+
+ A host represents an environment that may be used to perform various
+ services in isolation.
+
+
+
+ For example, a host might provide the ability to run code in an isolated
+ of the current process, or it might run code
+ in an isolated process, or connect to an existing remote process.
+
+
+
+
+
+ Gets a host service that can be used to perform operations within the host's environment.
+
+ Thrown if the host has been disconnected.
+ Thrown if the host has been disposed.
+
+
+
+ Gets a deep copy of the host setup information.
+
+ Thrown if the host has been disposed.
+
+
+
+ Disconnects the host.
+
+ Thrown if the host has been disposed.
+
+
+
+ An event that is raised when the host is disconnected.
+ If the host has already been disconnected, the event is fired immediately.
+
+
+ Thrown if the host has been disposed.
+
+
+
+ Returns true if the host is local to the creating AppDomain, false if it
+ must be accessed across a remote channel.
+
+
+
+ A local host might not support all configuration options.
+
+
+
+
+
+ Returns true if the host is connected.
+
+
+
+ A host may become disconnected non-deterministically due to a failure in the
+ host's communication channel or some other remote eventuality.
+
+
+ Thrown if the host has been disposed.
+
+
+
+ Creates a host.
+
+ The host setup.
+ The logger for host message output.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+ Initializes the host and connects to the host service.
+
+ Thrown if the host has already been initialized.
+ Thrown if the host has been disposed.
+ Thrown if an exception occurred while connecting to the host.
+
+
+
+
+
+
+
+
+
+ Gets the host service.
+
+ The host service, or null if the host service was not available.
+
+
+
+ Releases the host service.
+
+ The host service that is being released, not null.
+
+
+
+ Disposes the host.
+
+ True if disposing.
+
+
+
+ Throws an exception if the host has been disposed.
+
+
+
+
+ Sets the state of the host to disconnected and notifies clients.
+
+
+
+
+ Attaches the debugger to a process if the host settings require it.
+
+
+
+
+ Detaches the debugger from a process if the host settings require it.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets an reference to the host service, or null if not connected.
+
+
+
+
+ Gets the internal host setup information without copying it.
+
+
+
+
+ Gets the logger.
+
+
+
+
+ Base implementation of that performs argument validation.
+
+
+
+
+ A host service enables a local client to interact with a remotely
+ executing hosting environment.
+
+
+
+ A host service implementation may choose to implement a keep-alive
+ mechanism to automatically shut itself down when the service is disposed or
+ when it has not received a ping within a set period of time.
+
+
+
+
+
+ Pings the host to verify and maintain connectivity.
+
+ Thrown if the remote host is unreachable.
+
+
+
+ Asks the host to perform the specified action remotely.
+
+
+
+ The action must be a serializable delegate so that it can be sent
+ to the host and executed. Generally speaking, this means it must either be
+ a delegate for a static method or its target object must be serializable.
+ The argument and result values must also be serializable (or null).
+
+
+ The action to perform.
+ The argument value, if any.
+ The result value, if any.
+ The argument type.
+ The result type.
+ Thrown if is null.
+
+
+
+ Creates an instance of a remote object given an assembly name and type name.
+
+ The name of assembly that contains the type.
+ The full name of the type.
+ The object handle of the instance.
+ Thrown if or
+ is null.
+
+
+
+ Creates an instance of a remote object given an assembly path and type name.
+
+ The path of assembly that contains the type.
+ The full name of the type.
+ The object handle of the instance.
+ Thrown if or
+ is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Internal implementation of .
+
+ The action to perform, not null.
+ The argument value, if any.
+ The result value, if any.
+ The argument type.
+ The result type.
+
+
+
+ Internal implementation of .
+
+
+
+
+ Internal implementation of .
+
+ The assembly name, not null.
+ The type name, not null.
+ The created object handle.
+
+
+
+ Internal implementation of .
+
+ The assembly path, not null.
+ The type name, not null.
+ The created object handle.
+
+
+
+ Disposes the host service.
+
+ True if disposing.
+
+
+
+ Throws an exception if the host service has been disposed.
+
+
+
+
+ Provides utilities for working with hosts.
+
+
+
+
+ Creates an instance of an object within a host.
+
+ The host in which to create the object.
+ The type of object to create.
+ The object instance.
+ Thrown if is null.
+
+
+
+ Creates an instance of an object within a host.
+
+ The host in which to create the object.
+ The type of object to create.
+ The object instance.
+ Thrown if
+ or is null.
+
+
+
+ A specialization of host service designed for hosts that are remotely managed.
+
+
+
+
+ Remotely shuts down the host service.
+
+
+
+
+ An implementation of that runs code
+ locally within the current AppDomain.
+
+
+
+
+ Creates a local host.
+
+ The host setup.
+ The logger for host message output.
+ The debugger manager.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A factory for initialized hosts.
+
+
+
+
+ An abstract base class for host factories.
+
+
+
+
+ A host factory encapsulates a policy for creating new instances.
+
+
+
+
+ Creates a host instance.
+
+ The host setup.
+ The logger for host message output.
+ The newly created host.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ Creates the host.
+
+ The canonicalized host setup, non-null.
+ The logger, non-null.
+ The host.
+
+
+
+ Gets the component Id of this factory.
+
+
+
+
+ Creates a host factory.
+
+ A reference to the debugger manager.
+ Thrown if is null.
+
+
+
+
+
+
+ Initializes the Gallio assembly loading a runtime policies.
+
+
+
+ This type is used only by the standalone Gallio.Loader assembly using late-binding.
+ It should not be used by any other code.
+
+
+
+
+
+ Bootstraps a globally reachable assembly loader within the Gallio installation path.
+
+
+
+ May be used by clients to ensure that Gallio assemblies can be resolved assuming we
+ were able to load the main assembly and access the bootstrap.
+
+
+
+
+
+ Installs a global assembly resolver given the specified runtime path.
+
+ The Gallio runtime path.
+ Thrown if is null.
+
+
+
+ Gets the bootstrapped assembly loader.
+
+ Thrown if the bootstrap assembly loader has not been initialized.
+
+
+
+ Filters another logger to exclude messages below a given level of severity.
+
+
+
+
+ Creates a filtered logger.
+
+ The logger to which filtered log messages are sent.
+ The lowest severity message type to retain.
+ Thrown if is null.
+
+
+
+ Creates a filtered logger.
+
+ The logger to which filtered log messages are sent.
+ The verbosity to use.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the minimum severity of the messages that are included in the filtered log.
+
+
+
+
+ Describes the severity of a log message.
+
+
+
+
+ The severity used for debug messages.
+
+
+
+
+ The severity used for informational messages.
+
+
+
+
+ The severity used for important messages.
+
+
+
+
+ The severity used for warning messages.
+
+
+
+
+ The severity used for error messages.
+
+
+
+
+ The Gallio.Runtime.Logging namespace contains types for logging diagnostic output.
+
+
+
+
+ A null implementation of that does nothing.
+
+
+
+
+ Gets a singleton instance of the null logger.
+
+
+
+
+
+
+
+ The severity prefix logger wraps another loggers and encodes the severity of a
+ log entry into the log message itself in a standard form.
+
+
+
+ This wrapper is useful when the base logger may not be able to
+ report the severity via other means or when severity information must be
+ reconstructed from plain text.
+
+
+
+
+
+
+ Creates a prefix logger.
+
+ The inner logger.
+ Thrown if is null.
+
+
+
+
+
+
+ Parses severity information from log messages encoded by .
+
+
+
+
+
+ Parses a line of log data.
+
+ The line of log data to parse.
+ Set to the severity of the message extracted from the line.
+ The message extracted from the line.
+ True if the message included a severity, false otherwise.
+ Thrown if is null.
+
+
+
+ A logger that writes output to a .
+
+
+
+ To include severity information in the output, wrap this logger with a .
+
+
+
+
+
+ Creates a text logger.
+
+ The text writer to which the log output should be written.
+
+
+
+
+
+
+ Specifies the verbosity of the output.
+
+
+
+
+ Will only display Error and Warning messages.
+
+
+
+
+ Will display Important, Warning and Error messages.
+
+
+
+
+ Will display all messages, except Debug.
+
+
+
+
+ Will display all messages.
+
+
+
+
+ Describes the kind of process that is executing.
+
+
+
+
+
+ The process is running in the console.
+
+
+
+
+ The process is running interactively.
+
+
+
+
+ The process is running as a Windows service.
+
+
+
+
+ A null message sink discards all messages sent to it.
+
+
+
+
+ Gets the singleton instance of the null message sink.
+
+
+
+
+
+
+
+ Wraps a and queues messages so that messages are
+ published asynchronously.
+
+
+
+
+ Creates a queued message sink.
+
+ The message sink to wrap.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Flushes the queue.
+
+
+
+
+ Wraps a so that messages can be sent remotely.
+
+
+
+
+ Creates a remote message sink.
+
+ The message sink to wrap.
+ Thrown if is null.
+
+
+
+
+
+
+ An exception thrown during a messaging failure.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Notifies that a diagnostic log message has been submitted.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the log severity.
+
+
+
+
+ Gets or sets the log message.
+
+
+
+
+ Gets or sets the exception, or null if none.
+
+
+
+
+ The Gallio.Runtime namespace contains types that define the component model, extensibility
+ mechanism and core services used throughout the Gallio infrastructure.
+
+
+
+
+ An implementation of based on files.
+
+
+
+
+ Stores and retrieves user and machine preferences.
+
+
+
+ For the API related to defining new preference panes and control panels
+ refer to the types in the Gallio.UI assembly.
+
+
+
+
+
+
+
+ Gets a preference store for the current local user.
+
+
+
+ These preferences are stored in the user's local application data directory.
+
+
+
+
+
+ Gets a preference store for the current roaming user.
+
+
+
+ These preferences are stored in the user's roaming application data directory.
+
+
+
+
+
+ Gets a preference store common to all users of this system.
+
+
+
+ These preferences are stored in the system's common application data directory.
+
+
+ All users can read common preferences but only administratators may
+ edit them. Moreover privilege elevation may be required on Vista and
+ more recent Windows OS's.
+
+
+
+
+
+
+ Initializes the preference manager.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A preference set implementation based on storing preference settings within a file.
+
+
+
+
+ Represents a set of related preference settings.
+
+
+
+
+
+
+ Obtains a reader for the preference set.
+
+ The read action which is provided with the reader.
+ Thrown if is null.
+
+
+
+ Obtains a reader for the preference set.
+
+ The read function which is provided with the reader.
+ The result of the read function.
+ The read function result type.
+ Thrown if is null.
+
+
+
+ Obtains a writer for the preference set.
+
+ The write action which is provided with the reader.
+ Thrown if is null.
+
+
+
+ Obtains a writer for the preference set.
+
+ The write function which is provided with the reader.
+ The result of the write function.
+ The write function result type.
+ Thrown if is null.
+
+
+
+ Creates a file preference set.
+
+ The preference set file.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the preference set file.
+
+
+
+
+ Provides operations for reading preference settings within preference sets.
+
+
+
+
+ Gets a preference setting.
+
+ The preference setting key.
+ The setting value or default(T) if none.
+ The setting value type.
+
+
+
+ Gets a preference setting.
+
+ The preference setting key.
+ The default value to return in case the setting does not exist.
+ The setting value or if none.
+ The setting value type.
+
+
+
+ Returns true if the preference set contains a preference setting.
+
+ The preference setting key.
+ True setting exists.
+
+
+
+ Provides operations for writing preference settings.
+
+
+
+
+ Sets a preference setting.
+
+ The preference setting key.
+ The value to set, or null to remove the value.
+ The setting value type.
+
+
+
+ Removes a preference setting.
+
+ The preference setting key.
+
+
+
+ A preference store implementation based on storing preference sets as files within a directory.
+
+
+
+
+ Stores and retrieves the contents of preference sets.
+
+
+
+
+
+
+ Gets the preference set with the specified name.
+
+ The name of the preference set.
+ The preference set.
+ Thrown if is null.
+ Thrown if is empty.
+
+
+
+ Creates a file preference store.
+
+ The preference store directory.
+ Thrown if is null.
+
+
+
+ Gets the preference store directory.
+
+
+
+
+
+
+
+ The Gallio.Runtime.Preferences namespace contains types for loading and
+ saving user preferences.
+
+
+
+
+ The Gallio.Runtime.Preferences.Schema namespace contains the preference store Xml schema.
+
+
+
+
+ Abstract base class for objects whose purpose is to present progress
+ information to the user.
+
+
+
+
+ A progress monitor presenter attaches a progress monitor to a view.
+
+
+
+
+ Presents an observable progress monitor.
+
+ The progress monitor to present.
+ Thrown if is null.
+ Thrown if the presenter does not support being
+ reused to present multiple progress monitors.
+
+
+
+
+
+
+ Initializes the presenter after a progress monitor has been attached.
+
+
+
+
+ Gets the attached progress monitor.
+
+
+
+
+ An abstract base class to assist with the implementation of conformant
+ classes.
+
+
+
+
+ A progress monitor provider runs a task with progress monitoring
+ and provides clear notification of cancelation in the form of
+ an .
+
+
+
+
+ Runs a task with a progress monitor.
+
+
+
+ The provider should automatically dispose of the progress monitor
+ in case the task forgets to do so. It is also responsible for calling
+ before and after running
+ the task to ensure that the is
+ thrown as required.
+
+
+ The provider can choose to execute the task in a different thread
+ but the method should still complete synchronously.
+
+
+ The task to run, never null.
+ Thrown if the task is canceled.
+
+
+
+ Runs a task which returns a result with a progress monitor.
+
+
+
+ The provider should automatically dispose of the progress monitor
+ in case the task forgets to do so. It is also responsible for calling
+ before and after running
+ the task to ensure that the is
+ thrown as required.
+
+
+ The provider can choose to execute the task in a different thread
+ but the method should still complete synchronously.
+
+
+ The task to run, never null.
+ Thrown if the task is canceled.
+ The type of the result returned by the task.
+
+
+
+
+
+
+
+
+
+ Gets a presenter for the progress monitor.
+
+ The presenter.
+
+
+
+ An abstract base class for progress monitors that implements the cancelation
+ semantics only.
+
+
+
+
+ A progress monitor provides facilities for core functionality to report
+ progress of a long running operation.
+
+
+
+ The interface is typically implemented by a UI component such as a progress dialog.
+
+
+ This interface is inspired from IProgressMonitor in the Eclipse API
+ and was derived from the Castle.FlexBridge client-side components.
+
+
+ This interface is mostly not safe for use by multiple concurrent
+ threads. Do not share a progress monitor instance across threads!
+ for special rules regarding the handling
+ of the cancelation event.
+
+
+ The method returns a
+ which implements as a convenience for use
+ with the C# "using" statement. Disposing the cookie is precisely equivalent to
+ calling the method of the progress monitor.
+
+
+
+
+
+
+
+
+ Notifies that the main task is starting.
+
+
+
+ Must be called at most once on the progress monitor.
+
+
+ Not safe for use by multiple concurrent threads.
+
+
+ The name of the task being monitored.
+ The total number of work units to perform. Must
+ be greater than 0, or if an indeterminate amount
+ of work is to be performed.
+ An object that calls when disposed.
+ Thrown if is null.
+ Thrown if is not valid.
+ Thrown if or have already been called.
+
+
+
+ Sets detailed status information for the current task or subtask.
+
+
+
+ A status message is an optional fine-grained description of the current
+ activity being performed. For instance, a status message might specify
+ the name of a file being copied as part of a task that copies many files.
+
+
+ Not safe for use by multiple concurrent threads.
+
+
+ The name of the current subtask.
+ Thrown if is null.
+ Thrown if the task is not running.
+
+
+
+ Notifies that a given number of work units of the main task
+ have been completed.
+
+
+
+ Note that this amount represents an installment,
+ as opposed to a cumulative amount of work done to date. If the sum of this
+ value and the currently completed work units exceeds the total work units
+ to be performed, the excess portion is discarded.
+
+
+ Not safe for use by multiple concurrent threads.
+
+
+ The number of work units completed so far. Must be
+ a finite value greater than or equal to 0.
+ Thrown if is not valid.
+ Thrown if the task is not running.
+
+
+
+ Notifies that the operation is to be canceled.
+
+
+
+ The method always causes the flag to be
+ set, even if the operation is already done.
+
+
+ It is safe to call this method before in which
+ case the task will begin in an already canceled state.
+
+
+ Not safe for use by multiple concurrent threads.
+
+
+
+
+
+ Notifies that the work is done, either the main task is completed
+ was cancelled by the user. If already done, the method has no effect.
+
+
+
+ This method automatically sets the amount of work remaining to zero.
+ It also sets the amount of work completed to the total unless it was
+ indeterminate or was never called.
+
+
+ It is safe to call this method without calling
+ first in which case the task is immediately completed without ever
+ having run. However, may not subsequently be
+ called.
+
+
+ If there are any currently active subtasks, they are automatically
+ ended by this method exactly as if each subtask's
+ had been notified that the work was done. This policy simplifies error
+ recovery in situations where the main task may have been abruptly aborted
+ without proper cleanup of its subtasks such as when severe exceptions occur.
+ It is preferable to tolerate the error rather than to exacerbate it by enforcing
+ stricter rules on subtasks.
+
+
+
+
+
+ Creates a sub-progress monitor that represents a given number of
+ work-units as a sub-task of this progress monitor.
+
+
+
+ Using sub-tasks allows multiple tasks to be composed into longer sequences
+ that each contribute a predetermined portion of the total work.
+
+
+ As the sub-task performs work its parent task is notified of progress
+ in proportion to the number of work units that it represents. Likewise the
+ parent is notified of cancelation if the child is canceled and vice-versa.
+
+
+ It it still necessary to call on the
+ sub-progress monitor to begin processing the sub-task.
+
+
+ The total number of work units of the parent task
+ that are to be represented by the sub-task. When the sub-task completes, this much
+ work will have been performed on the parent.
+ Must be a finite value greater than or equal to 0.
+ Thrown if is not valid.
+
+
+
+ Throws an if the operation
+ has been canceled.
+
+ Thrown if is true.
+
+
+
+ Adds or removes an event handler to be called when the operation is canceled.
+
+
+
+ If the operation has already been canceled, then the event handler will be
+ called immediately.
+
+
+ Because the event may be delivered on a different thread from
+ the one executing the main task, it is an error for the handler
+ of this event to call any methods of this .
+ Instead it should simply notify its main task to quit if possible
+ (possibly by interrupting the main task's thread). Thus when the
+ main task terminates, it will call itself
+ to clean up.
+
+
+ The event handler should not block or throw exceptions. If it
+ must perform any possibly long-running tasks of its own (such as
+ synchronizing with processing threads) it should queue up an
+ asynchronous task (possibly using the ).
+
+
+ Unlike the other members of this interface, adding and removing event
+ handlers is safe for use by multiple concurrent threads.
+
+
+
+
+
+ Returns true if the operation has been canceled.
+
+
+
+ Clients should poll this value periodically or listen for the
+ event to ensure the operation is
+ canceled in a timely fashion.
+
+
+ Not safe for use by multiple concurrent threads.
+
+
+
+
+
+
+
+
+
+
+
+ Disposes the progress monitor, including cleaning up an marking as
+ the current task, if any.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Notifies that the task has actually been canceled.
+
+
+
+ If this is the first time has been called,
+ sets to true and fires the event.
+ Otherwise does nothing.
+
+
+ This is the ONLY method of the progress monitor that is allowed to
+ be called concurrently from multiple threads. It needs to be this
+ way so that cancelation can be initiated by either participant in the
+ progress monitoring dialog.
+
+
+ True if cancelation has just occurred, false if no
+ state change was performed.
+
+
+
+ Called when performs its updates.
+
+
+
+ This method is not called by .
+
+
+
+
+
+ Disposes the progress monitor, including cleaning up an marking as
+ the current task, if any.
+
+ True if was called.
+
+
+
+
+
+
+
+
+
+ Displays progress by writing a series of messages to an as the name
+ of the current task changes.
+
+
+
+
+ Create a logged progress monitor presenter.
+
+ A logger instance to which messages will be written.
+ Thrown if is null.
+
+
+
+
+
+
+ Displays progress by writing a series of messages to an as the name
+ of the current task changes.
+
+
+
+
+ Creates a log progress monitor provider.
+
+ The logger to which messages should be written.
+ Thrown if is null.
+
+
+
+
+
+
+ The Gallio.Runtime.ProgressMonitoring namespace contains types for reporting
+ progress from long-running operations.
+
+
+
+
+ Creates instances of null progress monitors that do nothing.
+
+
+
+
+ Creates a null progress monitor.
+
+ The null progress monitor.
+
+
+
+ A null progress monitor presenter simply does nothing.
+
+
+
+
+ Gets the singleton instance of the presenter.
+
+
+
+
+
+
+
+ Runs tasks without reporting any progress.
+
+
+
+ Argument validation and state changes are still noted but they do not have any outward effect.
+
+
+
+
+
+
+
+
+ Gets the singleton instance of the provider.
+
+
+
+
+ An observable progress monitor tracks validates arguments and tracks the state
+ of the progress monitor but it does not implement any of its own behavior in response
+ to the notifications received.
+
+
+
+ Instead, it is intended to be observed by a presenter that
+ translates state change events into changes of the view.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Called after performs its updates.
+
+ The task name.
+ The total number of work units.
+
+
+
+ Called when performs its updates.
+
+
+
+
+ Called when performs its updates.
+
+
+
+
+ Called when performs its updates.
+
+ The status message.
+
+
+
+ Called when the active sub-task performs its updates.
+
+ The sub-task's progress monitor.
+
+
+
+ Called when performs its updates.
+
+ The sub-task's progress monitor.
+
+
+
+ Called when performs its updates.
+
+ The sub-task's progress monitor.
+
+
+
+ Called when a state change occurs.
+
+
+
+
+ Called when a new progress monitor is created.
+
+
+
+
+
+
+
+ Begins a sub-task in a sub-progress monitor.
+
+ The sub-progress monitor.
+
+
+
+ Ends a sub-task in a sub-progress monitor.
+
+ The sub-progress monitor.
+
+
+
+ Called when a subtask changes in any way, including one of its own subtasks changing.
+
+ The sub-progress monitor.
+
+
+
+ Adds or removes an event handler that is called whenever the state of the progress
+ monitor changes in any way.
+
+
+
+
+ Adds or removes an event handler that is called when the task is starting.
+
+
+
+
+ Adds or removes an event handler that is called when the task is finished.
+
+
+
+
+ Adds or removes an event handler that is called whenever a new sub-progress monitor
+ is created so that the observer can attach its event handlers.
+
+
+
+
+ Returns true if has been called and
+ has not yet also been called.
+
+
+
+ This property is not affected by cancelation.
+
+
+
+
+
+ Returns true if has been called.
+
+
+
+ This property is not affected by cancellation.
+
+
+
+
+
+ Gets the total number of work units to perform, or
+ NaN to indicate that an indeterminate amount of work is
+ to be performed.
+
+
+
+ Returns if has not been called.
+
+
+
+
+
+ Gets the number of work units completed so far.
+
+
+
+ It is the sum of all values passed to the method while
+ the task has been running. This value is never NaN because at each
+ step a finite amount of work must be recorded.
+
+
+ Returns 0 if and have
+ not been called.
+
+
+
+
+
+ Gets the number of remaining work units to perform, or .
+
+
+
+ is returned to to indicate that an indeterminate amount of
+ work remains to be performed because is
+ and the operation is not done.
+
+
+ Returns if has not been called.
+
+
+
+
+
+ Gets the name of the task or an empty string if has
+ not been called.
+
+
+
+
+ Gets the current status message set by or an empty
+ string by default.
+
+
+
+
+ Gets the active child sub-progress monitor, or null if none.
+
+
+
+
+ Gets the currently active leaf sub-progress monitor, or this one if there are
+ no sub-progress monitors.
+
+
+
+
+ Gets the name of the most deeply nested sub-task, or an empty string if
+ there are no sub-progress monitors.
+
+
+
+
+ Gets the status of the most deeply nested sub-task, or the status of this
+ task if there are no sub-progress monitors.
+
+
+
+
+ A standard sub-progress monitor implementation that notifies its parent as work is performed.
+
+
+
+
+ Creates a sub-progress monitor.
+
+ The parent progress monitor.
+ The total number of work units of the parent task
+ that are to be represented by the sub-task.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A remote progress monitor is a serializable wrapper for another progress monitor.
+
+
+
+ The wrapper can be passed to another AppDomain and communication occurs over
+ .Net remoting.
+
+
+ The implementation is defined so as to guard against latency and failures
+ in the remoting channel.
+
+
+ for important thread-safety and usage remarks.
+
+
+
+ Creates a wrapper for the specified progress monitor.
+
+ The progress monitor.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Forwards messages to the host's progress monitor.
+
+
+
+
+ Dispatches events to the remote progress monitor.
+
+
+
+
+ A console progress monitor presenter displays a simple tally of the amount of work
+ to be done on the main task as a bar chart.
+
+
+
+ The progress monitor responds to cancelation events at the console.
+
+
+
+
+
+ Creates a console presenter for a progress monitor.
+
+ The console.
+ Thrown if is null.
+
+
+
+
+
+
+ It can happen that we'll receive all kinds of weird input because
+ task names and status messages can be derived from user-data.
+
+
+
+ Make sure it doesn't corrupt the display integrity.
+
+
+
+
+
+ A console progress monitor displays a simple tally of the amount of work
+ to be done on the main task as a bar chart.
+
+
+
+ The progress monitor responds to cancelation events at the console.
+
+
+
+
+
+ Creates a rich console progress monitor provider.
+
+ The console to which messages should be written.
+ Thrown if is null.
+
+
+
+
+
+
+ Provides a reference to the newly created sub-progress monitor.
+
+
+
+
+ Creates an event object.
+
+ The new sub-progress monitor.
+ Thrown if is null.
+
+
+
+ Gets the newly created sub-progress monitor.
+
+
+
+
+ Represents a task to be executed with a progress monitor.
+
+ The progress monitor, never null.
+
+
+
+ Represents a task to be executed with a progress monitor.
+
+ The progress monitor, never null.
+ The type of the result returned by the task.
+
+
+
+ A progress monitor task cookie represents a task in progress.
+
+
+
+ When it is disposed, the corresponding 's
+ method is called.
+
+
+
+
+
+ Creates an object representing a task in progress.
+
+ The progress monitor.
+ Thrown if is null.
+
+
+
+ Marks the task as finished.
+
+
+
+ Equivalent to calling on the associated .
+ This method is provded as a convenience for use with the C# using statement.
+
+
+
+
+
+ A service locator implementation based on a registry.
+
+
+
+
+ Creates a service locator based on a registry.
+
+ The registry.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the registry.
+
+
+
+
+ Abstract base class for an aggregate data set that combines a list of data
+ sets according to some algorithm.
+
+
+
+
+ Adds a data set to the aggregate.
+
+ The data set to add.
+ Thrown if is null.
+ Thrown if is already a member of this aggregate.
+
+
+
+ Gets the immutable list of combined data sets.
+
+
+
+
+ A data set constructed from an enumerated sequence of values.
+
+
+
+
+ Creates a column sequence data set with optional metadata.
+
+ The sequence of column values, each generating an item.
+ The metadata key/value pair enumeration, or null if none.
+ True if the sequence is dynamic.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ The combinatorial join strategy combines items by constructing the cartesian
+ product of the items of each provider.
+
+
+
+
+
+ A join strategy combines items from multiple providers into products
+ according to some algorithm.
+
+
+
+ A join strategy performs much the same purpose as a "JOIN" in
+ query languages. It specifies how items from multiple providers are to
+ be correlated to create a sequence of aggregate items.
+
+
+
+
+
+
+ Joins the items from each provider into a sequence of aggregate items.
+
+
+
+ The number of elements in each item-list must equal the number
+ of providers in the list because
+ each item-list should contain exactly one item taken from each
+ provider.
+
+
+ The list of providers.
+ The list of bindings per provider.
+ If true, includes items that may be dynamically
+ generated in the result set. Otherwise excludes such items and only returns
+ those that are statically known a priori.
+ An enumeration of item-lists consisting of exactly one item from
+ each provider and indexed in the same order as the
+ collection.
+
+
+
+ Gets the singleton instance of the strategy.
+
+
+
+
+
+
+
+ The concatenation merge strategy combines the items from multiple providers
+ by simply concatenating the items in the order in which they
+ appear and proceeding from one provider to the next until all providers
+ have been fully processed.
+
+
+
+
+ A merge strategy combines items from multiple providers into a sequence
+ according to some algorithm.
+
+
+
+ A merge strategy performs much the same purpose as a "UNION" or other
+ combinator in query languages. It specifies how to select items among
+ multiple providers to create an aggregate sequence of items.
+
+
+
+
+
+
+ Merges the items from each provider into a new sequence.
+
+ The list of providers.
+ The bindings.
+ If true, includes items that may be dynamically
+ generated in the result set. Otherwise excludes such items and only returns
+ those that are statically known a priori.
+ The merged sequence of items.
+
+
+
+ Gets the singleton instance of the strategy.
+
+
+
+
+
+
+
+ A CSV data set retrieves fields from a CSV document as strings.
+
+
+
+ If the CSV document has a header, then it is interpreted as the names of the
+ columns. Columns with names in brackets, such as "[ExpectedException]",
+ are interpreted as containing metadata values associated with the named key.
+
+
+
+
+
+ Creates a CSV data set.
+
+ A delegate that provides the text reader for reading the CSV document on demand.
+ True if the data set should be considered dynamic.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets the name of the location that is providing the data, or null if none.
+
+
+
+ The data location name and line number are exposed as
+ metadata when provided.
+
+
+
+ The default value is null.
+
+
+
+
+ Gets or sets the field delimiter character.
+
+
+ The default value is ',' (comma).
+
+
+
+
+ Gets or sets a character that indicates that a line in the source represents a comment.
+ May be set to '\0' (null) to disable comment handling.
+
+
+
+ Comment lines are excluded from the record set.
+
+
+
+ The default value is '#' (pound).
+
+
+
+
+ Gets or sets whether the CSV document has a header that should be used to provide
+ aliases for indexed columns.
+
+
+ The default value is 'false' which indicates that the file does not have a header.
+
+
+
+
+
+
+
+ Reads data from a Comma Separated Values document.
+
+
+
+ The document format simply consists of sequential lines of delimited field values.
+
+ - The standard delimiter is ',' (comma) but it may be overridden using
.
+ - Empty lines are considered to be records with one empty field.
+ - Lines that begin with a special
are excluded from the record set.
+ - Field values may be quoted using '"' (quote) characters. The quotes will be omitted from the record set.
+ Quotes may be escaped by doubling them within a quoted field.
+ - Unbalanced quotes are tolerated but may produce unexpected results.
+ - Excess whitespace is trimmed unless quoted.
+ - The document may contain a header consiting of field names but the reader does not interpret it in any
+ special way. It will simply be returned to the client as an ordinary record.
+
+
+
+
+
+
+ Creates a CSV reader.
+
+ The text reader from which to read the contents of the document.
+ Thrown if is null.
+
+
+
+ Closes the reader.
+
+
+
+
+ Reads the list of fields that belong to the next record in the document.
+ Returns null at the end of the document.
+
+ The record contents as an array of field values, or null if at the end of the document.
+ Thrown if an I/O error occurs.
+
+
+
+ Gets or sets the field delimiter character.
+
+
+ The default value is ',' (comma).
+
+
+
+
+ Gets or sets a character that indicates that a line in the source represents a comment.
+ May be set to '\0' (null) to disable comment handling.
+
+
+
+ Comment lines are excluded from the record set.
+
+
+
+ The default value is '#' (pound).
+
+
+
+
+ Gets the 1-based line number of the previously returned record,
+ or 0 if no lines have been read yet.
+
+
+
+
+ A data binding object describes how a data binding is to take place.
+
+
+
+ This class provides support for optional path-based and index-based lookup. Subclasses
+ may provide additional properties that are recognized by special kinds of data sets
+ to modify how a bound value is resolved.
+
+
+
+
+
+ Creates a new data binding with an optional index and path.
+
+ The binding index or null if none. .
+ The binding path or null if none. .
+
+
+
+ Creates a clone of the data binding with a different index.
+
+ The new index.
+ The cloned binding.
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a debug representation of the binding as a string.
+
+ The string representation.
+
+
+
+ Gets an optional binding index that describes how to locate the bound value
+ in a data set that is structured as an ordered tuple, such as the ordinal index
+ of a cell in an array. Null if none.
+
+
+
+ The default binding index for a test parameter may be its ordinal index
+ in the parameter array. A data set can take advantage of this convention by
+ treating the binding index.
+
+
+
+
+
+ Gets an optional binding path that describes how to locate the bound value
+ in the data set, such as a column name or an XPath expression. Null if none.
+
+
+
+ The default binding path for a test parameter may be the name of the test parameter.
+ A data set can take advantage of this convention by treating the binding path as a
+ case-insensitive name where appropriate.
+
+
+
+
+
+ The type of exception thrown when data binding operations fail.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception with an associated data binding.
+
+ The message.
+ The associated data binding, or null if none.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception with an associated data binding.
+
+ The message.
+ The associated data binding, or null if none.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ An data source object provides a simple way of aggregating data sets
+ together. It also provides a simple translation mechanism for mapping
+ binding paths to binding indexes which is useful for providing named
+ aliases for columns in indexed data sets.
+
+
+
+
+ A merged data set is an aggregate data set that selects items from each of zero or more
+ other data sets according to a .
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the .
+
+
+
+ By default the strategy is .
+
+
+ Thrown if is null.
+
+
+
+
+
+
+ Creates a data source with a given name.
+
+ The name of the data source, or an empty string if it is anonymous.
+ Thrown if is null.
+
+
+
+ Adds an alias for a binding path to map it to the specified index.
+
+ The binding path to match in a case-insensitive manner.
+ The associated index to use instead.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets the name of the data source, or an empty string if it is anonymous.
+
+
+
+
+ A data source table manages a collection of named data sources.
+
+
+
+
+ Resolves data sources by name.
+
+
+
+
+ Resolves the data source with the specified name.
+
+ The data source name.
+ The resolved data source, or null if none found.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ A data binding specification describes how values are bound to slots ( )
+ of a type or method. The specification can then be used to create new objects or invoke
+ methods.
+
+
+
+ A specification automatically converts values to the correct types
+ for data binding using a . It can also format
+ the specification to a string using a .
+
+
+
+
+
+
+ Creates a data binding spec.
+
+ The slot values.
+ The converter to use for converting slot values
+ to the required types.
+ Thrown if
+ or is null or if
+ contains a null slot.
+
+
+
+ Formats the specification to a string for presentation.
+
+
+
+ The values are listed sequentially as follows:
+
+ - The
.
+ - The
slot values, if any, are ordered by index
+ and enclosed within angle bracket.
+ - The
slot values, if any, are ordered by index
+ and enclosed within parentheses.
+ - All other slot values, if any, are sorted by name and formatted as name-value
+ pair assignments following a colon and delimited by a comma
+
+ Example: 'SomeType<int, string>(42, "deep thought"): Author="Douglas Adams", Book="HGTTG"'.
+
+
+ If there are no slots of a given kind, then the enclosing angle brackets or
+ parentheses are ignored. Therefore if is empty
+ then will be returned unmodified.
+
+
+ This method assumes that the slots all belong to the same declaring type or method
+ which is always the case for and .
+
+
+ The entity that is qualified by the specification such as the name of a type or method.
+ The formatter.
+ The formatted specification.
+ Thrown if
+ or is null.
+
+
+
+ Internal implementation of after argument validation.
+
+ The entity that is qualified by the specification such as the name of a type or method.
+ The formatter, not null.
+ The formatted specification.
+
+
+
+ Appends formatted generic arguments within angle brackets, if any.
+
+ The string builder, not null.
+ The arguments, not null.
+ The formatter, not null.
+
+
+
+ Appends formatted generic arguments within parentheses, if any.
+
+ The string builder, not null.
+ The arguments, not null.
+ The formatter, not null.
+
+
+
+ Appends formatted values keyed and sorted by name, if any.
+ This method is used with fields and properties.
+
+ The string builder, not null.
+ The named values, not null.
+ The formatter, not null.
+
+
+
+ Resolves a member that may be declared by a generic type using the
+ resolved type or one of its subtypes.
+
+
+
+ For example, if was declared by type Foo<T>
+ and is a subtype of Foo<int>, returns
+ a reflection object for the member as declared by Foo<int>.
+
+
+ The type of member.
+ The resolved type, not null.
+ The member, not null.
+ The resolved member.
+
+
+
+ Gets the slot values.
+
+
+
+
+ Gets the converter.
+
+
+
+
+ The intersection merge strategy combines the items from multiple providers
+ by discarding items whose values do not appear in the items of all other
+ providers.
+
+
+
+ If the same item appears more than once within any given provider,
+ when it will be enumerated only as often as the least number of repetitions
+ of that item that appear in other providers.
+
+
+ Uniqueness is determined by the natural equality of each bound value in the item.
+
+
+
+
+
+ Gets the singleton instance of the strategy.
+
+
+
+
+
+
+
+ A joined data set is an aggregate data set that joins items from each of zero or more
+ other data sets according to a .
+
+
+
+ A joined data set supports queries with two kinds of :
+
+ - A translated binding produced by
is scoped
+ to a particular . When a query occurs using a translated
+ binding, only that and its
+ components are consulted.
+ - Any other binding is treated as if it referred to the joined
+ including all of the contributions of all data sets. The joined
+ is conceptually laid out such that the columns of first appear
+ first followed by those of successive s in order. To maintain
+ this illustion, the component of the binding is adjusted
+ internally before passing any queries on to the s. Thereafter
+ a binding will be consumed by the first that returns true
+ from its method after index-adjustment.
+
+
+
+
+
+
+
+
+
+
+ Translates a binding into one that expresses a query that is scoped over
+ a particular data set that is associated with this interface.
+
+
+
+ If the binding contains an index parameter, the translated binding will contain
+ an index that is offset based on the position of the contents of the data set
+ within the items of the joined aggregate.
+
+
+ The data set.
+ The binding.
+ The translated binding.
+ Thrown if
+ or is null.
+ Thrown if
+ is not a member of this instance.
+
+
+
+
+
+
+
+
+
+ Gets or sets the .
+
+
+
+ By default the strategy is .
+
+
+ Thrown if is null.
+
+
+
+
+
+
+ A list data item contains a list of static data values combined with
+ optional metadata for the item. Data binding occurs based on the binding
+ index alone.
+
+ The value type.
+
+
+
+ Creates a list data item with optional metadata.
+
+ The list of values.
+ The metadata key/value pairs, or null if none.
+ True if the item contains dynamic data.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Encapsulates a specification for invoking a method given values for
+ its generic parameters and formal parameters.
+
+
+
+
+ Creates a new method specification.
+
+ The non-generic type or generic type instantiation
+ that declares the method to be invoked or is a subtype of the declaring type.
+ This parameter is used to resolve the method to its declaring type.
+ The method or generic method definition to be instantiated.
+ The slot values.
+ The converter to use for converting slot values
+ to the required types.
+ Thrown if ,
+ , or is null.
+ Thrown if contains
+ slots that are declared by different methods or have incompatible values.
+
+
+
+ Invokes the method.
+
+ The object on which to invoke the method. This value is ignored
+ if the method is static.
+ The method result value.
+ Thrown if is
+ null but the method is non-static.
+ Any exception thrown by the invoked method.
+
+
+
+
+
+
+ Gets the method or generic method definition to be invoked.
+
+
+
+
+ Gets the resolved type that declares the method.
+
+
+
+
+ Gets the resolved method given any generic method arguments that may have
+ been provided as slot values.
+
+
+
+
+ Gets the resolved method arguments.
+
+
+
+ The values have already been converted to appropriate types for invoking the method.
+
+
+
+
+
+ A null data item simply returns a null value on each request.
+ It has no metadata.
+
+
+
+
+ Gets the singleton null data item instance.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Encapsulates a specification for creating objects given values for
+ a type's generic parameters, constructor parameters, fields and properties.
+
+
+
+
+ Creates a new object specification.
+
+ The type or generic type definition to be instantiated.
+ The slot values.
+ The converter to use for converting slot values
+ to the required types.
+ Thrown if ,
+ or is null.
+ Thrown if
+ has an element type or if contains
+ slots that are declared by different types or have incompatible values.
+
+
+
+ Creates an instance of the resolved type and initializes it using
+ constructor parameter, field and property slot values.
+
+ The new instance, never null.
+ Thrown if the type is not instantiable.
+
+
+
+
+
+
+ Gets the type or generic type definition to be instantiated.
+
+
+
+
+ Gets the resolved type given any generic type arguments that may have
+ been provided as slot values.
+
+
+
+
+ Gets the resolved constructor, or null if the type was abstract or if it was
+ a struct and the default struct constructor is being use.
+
+
+
+
+ Gets the resolved constructor arguments.
+
+
+
+ The values have already been converted to appropriate types for invoking the constructor.
+
+
+ If is null, then this value will be an empty array.
+
+
+
+
+
+ Gets the resolved fields and their values.
+
+
+
+ The values have already been converted to appropriate types for setting the fields.
+
+
+
+
+
+ Gets the resolved properties and their values.
+
+
+
+ The values have already been converted to appropriate types for setting the properties.
+
+
+
+
+
+ The pairwise strategy constructs a limited number of combinations of the
+ items within the data providers such that they cover all possible pairs
+ of values from each data source.
+
+
+
+ This strategy can be more efficient than one based on exhaustively testing all
+ combinations since many test failures result from the interaction of a relatively
+ small number of factors: often just two of them.
+
+
+ Computing orthogonal arrays for pairwise joins for large domains can be very expensive
+ computationally. Therefore most practical algorithms use approximations.
+
+
+ The algorithm used here makes a list of all pairs that must be covered. Then it constructs
+ combinations greedily by trying to include as many uncovered pairs in each one as possible,
+ preferring pairs used less often over other ones. The combinations produced may not be
+ optimal but empirically it covers all pairs using a sufficiently small number of cases for
+ most practical purposes.
+
+
+ Many thanks to James Bach at Satisfice (www.satisfice.com) for his AllPairs program from
+ which the algorithm used here was adapted.
+
+
+ The choice of considering only 2 factors was made for the sake of implementation
+ convenience. It turns out that an N-wise combination strategy is much more complex
+ to implement efficiently because the general problem is NP-Complete. However, if you
+ should choose to implement such a join strategy on your own, please consider contributing
+ it back to the Gallio project for others to use. Thanks!
+
+
+ See also: .
+
+
+
+
+
+
+ Gets the singleton instance of the strategy.
+
+
+
+
+
+
+
+ A data set constructed from a sequence of data items.
+
+
+
+
+ Creates a row data set.
+
+ The sequence of items.
+ The column count.
+ Thrown if is null.
+ Thrown if is negative.
+
+
+
+
+
+
+
+
+
+
+
+
+ A scalar data item represents a single static data value combined with
+ optional metadata for the item. Data binding occurs whenever the binding
+ index is 0.
+
+ The value type.
+
+
+
+ Creates a scalar data item with optional metadata.
+
+ The value to hold.
+ The metadata key/value pairs, or null if none.
+ True if the item contains dynamic data.
+
+
+
+
+
+
+
+
+
+ The sequential join strategy combines items from each data provider sequentially.
+ If one provider contains fewer items than the others, the sequential join strategy
+ will insert a in its place until all other providers have been exhausted.
+ This is similar to performing an "outer join" of multiple sources by ordinal index.
+
+
+
+
+ Gets the singleton instance of the strategy.
+
+
+
+
+
+
+
+ The union merge strategy combines the items from multiple providers by
+ discarding all items whose values duplicate those of other items that
+ have already been enumerated.
+
+
+
+ Uniqueness is determined by the natural equality of each bound value in the item.
+
+
+
+
+
+ Gets the singleton instance of the strategy.
+
+
+
+
+
+
+
+ An XML data set selects nodes from an XML document using XPath
+ expressions. The selected nodes are returned as objects.
+
+
+
+ Two XPath expressions are used.
+
+ -
+
Item Path : An XPath expression that selects a set of nodes that are used to
+ uniquely identify records. For example, the item path might be used to select
+ the containing element of each Book element in an XML document of Books.
+ The item path is specified in the constructor.
+
+ -
+
Binding Path : An XPath expression that selects a node relative to the item path
+ that contains a particular data value of interest. For example, the binding path
+ might be used to select the Author attribute of a Book element in an XML document of Books.
+ The binding path is specified by the .
+
+
+
+
+
+ The XML may contain metadata at the row level by adding metadata elements in the
+ http://www.gallio.org/ namespace containing metadata entries. In the following example,
+ the row values would be selected using an Item Path of "//row" and a Binding Path of "@value".
+ Additionally, some rows would have metadata as specified.
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ Creates an XML data set.
+
+ A delegate that produces the XML document on demand.
+ The XPath expression used to select items within the document.
+ True if the data set should be considered dynamic.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+ Gets the name of the location that is providing the data, or null if none.
+
+
+
+ The data location name and line number are exposed as
+ metadata when provided.
+
+
+
+ The default value is null.
+
+
+
+
+
+
+
+
+
+
+ Associates an annotation message with a code element. When the code element
+ is processed as part of building some other test, the annotation message will
+ be emitted. This may be used to signal error, warning, and informational
+ messages associated with the code element in question.
+
+
+
+ Many annotations are automatically generated by the framework. For example,
+ improperly used attributes generally cause error annotations to be emitted.
+ This attribute provides an easy way for test authors to leverage the annotation
+ mechanism for other discretionary purposes where it is desirable to draw
+ attention to a particular code element.
+
+
+ Note that the annotation will only be emitted if it is encountered during the
+ process of building a test. If for some reason the annotated code element
+ is not processed, then the attribute will have no effect.
+
+
+
+
+
+ Associates an annotation message of the specified type with the code element.
+
+ The annotation type.
+ The annotation message.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the annotation type.
+
+
+
+
+ Gets the annotation message.
+
+
+
+
+ Gets or sets optional detail text of the annotation, or null if none.
+
+
+
+
+ A contribution method pattern attribute applies decorations to a containing scope
+ such as by introducing a new setup or teardown action to a test.
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The method.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Applies decorations to the containing test.
+
+ The containing scope.
+ The method to process.
+
+
+
+
+
+
+ A test assembly decorator pattern attribute applies decorations to an
+ existing test declared at the assembly-level.
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The assembly.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Applies decorations to an assembly-level test.
+
+
+
+ A typical use of this method is to augment the test with additional metadata
+ or to add additional behaviors to the test.
+
+
+ The assembly scope.
+ The assembly.
+
+
+
+ An assembly initialization attribute gets a chance to perform early initialization
+ of the system before enumerating the tests within the assembly.
+
+
+
+ For examples, a subclass of this attribute may be used to register an assembly
+ resolver before test enumeration occurs to ensure that all referenced assemblies
+ can be loaded.
+
+
+
+
+
+ Performs early initialization for the specified assembly.
+
+ The root scope that will eventually contain the assembly-level test.
+ The assembly to process.
+
+
+
+ Declares that an assembly generates an assembly-level test.
+
+
+
+ Subclasses of this attribute can customize how test enumeration takes place within the assembly.
+
+
+ At most one attribute of this type may appear on any given assembly.
+
+
+
+
+
+
+ Gets a default instance of the assembly pattern attribute to use
+ when no other pattern consumes an assembly.
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The assembly.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Initializes a test for an assembly after it has been added to the test model.
+
+ The assembly scope.
+ The assembly.
+
+
+
+ Applies semantic actions to the assembly-level test to estalish its runtime behavior.
+
+
+
+ This method is called after .
+
+
+ The default behavior for a
+ is to configure the test actions as follows:
+
+ : Reset the
+ to defaults.
+
+
+
+ You can override this method to change the semantics as required.
+
+
+ The test builder.
+ The assembly.
+
+
+
+ Populates the children of the assembly test all at once.
+
+
+
+ The default implementation processes all public and non-public types within the assembly.
+
+
+ The assembly scope.
+ The assembly.
+
+
+
+ Prepares to populate the children of the assembly test on demand by
+ adding a deferred populator with .
+
+ The assembly scope.
+ The assembly.
+
+
+
+
+
+
+ Gets the default pattern to apply to types that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ Abstract base implementation of with do-nothing
+ implementations.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The data pattern attribute applies a data source to a fixture or test
+ parameter declaratively.
+
+
+
+ It can be attached to a fixture class, a public property
+ or field of a fixture, a test method or a test method parameter. When attached
+ to a property or field of a fixture, implies that the property or field is
+ a fixture parameter (so the
+ may be omitted).
+
+
+ The order in which items contributed by a data pattern attribute are
+ use can be controlled via the
+ property. The contents of data sets with lower order indices are processed
+ before those with higher indices.
+
+
+
+ The following example ensures that the rows are processed in exactly the order they appear.
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The code element.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Populates the data source with the contributions of this attribute.
+
+ The scope.
+ The data source.
+ The code element.
+
+
+
+ Gets or sets the name of the data source to create so that the values produced
+ by this attribute can be referred to elsewhere.
+
+
+
+ Multiple data attributes may use the same data source name to produce a compound
+ data source consisting of all of their values combined.
+
+
+ If no name is given to the data source (or it is an empty string), the data source
+ is considered anonymous. An anonymous data source is only visible
+ within the scope of the code element with which the data source declaration
+ is associated. By default, test parameters are bound to
+ the anonymous data source of their enclosing scope.
+
+
+ Thrown if is null.
+
+
+
+ A declarative pattern resolver based on .
+
+
+
+
+ The pattern resolver provides a means for obtaining the
+ objects associated with an .
+
+
+
+
+ Gets the patterns associated with the specified code element.
+
+ The code element.
+ The enumeration of patterns.
+ Thrown if is null.
+
+
+
+ Gets the singleton instance of the declarative pattern resolver.
+
+
+
+
+
+
+
+ Standard flag combinations for declarations.
+
+
+
+
+ Valid attribute targets for tests.
+
+
+
+
+ Valid attribute targets for test assemblies.
+
+
+
+
+ Valid attribute targets for test types.
+
+
+
+
+ Valid attribute targets for test methods.
+
+
+
+
+ Valid attribute targets for test parameters.
+
+
+
+
+ Valid attribute targets for tests or test parameters.
+
+
+
+
+ Valid attribute targets for test constructors.
+
+
+
+
+ Valid attribute targets for data contexts.
+
+
+
+
+ Valid attribute targets for contribution methods.
+
+
+
+
+ Valid attribute targets for test contracts.
+
+
+
+
+ Default implementation of a pattern scope.
+
+
+
+
+ Creates a new scope.
+
+ The pattern evaluator.
+ The code element associated with the scope, or null if none.
+ The test builder in scope.
+ The test parameter builder in scope, or null if none.
+ The test data context builder.
+ True if the scope represents the initial point of declaration
+ of a given test component.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An interface shared by and .
+
+
+
+
+ Sets the name of the component.
+
+
+
+
+ Gets the data context of the component.
+
+
+
+
+ A pattern test data context introduces a scope for data source declarations.
+
+
+
+ Each or has a .
+ However, data contexts may also be nested.
+
+
+ For example, the constructor of a test class typically augments its containing test with
+ additional test parameters that represent its own constructor parameters. If data binding
+ attributes are applied to the constructor, they should operate within the scope of that
+ constructor only. To achieve this effect, the constructor declares a new
+ within which its test parameters will be created.
+
+
+
+
+
+ Creates a new data context.
+
+ The containing data context, or null if none.
+
+
+
+ Defines a new data source within this data context if one does not exist.
+ Otherwise returns the existing one.
+
+ The data source name.
+ The defined data source.
+ Thrown if is null.
+
+
+
+
+
+
+ Returns the index that should be used to implicitly bind to the nearest
+ anonymous data source that can be found.
+
+
+
+ The index is computed as the sum of the of each data
+ context traversed to find the data source excluding the data context
+ that actually has the data source.
+
+
+ The implicit data binding index, or null if no anonymous data sources were found.
+
+
+
+
+ Creates a child data context.
+
+ A handle for the child context.
+
+
+
+ Gets the containing data context, or null if none.
+
+
+
+
+ Gets or sets the offset to add to a test parameter's implicit data binding index to map it
+ into the containing data context.
+
+
+
+ This property is used to determine the data binding index of a test parameter that
+ has not been explicitly bound. The offsets are summed cumulatively to produce an implicit
+ data binding index while traversing the chain of containing data contexts while locating the
+ first anonymous data source.
+
+
+ For example, suppose Y is the second parameter of a test method. If Y does not
+ have an explicit data binding, we will apply implicit data binding rules as follows.
+
+ - If
Y 's data context contains an anonymous data source, then the implicit data binding index will be 0.
+ - Otherwise, if
Y 's containing data context contains an anonymous data source, then the implicit data
+ binding index will equal the offset specified in Y 's data context: 1 (since it is the second parameter).
+ - Otherwise, we continue searching containing data contexts and summing their offsets until we find an
+ anonymous data source. If none is found, then data binding will fail.
+
+
+
+
+
+
+ The type of exception thrown when a test declaration is malformed or
+ contains an error.
+
+
+
+ Implementations of may use this exception to report that a pattern
+ is malformed or not valid in the context in which it appears.
+
+
+ The exception effectively halts the processing of the pattern. The message
+ text is then manifested as an error annotation that may be displayed to the user.
+
+
+ When you see this error, check to make sure that the syntax of the test
+ is correct, all required parameters have been provided and they contain
+ valid values.
+
+
+
+
+
+ Creates a usage error exception.
+
+ A message that describes how the pattern was misused and possibly what should be done to correct it.
+
+
+
+ Creates a usage error exception.
+
+ A message that describes how the pattern was misused and possibly what should be done to correct it.
+ An optional exception that will be used to provide aditional details about the usage error.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ A dependency pattern attribute creates a dependency on the tests defined
+ by some other code element.
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The code element.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Gets the code element that declares the tests on which this test should depend.
+
+ The scope.
+ The code element.
+ The code element representing the dependency.
+
+
+
+ Default implementation of a pattern evaluator.
+
+
+
+
+ Creates a pattern evaluator.
+
+ The test model builder.
+ The pattern resolver.
+ Thrown if or
+ is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Applies declarative metadata to a test component.
+
+
+
+ A metadata attribute is similar to a decorator but more restrictive. Metadata does
+ not modify the structure of a test directly. Instead it introduces additional metadata
+ key / value pairs for classification, filtering, reporting, documentation or other purposes.
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The code element.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Gets the metadata key / value pairs to be added to the test component.
+
+ The metadata entries.
+
+
+
+ A test case that has been defined by the .
+
+
+
+
+
+ A test object represents a parameterized test case or test
+ container. The test parameters are used as placeholders for
+ data-binding during test execution. A single test can
+ produce multiple steps ( ) at runtime.
+
+
+
+ A can be thought of as a declarative
+ artifact that describes about what a test "looks like"
+ from the outside based on available reflective metadata.
+ A is then the runtime counterpart of a
+ that is created to describe different
+ parameter bindigns or other characteristics of a test's structure
+ that become manifest only at runtime.
+
+
+ A test may depend on one or more other tests. When a test
+ fails, the tests that depend on it are also automatically
+ considered failures. Moreover, the test harness ensures
+ that a test will only run once all of its dependencies have
+ completed execution successfully. A run-time error will
+ occur when the system detects the presence of circular test dependencies
+ or attempts to execute a test concurrently with its dependencies.
+
+
+ A test contain child tests. The children of a test are executed
+ in dependency order within the scope of the parent test. Thus the parent
+ test may setup/teardown the execution environment used to execute
+ its children. Tests that belong to different subtrees are executed in
+ relative isolation within the common environment established by their common parent.
+
+
+ The object model distinguishes between tests that represent individual test cases
+ and other test containers. Test containers are skipped if they do not
+ contain any test cases or if none of their test cases have been selected for execution.
+
+
+ The kind of type type of test is set to by default.
+
+
+
+
+
+ Common interface for elements in the test object model.
+
+
+
+ All components have a name for presentation, metadata for
+ annotations, and a code reference to its point of definition.
+
+
+
+
+
+ Initializes a test component.
+
+ The name of the component.
+ The point of definition of the component, or null if unknown.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the stable unique identifier of the component.
+
+
+
+ The identifier must be unique across all components
+ within a given test project. It should also be stable so that the
+ identifier remains valid across recompilations and code changes that
+ do not alter the underlying declarations (insofar as is possible).
+
+
+ The identifier does not refer to a specific instance of ,
+ but rather incorporates enough information so that we can unambiguously find a
+ corresponding instance in a model that has been populated. When we rebuild
+ the model, assuming the code hasn't changed too much, the objects in the model
+ will have the same identifier as before. This allows the identifier
+ to be saved in project files to construct lists of components. We can also use
+ it to refer to components remotely.
+
+
+ Thrown if is null.
+
+
+
+ Gets or sets the name of the component.
+
+
+
+ The name does not need to be globally unique.
+
+
+
+
+
+ Gets or sets the value of the
+ metadata entry.
+
+
+
+ This is a convenience method.
+
+
+
+ One of the constants.
+
+
+
+
+ Gets the metadata of the component.
+
+
+
+
+
+ Gets or sets a reference to the point of definition of this test
+ component in the code, or null if unknown.
+
+
+
+
+ Initializes a test initially without a parent.
+
+ The name of the test.
+ The point of definition of the test, or null if unknown.
+ Thrown if is null.
+
+
+
+ Clears the list of test parameters.
+
+
+
+
+ Adds a test parameter and sets its property.
+
+ The test parameter to add.
+ Thrown if is null.
+ Thrown if is already
+ owned by some other test.
+
+
+
+ Removes a test parameter and resets its property.
+
+ The test parameter to remove.
+ Thrown if is null.
+ Thrown if is not owned by this test.
+
+
+
+ Clears the list of children.
+
+
+
+
+ Adds a child test and sets its property.
+
+ The test to add as a child.
+ Thrown if is null.
+ Thrown if is already
+ the child of some other test.
+
+
+
+ Removes a child test and resets its property.
+
+ The child test to remove.
+ Thrown if is null.
+ Thrown if is not a child of this test.
+
+
+
+ Clears the list of dependencies.
+
+
+
+
+ Adds a test dependency.
+
+ The test to add as a dependency.
+ Thrown if is null.
+
+
+
+ Removes a test dependency.
+
+ The test to remove as a dependency.
+ Thrown if is null.
+
+
+
+ Obtains a unique local id for a child of this test.
+
+ A suggested id which will be used if no conflicts occur.
+ The unique local id to use.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets or sets a suggested hint, or null if none.
+
+
+
+ The value returned by this method will be checked for uniqueness and amended as necessary
+ to produce a truly unique .
+
+
+
+ The default value of this property is null which causes the
+ property to be used as the local id hint.
+
+ The local id hint.
+
+
+
+ Gets the full name of the test. The full name is derived by concatenating the
+ of the followed by a slash ('/')
+ followed by the of this test.
+
+
+
+ The full name of the root test is empty.
+
+
+
+
+
+ Gets or sets the parent of this test, or null if this is the root test.
+
+
+
+
+ Gets a locally unique identifier for this test that satisfies the following conditions:
+
+
+
+
+ - The identifier is unique among all siblings of this test belonging to the same parent.
+ - The identifier is likely to be stable across multiple sessions including
+ changes and recompilations of the test projects.
+ - The identifier is non-null.
+
+
+
+ The local identifier may be the same as the test's name. However since the name is
+ intended for display to end-users, it may contain irrelevant details (such as version
+ numbers) that would reduce its long-term stability. In that case, a different
+ local identifier should be selected such as one based on the test's
+ and an ordering condition among siblings
+ to guarantee uniqueness.
+
+
+ The locally unique property may be used to generate the
+ globally unique property of a test by combining
+ it with the locally unique identifiers of its parents.
+
+
+ The locally unique identifier.
+
+
+
+ Gets whether this test represents an individual test case
+ as opposed to a test container such as a fixture or suite.
+
+
+
+ The value of this property can be used by the test harness to avoid processing
+ containers that have no test cases. It can also be used by the reporting infrastructure
+ to constrain output statistics to test cases only.
+
+
+ Not all test cases are leaf nodes in the test tree and vice-versa.
+
+
+ This value is defined as a property rather than as a metadata key because it
+ significantly changes the semantics of test execution.
+
+
+
+
+
+ Gets a read-only list of the parameters of this test.
+
+
+
+ Each parameter must have a unique name.
+
+
+ The order in which the parameters appear is not significant.
+
+
+
+
+
+ Gets a read-only list of the children of this test.
+
+
+
+
+ Gets a read-only list of the dependencies of this test.
+
+
+
+ Some test frameworks may choose to ignore test dependencies or may impose their own dependency schemes.
+
+
+
+
+
+ Gets or sets a number that defines an ordering for the test with respect to its siblings.
+
+
+
+ Unless compelled otherwise by test dependencies, tests with a lower order number than
+ their siblings will run before those siblings and tests with the same order number
+ as their siblings with run in an arbitrary sequence with respect to those siblings.
+
+
+ Some test frameworks may choose to ignore test order or may impose their own ordering schemes.
+
+
+ The test execution order with respect to siblings, initially zero.
+
+
+
+ Initializes a test initially without a parent.
+
+ The name of the test.
+ The point of definition of the test, or null if unknown.
+ The data context.
+ Thrown if or is null.
+
+
+
+
+
+
+ Gets or sets the maximum amount of time the whole test including
+ its setup, teardown and body should be permitted to run.
+
+
+
+ If the test runs any longer than this, it will be aborted by the framework.
+ The timeout may be null to indicate the absence of a timeout.
+
+
+ Thrown if
+ represents a negative time span.
+ The timeout. Default value is null.
+
+
+
+ Gets or sets the apartment state to be used to run the test.
+
+
+
+ If the apartment state is
+ the test will inherit the apartment state of its parent. Otherwise
+ it will run in a thread with the specified apartment state.
+
+
+ The test runner guarantees that the root test runs with the
+ apartment state. Consequently the apartment state only needs to be overridden to run
+ a test in some mode that may differ from that which it would ordinarily inherit.
+
+
+
+ The default value of this property is .
+
+
+
+
+ Gets or sets whether the test is parallelizable.
+
+
+ True if the test is parallelizable. The default value of this property is false .
+
+
+
+
+ Gets the set of actions that describe the behavior of the test.
+
+
+
+
+ Gets the set of actions that describe the behavior of the test's instances.
+
+
+
+
+
+
+
+ Pattern test action provide the logic that implements the various
+ phases of the test execution lifecycle.
+
+
+
+ Each chain of actions represents the behavior to be performed during a particular phase.
+ Different actions are permitted during each phase. Consult the
+ documentation of the chains for restrictions.
+
+
+ The phases generally run in the following order. Some phases may be skipped
+ due to exceptions or if there is no work to be done.
+
+
+
+ - -- for each test instance --
+
+ - Run the actions in the decorated
+ - -- end --
+
+
+
+
+
+ This class is the backbone of the
+ extensibility model. Because new behaviors can be defined and added
+ to action chains at will by any component that participates in the test
+ construction process (typically an ), the framework
+ itself does not need to hardcode the mechanism by which the behaviors are
+ selected.
+
+
+
+
+
+ Creates a test actions object initially configured with empty action chains
+ that do nothing.
+
+
+
+
+ Creates a copy of the test actions.
+
+ The new copy.
+
+
+
+ Gets the test instance actions that describes the lifecycle of a test instance.
+
+
+
+ These actions may be further decorated on a per-instance basis using .
+
+
+
+
+
+ Prepares a newly created test state before its use.
+
+
+
+ This method runs in the of its containing test
+ step because the test has not yet been started.
+
+
+ The following actions are typically performed during this phase:
+
+ - Configuring the
in anticipation of test execution.
+ - Accessing user data via
.
+ - Skipping the test by throwing an appropriate
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Initializes a test prior to the execution of its instances.
+
+
+
+ This method runs in the of the .
+
+
+ The following actions are typically performed during this phase:
+
+ - Aborting the test run if any preconditions have not been satisfied or if the test is to be skipped.
+ - Configuring the test environment in advance of the enumeration and execution of all test instances.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Cleans up a test following the execution of its instances.
+
+
+
+ This method runs in the of the .
+
+
+ The following actions are typically performed during this phase:
+
+ - Deconfiguring the test environment following the enumeration and execution of all test instances.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Cleans up a completed test state after its use.
+
+
+
+ This method runs in the of its containing test
+ step because the test has terminated.
+
+
+ The following actions are typically performed during this phase:
+
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Decorates the of a test instance before its
+ actions have a chance to run.
+
+
+
+ This method runs in the of its containing test
+ instance because the test has not yet been started.
+
+
+ This method may apply any number of decorations to the test instance's actions
+ to the supplied object.
+ The test instance's original actions are unmodified by this operation and the
+ decorated actions are discarded once the child test is finished.
+
+
+ The following actions are typically performed during this phase:
+
+ - Adding additional actions for the test instance to the
.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Controls the execution of instances.
+
+
+
+
+
+ Creates a pattern test controller.
+
+ The formatter for data binding.
+ The converter for data binding.
+ The test environment manager.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+ Encapsulates the algorithm for recursively running a .
+
+
+
+ Please note that this code has been optimized to minimize the stack depth so as
+ to be more debugger-friendly. That means some of these methods (and the methods
+ they call) are rather a lot longer and harder to read than they used to be.
+ However the payoff is very significant for end-users. As a result of this optimization
+ the effective stack depth for a simple test has been reduced from over 160 to about 30 in many cases.
+ -- Jeff.
+
+
+
+
+
+ Test driver for the pattern test framework.
+
+
+
+
+ The pattern test framework is a built-in framework that Gallio provides based on
+ reflection over attributes that implement .
+
+
+
+ The pattern test framework does not provide many attributes that end-users would use
+ to write tests. The framework is intended to be extended by
+ components and libraries that define the test syntax and other facilities.
+
+
+ For example, a Test-Driven framework would augment the base framework with a syntax based
+ around test fixtures, test methods and assertions. A Behavior-Driven framework
+ would instead use a syntax based around contexts and specifications. Both frameworks
+ would share the common attribute-based model provided by the pattern test framework.
+ They may even interoperate to a large extent.
+
+
+ Other add-on libraries and tools may further contribute functionality to the pattern
+ test framework by registering components with the runtime or by subclassing
+ pattern attributes.
+
+
+ Gallio supports the use of multiple test frameworks. The pattern test framework
+ model defined here may not be appropriate for all purposes. Therefore you may
+ consider creating a new test framework from scratch by implementing
+ and appropriately to obtain the desired semantics.
+
+
+ The name of the Pattern Test Framework derives from the similarity between the recursive
+ construction process performed by and the kind of pattern matching
+ that is performed by a recursive descent parser. Each primary can be
+ thought of as a grammar rule that matches a given code element and describes how further
+ matching of nested code elements is intended to occur. The actual matching performed is
+ somewhat simplistic (largely based on attribute lookup) but on the whole the framework
+ provides a quite flexible implementation pattern for a wide variety of testing features.
+
+
+
+
+
+
+
+
+ Gets information about a particular pattern test framework extension.
+
+
+
+ The information will be included in the report as part of the framework
+ node that contains the assembly.
+
+
+ If there are no framework extensions associated with a particular assembly then
+ the assembly will not be explored for tests.
+
+
+ The test assembly.
+ The pattern test framework extension information.
+
+
+
+ A step that belongs to a .
+
+
+
+
+
+ A test step is a delimited region of a test defined at run-time.
+
+
+
+ Each test that is executed consists of at least one step: the "primary" step.
+ During execution, each test may spawn additional nested steps that may run in
+ parallel or in series with one another as required.
+
+
+ A test step may be used to describe a particular instance of a data driven test.
+ It can also be used to generate a completely dynamic hierarchy at runtime that
+ mirrors and extends the static test hierarchy with new information derived from
+ the actual execution of the test.
+
+
+ Each step has its own execution log and test result (pass/fail/inconclusive).
+ Therefore a multi-step test may possess multiple execution logs and test results.
+ This is deliberate. Think of a as being the declarative component
+ of a test that specifies which test method to invoke and its arguments. A
+ is the runtime counterpart of the that
+ captures output and control flow information about part or all of the test.
+
+
+ A test step also has metadata that can be update at run-time to carry additional
+ declarative information about the step.
+
+
+
+
+
+ Creates a primary step using the same name, code element and metadata
+ as the test to which it belongs.
+
+ The test to which the step belongs.
+ The parent test step, or null if creating the root step.
+ Thrown if is null.
+
+
+
+ Creates a step.
+
+
+
+ If is true, then all metadata from the
+ is copied to the step. Otherwise the new step will have no metadata initially.
+
+
+ The test to which the step belongs.
+ The parent step, or null if creating a root step.
+ The step name.
+ The point of definition of the step, or null if unknown.
+ True if the test step is primary.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+ Gets the full name of the step.
+
+
+
+ The full name is derived by concatenating the of the
+ followed by a slash ('/') followed by the
+ of this test step.
+
+
+ The full name of the root test step is empty.
+
+
+ Examples:
+
+ "" : The root step.
+ "SomeAssembly/SomeFixture/SomeTest" : The step corresponding to SomeTest.
+ "SomeAssembly/SomeFixture/SomeTest/ChildStep" : A child step of SomeTest.
+
+
+
+
+
+
+ Gets the step that contains this one, or null if this instance represents the
+ root step of the test step tree.
+
+
+
+
+ Gets the test to which this step belongs.
+
+
+
+
+ Returns true if the test step is the top node of a hierarchy of test steps that are
+ all associated with the same test.
+
+
+
+ In the case where a single test step is associated with a test, then it is the primary test step.
+ There may be multiple primary test steps of the same test if they are not
+ directly related by ancestry (ie. one does not contain the other).
+
+
+ A non-primary test step is known as a derived test step.
+
+
+ For example, suppose we have a data-driven test fixture F which contains a data-driven
+ test T. There will be a primary test step of F that represents the undifferentiated
+ fixture with no data bound to it. Its immediate children will be derived test steps of F with particular data bindings.
+ Similarly, each of these derived test steps of F will contain a primary test step of T
+ which then contains derived test steps of T.
+
+
+ This case is illustrated like this where periods delimit path segments in the test step hierarchy.
+
+ F : Primary test step of F
+ F.F1 : Non-primary test step of F with data bindings
+ F.F1.T : Primary test step of T
+ F.F1.T.T1 : Non-primary test step of T with data bindings
+ F.F1.T.T2 : Non-primary test step of T with data bindings
+ F.F2 : Non-primary test step of F with data bindings
+ F.F2.T : Primary test step of T
+ F.F2.T.T1 : Non-primary test step of T with data bindings
+ F.F2.T.T2 : Non-primary test step of T with data bindings
+
+
+
+
+
+
+ Gets or sets whether the test step is dynamic.
+
+
+
+ A dynamic test step is one whose execution is governed by parameters that are not
+ known a priori.
+
+
+ For example, a primary test step is generally not dynamic because its existence
+ usually only depends on statically known information derived from the test model.
+ However, a child test step created at runtime by a data binding process might be
+ considered dynamic if the data items that were used may change between test runs
+ even when the static structure of the test code remains the same. So a test step
+ that uses random data items or that owes its existence to processes that are not
+ entirely under the control of the test framework should be flagged as dynamic.
+
+
+ It can be useful to distinguish between static and dynamic test steps when
+ correlating results across test runs. Dynamic test steps are more likely to
+ change in dramatic ways between test runs than static test steps.
+
+
+
+
+
+ Gets or sets whether the test step represents a distinct test case.
+
+
+
+ A test case is typically a leaf of the test step hierarchy.
+
+
+ A test step can only be a test case if its associated is a test case. However,
+ not all test steps of tests that are test cases will themselves be test cases. For example, a
+ data-driven test might have one primary test step with multiple derived test steps as children.
+ The primary test step will generally not be considered a test case but its children will.
+
+
+
+
+
+
+ Creates a primary step using the same name, code element and metadata
+ as the test to which it belongs.
+
+ The test to which the step belongs.
+ The parent test step, or null if creating the root step.
+ Thrown if is null.
+
+
+
+ Creates a step.
+
+
+
+ If is true, then all metadata from the
+ is copied to the step. Otherwise the new step will have no metadata initially.
+
+
+ The test to which the step belongs.
+ The parent step, or null if creating a root step.
+ The step name.
+ The point of definition of the step, or null if unknown.
+ True if the test step is primary.
+ Thrown if
+ or is null.
+
+
+
+ Gets the associated test.
+
+
+
+
+ Pattern test instance actions provide the logic that implements the various
+ phases of the test instance execution lifecycle.
+
+
+
+ Each chain represents the behavior to be performed during a particular phase.
+ Different actions are permitted during each phase. Consult the
+ documentation of the chains for restrictions.
+
+
+ The phases generally run in the following order. Some phases may be skipped
+ due to exceptions or if there is no work to be done.
+
+
+ - --- begin
---
+
+
+
+ before each child test
+
+
+ - --- end
---
+
+
+
+
+ for actions on tests.
+
+
+
+ Creates a test instance actions object initially configured with empty action chains
+ that do nothing.
+
+
+
+
+ Creates a copy of the test instance actions.
+
+ The new copy.
+
+
+
+ Prepares a newly created test instance state before its use.
+
+
+
+ This method runs in the of the
+ because the test step for this instance (if different from the primary step) has not yet started.
+
+
+ If is false
+ then this method has the opportunity to modify the name or add metadata to the
+ brand new that was created for just this test instance.
+
+
+ The following actions are typically performed during this phase:
+
+ - Adding or changing slot values.
+ - Configuring the test environment in advance of test initialization.
+ - Modifying the name or metadata of the
, if
+ is false
+ (since the primary test step has already started execution).
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way UNLESS
+ is false.
+ - Skipping the test instance by throwing an appropriate
.
+
+
+
+
+
+
+ Initializes a test instance that has just started running.
+
+
+
+ This method runs in the of the test instance
+ in the lifecycle phase.
+
+
+ The following actions are typically performed during this phase:
+
+ - Creating the test fixture instance and setting
+ and .
+ - Configuring the test fixture in advance of test execution.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Sets up a test instance prior to execution.
+
+
+
+ This method runs in the of the test instance
+ in the lifecycle phase.
+
+
+ The following actions are typically performed during this phase:
+
+ - Invoking test setup methods.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Executes the test instance.
+
+
+
+ This method runs in the of the test instance
+ in the lifecycle phase.
+
+
+ The following actions are typically performed during this phase:
+
+ - Invoking test methods.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Tears down a test instance following execution.
+
+
+
+ This method runs in the of the test instance
+ in the lifecycle phase.
+
+
+ The following actions are typically performed during this phase:
+
+ - Invoking test teardown methods.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Disposes a test instance that is about to terminate.
+
+
+
+ This method runs in the of the test instance
+ in the lifecycle phase.
+
+
+ The following actions are typically performed during this phase:
+
+ - Deconfiguring the test fixture following test execution.
+ - Disposing the test fixture instance.
+ - Disposing other resources.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Cleans up a completed test instance after its use.
+
+
+
+ This method runs in the of the
+ because the test step for this instance (if different from the primary step) has terminated.
+
+
+ The following actions are typically performed during this phase:
+
+ - Deconfiguring the test environment following the test disposal.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+
+
+
+ Decorates the of a child test before its
+ actions have a chance to run.
+
+
+
+ This method runs in the of the test instance
+ in the lifecycle phase.
+
+
+ This method may apply any number of decorations to the child test's actions
+ to the supplied object.
+ The child test's original actions are unmodified by this operation and the
+ decorated actions are discarded once the child test is finished.
+
+
+ A typical use of this method is to augment the
+ and behaviors of the child test with
+ additional contributions provided by the parent.
+
+
+ It is also possible to decorate descendants besides direct children.
+ To do so, decorate the child's behavior
+ to perpetuate the decoration down to more deeply nested descendants. This
+ process of recursive decoration may be carried along to whatever depth is required.
+
+
+ The following actions are typically performed during this phase:
+
+ - Adding additional actions for the child test to the
.
+ - Accessing user data via
.
+
+
+
+ The following actions are forbidden during this phase because they would
+ either go unnoticed or have undesirable side-effects upon test execution:
+
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+ - Modifying the
object in any way.
+
+
+
+ The represents the state of the currently
+ executing instance of this test; not the child. The child has not started
+ running yet. When the child runs, the decorator actions installed in
+ will be invoked with references to the
+ child's state as usual.
+
+
+ For some purposes it may be useful to save the
+ for later use in the decorated action. For example, if the decorated action
+ needs to invoke a method on the parent test fixture, then it will need to
+ have the parent's . This is very easy
+ using anonymous delegates (due to variable capture) but can also be accomplished
+ with other means as required.
+
+
+
+
+
+ Runs the body of the test from the Initialize phase through the Dispose phase.
+
+
+
+ This method is somewhat special in that it gives the test instance actions a chance to
+ encapsulate the context in which the test runs. It can cause the test to run repeatedly,
+ or in another thread, or with some special execution context. Of course, if it does any
+ of these things then it is responsible for properly cleaning up the test and responding
+ in a timely manner to abort events from the current test context's .
+
+
+
+
+
+ Represents the run-time state of a single instance of a
+ that is to be executed.
+
+
+
+ Typical lifecycle of :
+
+ - The
creates a for the
+ instance of the to be executed using particular data bindings.
+ - The controller populates the instance state with slot values for each slot with
+ an associated
in the .
+ - The controller calls
to give test extensions
+ the opportunity to modify the instance state.
+ - The controller initializes, sets up, executes, tears down and disposes the test instance.
+ - The controller calls
to give test extensions
+ the opportunity to clean up the instance state.
+
+
+
+
+
+
+ Creates an initial test instance state object.
+
+ The test step used to execute the test instance.
+ The test instance actions.
+ The test state.
+ The data item.
+ The body of the test instance.
+ Thrown if ,
+ or or is null.
+ Thrown if belongs to a
+ different test from the .
+
+
+
+ Gets the pattern test instance state from the specified context.
+
+ The context.
+ The pattern test instance state, or null if none.
+ Thrown if is null.
+
+
+
+ Adds a suffix to the name base.
+
+ The suffix to add.
+
+
+ The suffixes may only be added during
+ when is false.
+
+
+ Thrown if is null.
+
+
+
+ Gets a fixture object creation specification using the state's bound .
+
+ The fixture type or generic type definition.
+ The fixture instance.
+
+ The values of and are not used.
+
+ Thrown if is null.
+ Thrown if the slots or values in
+ are not appropriate for instantiating .
+
+
+
+
+ Gets a test method invocation specification using the state's bound .
+
+ The test method or generic method definition,
+ possibly declared by a generic type or generic type defintion.
+ The method return value.
+ Thrown if is null.
+ Thrown if the slots or values in
+ or are not appropriate for invoking
+ Thrown if is null.
+
+
+
+
+ Invokes a fixture method using the specified .
+
+ The fixture method or generic method definition,
+ possibly declared by a generic type or generic type defintion.
+ The slot values to use for invoking the method.
+ The method return value.
+ Thrown if or is null.
+ Thrown if the slots or values in
+ or or are not appropriate for
+ invoking
+ Thrown if is null.
+ Any exception thrown by the invoked method.
+
+
+
+
+ Invokes the test method specified by ,
+ and .
+
+
+
+ If there is no test method or no arguments, the method does nothing.
+
+
+ The method return value, or null if there was none.
+ Any exception thrown by the invoked method.
+
+
+
+ Runs the body of the test.
+
+ The test outcome.
+
+
+
+ Gets the converter for data binding.
+
+
+
+
+ Gets the formatter for data binding.
+
+
+
+
+ Gets the test step used to execute the test instance.
+
+
+
+
+ Gets the test instance actions.
+
+
+
+
+ Gets the test associated with this test instance state.
+
+
+
+
+ Gets the test state associated with this test instance state.
+
+
+
+
+ Gets the data item obtained from the test's
+ to create this state.
+
+
+
+
+ Gets the user data collection associated with the test instance state.
+
+
+
+ It may be used
+ to associate arbitrary key/value pairs with the execution of the test instance.
+
+
+
+
+
+ Gets or sets the test fixture type or null if none.
+
+ Thrown if
+ contains unbound generic parameters, is a generic parameter, has an element type.
+
+
+
+ Gets or sets the test fixture instance or null if none.
+
+
+
+
+ Gets or sets the test method or null if none.
+
+ Thrown if
+ is contains unbound generic parameters.
+
+
+
+ Gets or sets the test method arguments or null if none.
+
+
+
+
+ Gets a mutable dictionary of slots and their bound values.
+
+
+
+ The dictionary maps slots to the values that will be stored in them
+ during test execution.
+
+
+ The slots should be valid for the type of test in question. For example,
+ a test fixture supports constructor parameters, generic type parameters,
+ fields and properies declared by the test fixture type. Likewise a test method
+ supports method parameters and generic method parameters declared by the test
+ method. Other novel kinds of tests might additional capabilities.
+
+
+ A value should be of a type that is compatible with the slot's .
+ If any type conversion is required, it should already have taken place prior to
+ adding the value to this dictionary.
+
+
+
+
+
+ Gets a mutable dictionary of values assigned to test parameters.
+
+
+
+ The contents of the dictionary are initialized by the framework as part of the
+ test parameter binding phase for the test instance, just before the "before test instance"
+ actions run.
+
+
+
+
+
+ Returns true if the is the
+ that was created for the test.
+
+
+
+ False if a new
+ was created as a child of the primary test step just for this test instance.
+
+
+
+
+
+ Gets or sets the basic name of the test instance which usually consists of the method or
+ class name and a description of its bound argument values.
+
+
+
+ The name may only be changed during
+ when is false.
+
+
+ Thrown if is null.
+
+
+
+ Represents an parameter of a derived from a field, property
+ or method parameter.
+
+
+
+
+
+ A test parameter describes a formal parameter of a
+ to which a value may be bound and used during test execution.
+
+
+
+ The property of a test parameter should be
+ unique among the set parameters belonging to its to ensure
+ that it can be differentiated from others. However, this constraint is not enforced.
+
+
+
+
+
+ Initializes a test parameter.
+
+ The name of the test parameter.
+ The point of definition of the parameter, or null if unknown.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the test that owns this parameter, or null if this parameter
+ does not yet have an owner.
+
+
+
+
+ Creates a test pattern parameter.
+
+ The name of the test parameter.
+ The code element (usually a slot) represented by the parameter, or null if none.
+ The data context of the test parameter.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ Gets the set of actions that describe the behavior of the test parameter.
+
+
+
+
+ Gets the test that owns this parameter.
+
+
+
+
+ Gets or sets the for this test parameter.
+
+
+ The default value is a bound to the anonymous
+ data source using a whose path is the name of this parameter and whose
+ index is the implicit index computed by the pararameter's data context.
+
+ Thrown if is null.
+
+
+
+
+
+
+ A delegate used to lazily populate the children of an .
+
+ If true, the populator should recursively populate
+ all of its newly populated test elements in addition to itself.
+
+
+
+
+ Represents the run-time state of a that is to be executed.
+
+
+
+ Typical lifecycle of :
+
+ - The
creates a for the
+ to be executed.
+ - The controller populates the test state with slot binding accessors for each
+ associated with the test.
+ - The controller calls
to give test extensions
+ the opportunity to modify the test state.
+ - The controller begins iterating over the
s produced by the
+ state's . For each item it constructs a
+ and executes the test instance.
+ - The controller calls
to give test extensions
+ the opportunity to clean up the test state.
+
+
+
+
+
+
+ Creates an initial test state object.
+
+ The primary test step.
+ The test actions.
+ The converter for data binding.
+ The formatter for data binding.
+ True if the test was selected explicitly.
+ Thrown if ,
+ ,
+ or is null.
+
+
+
+ Gets the pattern test state from the specified context.
+
+ The context.
+ The pattern test state, or null if none.
+ Thrown if is null.
+
+
+
+ Gets the test associated with this test state.
+
+
+
+
+ Gets the primary test step associated with this test state.
+
+
+
+ If the test has data bindings, the test instance for each data item will
+ be executed as children of the primary test step. Otherwise,
+ the primary test step will be used for the entire test run.
+
+
+
+
+
+ Gets the test actions.
+
+
+
+
+ Gets the data binding context of the test.
+
+
+
+ The context is used to produce data items for test instances.
+
+
+
+
+
+ Gets the converter for data binding.
+
+
+
+
+ Gets the formatter for data binding.
+
+
+
+
+ Returns true if the test was selected explicitly.
+
+
+
+
+ Gets the user data collection associated with the test state.
+
+
+
+ It may be used to associate arbitrary key/value pairs with the execution of the test.
+
+
+
+
+
+ Gets a mutable dictionary of data accessors that will provide
+ values assigned to test parameters given a data binding item.
+
+
+
+ The contents of the dictionary are initialized by the framework as part of the
+ test parameter binding phase for the test instance, just before the "before test"
+ actions run.
+
+
+
+
+
+ Declares that a constructor is used to provide test fixture parameters.
+
+
+
+ Subclasses of this attribute can control what happens with the constructor.
+
+
+ At most one attribute of this type may appear on any given constructor.
+
+
+
+
+
+ Gets a default instance of the constructor pattern attribute to use
+ when no other pattern consumes a contructor.
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The constructor.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Initializes the .
+
+ The data context scope.
+ The constructor.
+
+
+
+
+
+
+ Gets the default pattern to apply to constructor parameters that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ A test decorator pattern attribute applies decorations to a test defined by an
+ assembly, type, or method.
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The code element.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Applies decorations to a test.
+
+
+
+ A typical use of this method is to augment the test with additional metadata
+ or to add additional behaviors to the test.
+
+
+ The scope.
+ The code element.
+
+
+
+ A test decorator pattern attribute applies decorations to an
+ existing test declared at the method-level.
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The method.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Applies decorations to a method-level test.
+
+
+
+ A typical use of this method is to augment the test with additional metadata
+ or to add additional behaviors to the test.
+
+
+ The method scope.
+ The method.
+
+
+
+ Declares that a method represents a test.
+
+
+
+ Subclasses of this attribute can control what happens with the method.
+
+
+ At most one attribute of this type may appear on any given method.
+
+
+ A test method has a timeout of 10 minutes by default.
+
+
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The method.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Initializes a test for a method after it has been added to the test model.
+
+ The method scope.
+ The method.
+
+
+
+ Applies semantic actions to a test to estalish its runtime behavior.
+
+
+
+ This method is called after .
+
+
+ The default behavior for a
+ is to configure the test actions as follows:
+
+ : Set the
+ test step name, and
+ based on any values bound
+ to the test method's generic parameter and method parameter slots.
+ : Invoke the method.
+
+
+
+ You can override this method to change the semantics as required.
+
+
+ The test builder.
+ The test method.
+
+
+
+ Executes the test method.
+
+
+
+ The default implementation just calls
+ and ignores the result.
+
+
+ The test instance state, not null.
+
+
+
+ Gets or sets a number that defines an ordering for the test with respect to its siblings.
+
+
+
+ Unless compelled otherwise by test dependencies, tests with a lower order number than
+ their siblings will run before those siblings and tests with the same order number
+ as their siblings with run in an arbitrary sequence with respect to those siblings.
+
+
+ The test execution order with respect to siblings, initially zero.
+
+
+
+
+
+
+ Gets the default pattern to apply to generic parameters that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ Gets the default pattern to apply to method parameters that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ A test parameter decorator pattern attribute applies decorations to an
+ existing .
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The slot.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Applies decorations to a .
+
+
+
+ A typical use of this method is to augment the test parameter with additional metadata
+ or to add additional behaviors to the test parameter.
+
+
+ The slot scope.
+ The slot.
+
+
+
+ Declares that a field, property, method parameter or generic parameter
+ represents a .
+
+
+
+ Subclasses of this attribute can control what happens with the parameter.
+
+
+ At most one attribute of this type may appear on any given property,
+ field or parameter declaration.
+
+
+
+
+
+ Gets a default instance of the parameter pattern attribute to use
+ when no other pattern consumes the parameter.
+
+
+
+
+ Gets an instance of the parameter pattern attribute to use when no
+ other pattern consumes the parameter but when the parameter appears to have
+ other contributing pattern attributes associated with it.
+
+
+
+ So a test parameter is created automatically if we try to apply contributions to it, such as data items,
+ but otherwise it is silent. This is particularly useful with fields and properties.
+
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The slot.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Initializes a test parameter after it has been added to the containing test.
+
+ The test parameter scope.
+ The slot.
+
+
+
+
+
+
+ A test type decorator pattern attribute applies decorations to an
+ existing test declared at the type-level.
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The type.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Applies decorations to a type-level test.
+
+
+
+ A typical use of this method is to augment the test with additional metadata
+ or to add additional behaviors to the test.
+
+
+ The type scope.
+ The type.
+
+
+
+ Declares that a type represents a test.
+
+
+
+ Subclasses of this attribute can control what happens with the type.
+
+
+ At most one attribute of this type may appear on any given class.
+
+
+ A test type has no timeout by default.
+
+
+
+
+
+
+ Gets an instance of the test type pattern attribute to use when no
+ other pattern consumes the type.
+
+
+ If the type can be inferred to be a test type then the pattern will behave as if the type has a
+ test type pattern attribute applied to it. Otherwise it will simply recurse into nested types.
+
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The type.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Initializes a test for a type after it has been added to the test model.
+
+
+
+ The members of base types are processed before those of subtypes.
+
+
+ The default implementation processes all public members of the type including
+ the first constructor found, then recurses to process all public and non-public
+ nested types. Non-public members other than nested types are ignored.
+
+
+ The type scope.
+ The type.
+
+
+
+ Consumes type members including fields, properties, methods and events.
+
+ The scope to be used as the containing scope.
+ The type whose members are to be consumed.
+
+
+
+ Consumes type constructors.
+
+ The scope to be used as the containing scope.
+ The type whose constructors are to be consumed.
+
+
+
+ Consumes nested types.
+
+ The scope to be used as the containing scope.
+ The type whose nested types are to be consumed.
+
+
+
+ Applies semantic actions to a test to estalish its runtime behavior.
+
+
+
+ This method is called after .
+
+
+ The default behavior for a
+ is to configure the test actions as follows:
+
+ : Set the
+ fixture instance name and .
+ : Create
+ the fixture instance and set the
+ property accordingly.
+ : If the fixture type
+ implements , disposes the fixture instance.
+ : Decorates the child's
+ to set its
+ and properties to those
+ of the fixture. The child test may override these values later on but this
+ is a reasonable default setting for test methods within a fixture.
+
+
+
+ You can override this method to change the semantics as required.
+
+
+ The test builder.
+ The test type.
+
+
+
+ Gets the binding flags that should be used to enumerate non-nested type members
+ of the type for determining their contribution to the test fixture.
+
+
+
+ Instance members are only included if the type is not abstract.
+
+
+ The type.
+ The binding flags for enumerating members.
+
+
+
+ Infers whether the type is a test type based on its structure.
+
+
+
+ Returns true if the type any associated patterns, if it has
+ non-nested type members (subject to )
+ with patterns, if it has generic parameters with patterns, or if any
+ of its nested types satisfy the preceding rules.
+
+
+ The pattern evaluator.
+ The type.
+ True if the type is likely a test type.
+
+
+
+ Gets or sets a number that defines an ordering for the test with respect to its siblings.
+
+
+
+ Unless compelled otherwise by test dependencies, tests with a lower order number than
+ their siblings will run before those siblings and tests with the same order number
+ as their siblings with run in an arbitrary sequence with respect to those siblings.
+
+
+ The test execution order with respect to siblings, initially zero.
+
+
+
+
+
+
+ Gets the default pattern to apply to generic parameters that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ Gets the default pattern to apply to methods that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns null .
+
+
+
+
+
+ Gets the default pattern to apply to events that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns null .
+
+
+
+
+
+ Gets the default pattern to apply to fields that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ Gets the default pattern to apply to properties that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ Gets the default pattern to apply to constructors that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ Gets the default pattern to apply to nested types that do not have a primary pattern, or null if none.
+
+
+
+ The default implementation returns .
+
+
+
+
+
+ A sandbox is an isolated environments for executing test actions.
+
+
+
+ It provides the ability to abort actions in progress so that the test runner can proceed
+ to run other actions.
+
+
+ Sandboxes are hierarchically structured. When an outer sandbox is aborted, all
+ of its inner sandboxes are likewise aborted. A sandbox also provides the ability
+ to create new child sandboxes at will so that test actions can be isolated with
+ fine granularity.
+
+
+ This class is safe for use from multiple concurrent threads.
+
+
+
+
+
+ Creates a root sandbox.
+
+
+
+
+ Disposes the sandbox.
+
+
+
+ All currently executing actions are aborted with
+ if has not already been called.
+
+
+
+
+
+ Creates a child sandbox.
+
+
+
+ When the parent sandbox is aborted, the child will likewise be aborted. This policy
+ offers a mechanism to scope actions recursively.
+
+
+ The child sandbox.
+ Thrown if the sandbox was disposed.
+
+
+
+ Aborts all actions in progress within this context.
+
+
+
+ The abort is persistent and cannot be reverted. Therefore once aborted, no further
+ test actions will be permitted to run. Subsequent calls to
+ will have no effect.
+
+
+ The outcome to be returned from aborted actions.
+ A message to be logged when the action is aborted, or null if none.
+ Thrown if the sandbox was disposed.
+
+
+
+ Uses a specified timeout for all actions run within a block of code.
+ When the timeout expires, the sandbox will be aborted.
+
+
+
+
+ The execution timeout or null if none.
+ An object that when disposed ends the timeout block, possibly null if there was no timeout.
+ Thrown if the sandbox was disposed.
+ Thrown if is negative.
+
+
+
+ Runs a test action.
+
+
+
+ If the action throws an exception or if the test action is aborted, then logs a
+ message to the . Exceptions of type
+ are handled specially since they may modify the effective outcome of the run.
+ If is true and
+ is false then the exception is effectively silent. Therefore the action can modify
+ its outcome and cause messages to be logged by throwing a suitable exception such as
+ or .
+
+
+ If the method is called or has already been called, the action
+ is aborted and the appropriate outcome is returned. The abort is manifested as an
+ asynchronous which should cause the action to
+ terminate. It may not terminate immediately, however.
+
+
+ Produces an outcome in the following manner:
+
+ - If the action completed without throwing an exception returns
.
+ - If the action threw a
, returns the value of the
+ property.
+ - If the action threw an different kind of exception, logs
+ the exception and returns
.
+ - If the action was aborted, returns
.
+ - If the action timed out, returns
.
+
+
+
+ The log writer for reporting failures.
+ The action to run.
+ A description of the action being performed,
+ to be used as a log section name when reporting failures, or null if none.
+ The outcome of the action.
+ Thrown if or is null.
+ Thrown if the sandbox was disposed.
+
+
+
+ Runs an action inside of a protected context wherein it cannot receive
+ a thread abort from this .
+
+
+
+ This method enables critical system code to be protected from aborts that
+ may affect the sandbox. This call cannot be nested.
+
+
+ An object that when disposed ends the protected block, possibly null if there was no protection necessary.
+
+
+
+ An event that is dispatched when is called.
+
+
+
+ If the sandbox has already been aborted then the event handler is immediately invoked.
+
+
+ Thrown if the sandbox was disposed.
+
+
+
+ Returns true if was called.
+
+ Thrown if the sandbox was disposed.
+
+
+
+ Returns the passed to ,
+ or null if has not been called.
+
+ Thrown if the sandbox was disposed.
+
+
+
+ Gets a message that will be logged when the sandbox is aborted, or null if none.
+
+ Thrown if the sandbox was disposed.
+
+
+
+ This exception type is used to signal a test outcome silently without logging the exception.
+
+
+
+
+ Creates a silent test exception with the specified outcome.
+
+ The test outcome.
+
+
+
+ Creates a silent test exception with the specified outcome.
+
+ The test outcome.
+ The message, or null if none.
+
+
+
+ Creates a exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+
+
+
+ Provides functions for manipulating test steps.
+
+
+
+ A step is a delimited region of a test. Each step appears in the report as
+ if it were a dynamically generated test nested within the body of the test
+ (or some other step) that spawned it. The step has its own execution log,
+ pass/fail/inconclusive result and in all other respects behaves much like
+ an ordinary test would.
+
+
+ The number of steps within a test does not need to be known ahead of time.
+ This can be useful in situations where insufficient information is known
+ about the internal structure of a test to be able to fully populate the
+ test tree will all of its details. Because steps are dynamically generated
+ at runtime, they appear in test reports but they are invisible to test runners.
+ that traverse the test tree.
+
+
+ There are many interesting uses for steps. For example:
+
+ - A single test consisting of a long sequence of actions can be subdivided
+ into steps to simplify analysis.
+ - A test might depend on environmental configuration that cannot be
+ known a priori.
+ - A performance test might be scheduled to run for a certain duration
+ but the total number of iterations is unknown. By running each iteration
+ as a step within a single test, the test report can display the execution
+ log and pass/fail result of each iteration independently of the others.
+ - A script-driven test driver could execute a scripted sequence of verification
+ commands as a distinct step. If the script is written in a general purpose
+ programming language, the total number of commands and the order in which they
+ will be performed might not be known ahead of time. Using steps enables the
+ integration of tests written in forms that cannot be directly adapted
+ to the framework's native testing primitives.
+ - When testing non-deterministic algorithms, it is sometimes useful to repeat
+ a test multiple times under slightly different conditions until a certain level
+ of confidence is reached. The variety of conditions tested might be determined
+ adaptively based on an error estimation metric. Using steps each condition
+ verified can be reported independently.
+
+
+
+
+
+ Running as many iterations of a test as possible for a set maximum duration.
+ Each iteration will run as a separate test step so that it has its own test
+ execution log and test outcome included in the test report.
+
+
+
+
+
+
+ Performs an action as a new step within the current context and associates
+ it with the calling function. Does not verify the outcome of the step.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method does not verify that the test step completed successfully. Check the
+ of the test step or call
+ to ensure that the expected outcome was obtained.
+
+
+ The name of the step.
+ The action to perform.
+ The context of the step that ran.
+ Thrown if or
+ is null.
+ Thrown if is the empty string.
+ Thrown if there is no current test context.
+
+
+
+ Performs an action as a new step within the current context and associates
+ it with the calling function. Does not verify the outcome of the step.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method does not verify that the test step completed successfully. Check the
+ of the test step or call
+ to ensure that the expected outcome was obtained.
+
+
+ The name of the step.
+ The action to perform.
+ The step execution timeout, or null if none.
+ The context of the step that ran.
+ Thrown if or
+ is null.
+ Thrown if is the empty string.
+ Thrown if is negative.
+ Thrown if there is no current test context.
+
+
+
+ Performs an action as a new step within the current context and associates it
+ with the specified code reference. Does not verify the outcome of the step.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method does not verify that the test step completed successfully. Check the
+ of the test step or call
+ to ensure that the expected outcome was obtained.
+
+
+ The name of the step.
+ The action to perform.
+ The step execution timeout, or null if none.
+ True if the step represents an independent test case.
+ The associated code element, or null if none.
+ The context of the step that ran.
+ Thrown if or
+ is null.
+ Thrown if is the empty string.
+ Thrown if is negative.
+ Thrown if there is no current test context.
+
+
+
+ Performs an action as a new step within the current context and associates
+ it with the calling function. Verifies that the step produced the expected outcome.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method verifies that the step produced the expected outcome. If a different outcome
+ was obtained, then raises an assertion failure.
+
+
+ The name of the step.
+ The action to perform.
+ The expected outcome of the step.
+ The context of the step that ran.
+ Thrown if or
+ is null.
+ Thrown if is the empty string.
+ Thrown if the expected outcome was not obtained.
+ Thrown if there is no current test context.
+
+
+
+ Performs an action as a new step within the current context and associates
+ it with the calling function. Verifies that the step produced the expected outcome.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method verifies that the step produced the expected outcome. If a different outcome
+ was obtained, then raises an assertion failure.
+
+
+ The name of the step.
+ The action to perform.
+ The step execution timeout, or null if none.
+ The expected outcome of the step.
+ The context of the step that ran.
+ Thrown if or
+ is null.
+ Thrown if is the empty string.
+ Thrown if is negative.
+ Thrown if the expected outcome was not obtained.
+ Thrown if there is no current test context.
+
+
+
+ Performs an action as a new step within the current context and associates it
+ with the specified code reference. Verifies that the step produced the expected outcome.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method verifies that the step produced the expected outcome. If a different outcome
+ was obtained, then raises an assertion failure.
+
+
+ The name of the step.
+ The action to perform.
+ The step execution timeout, or null if none.
+ True if the step represents an independent test case.
+ The associated code element, or null if none.
+ The expected outcome of the step.
+ The context of the step that ran.
+ Thrown if or
+ is null.
+ Thrown if is the empty string.
+ Thrown if is negative.
+ Thrown if the expected outcome was not obtained.
+ Thrown if there is no current test context.
+
+
+
+ Adds metadata to the step that is running in the context.
+
+ The metadata key.
+ The metadata value.
+ Thrown if
+ or is null.
+ Thrown if there is no current test context.
+
+
+
+ Gets reflection information about the current step.
+
+ Thrown if there is no current test context.
+
+
+
+ The tasks class provides a mechanism for coordinating the actions of multiple
+ tasks within a test case.
+
+
+
+ Each task started by a test case is monitored. When the test exits, any
+ remaining tasks are automatically aborted and disposed.
+
+
+
+
+
+ Adds a new task for the task manager to watch.
+
+
+
+ The task manager will track when the task starts and finishes, ensure
+ that the task is aborted when the test ends, report any exception thrown
+ by the task as a warning in the log, and include the task in the list of those
+ to join and/or verify.
+
+
+ The task to watch.
+ Thrown if is null.
+
+
+
+ Creates a new thread task but does not start it.
+
+
+
+ There is no need to call on the returned task.
+
+
+ The name of the task, or null to create a new name based
+ on the method associated with the action.
+ The action to perform.
+ The new thread task.
+ Thrown if is null.
+
+
+
+ Starts a new thread task.
+
+
+
+ There is no need to call on the returned task.
+
+
+ The name of the task, or null to create a new name based
+ on the method associated with the action.
+ The action to perform.
+ The new thread task.
+ Thrown if is null.
+
+
+
+ Creates a new process task but does not start it.
+
+
+
+ The output of the process will be logged and included as part of the test results. It
+ may also be examined using the and
+ properties while the process executes and
+ after it terminates.
+
+
+ There is no need to call on the returned task.
+
+
+ The path of the executable executable.
+ The arguments for the executable.
+ The working directory.
+ The new thread task.
+ Thrown if ,
+ or is null.
+
+
+
+ Starts a new process and begins watching it.
+
+
+
+ The output of the process will be logged and included as part of the test results. It
+ may also be examined using the and
+ properties while the process executes and
+ after it terminates.
+
+
+ There is no need to call on the returned task.
+
+
+ The path of the executable executable.
+ The arguments for the executable.
+ The working directory.
+ The new thread task.
+ Thrown if ,
+ or is null.
+
+
+
+ Waits for all tasks to complete or for timeout to occur;
+ then verifies that no failures have occurred in any of the tasks.
+
+ The timeout.
+ Thrown if some of the tasks did not complete
+ or if any of the tasks failed.
+
+
+
+ Verifies that no failures have occurred in any of the tasks.
+
+ Thrown if any of the tasks failed.
+
+
+
+ Gets the task container for the current .
+
+
+
+
+ Runs sample test cases within an embedded copy of the test runner and provides
+ access to the resulting test report.
+
+
+
+ Logs debug output from the embedded test runner while the sample tests run.
+
+
+ This utility class is intended to help write integration tests for test framework features.
+
+
+ This class is NOT intended to be used for instructional purposes as a template for
+ creating a new test runner. Do NOT copy this code and try to make a new test runner
+ out of it. Instead, please examine the code for the Gallio Echo test runner and pay
+ attention to how it uses the .
+
+
+
+
+
+ Creates a sample runner.
+
+
+
+
+ Adds a test file to the package configuration, if not already added.
+
+ The file to add.
+ Thrown if is null.
+
+
+
+ Adds a test assembly to the package configuration, if not already added.
+
+ The assembly to add.
+ Thrown if is null.
+
+
+
+ Adds a test fixture type to the list of filters, and automatically adds its containing
+ test assembly to the package configuration, if not already added.
+
+ The test fixture type to add.
+ Thrown if is null.
+
+
+
+ Adds a test method to the list of filters, and automatically adds its containing
+ test assembly to the package configuration, if not already added.
+
+ The test fixture type.
+ The test method name.
+ Thrown if or is null.
+
+
+
+ Adds a test filter to the combined list of filters that select which tests to include in the run,
+ if not already added.
+
+ The filter to add.
+ Thrown if is null.
+
+
+
+ Gets information about the test with the given code reference.
+
+
+
+ Can only be called after the tests have run.
+
+
+ The code reference of the test.
+ The test data, or null if not found.
+
+
+
+ Gets information about the test that matches a predicate.
+
+
+
+ Can only be called after the tests have run.
+
+
+ The predicate to match.
+ The test data, or null if not found.
+
+
+
+ Gets all test step runs with the given code reference.
+
+
+
+ Can only be called after the tests have run.
+
+
+ The code reference of the test.
+ The enumeration of test step runs, or null if not found.
+
+
+
+ Gets all test step runs that match a predicate.
+
+
+
+ Can only be called after the tests have run.
+
+
+ The predicate to match.
+ The enumeration of test step runs, or null if not found.
+
+
+
+ Gets all test step runs with the code reference infered from the method of the specified type.
+
+
+
+ Can only be called after the tests have run.
+
+
+ The searched type.
+ The name of the searched method.
+ The enumeration of test step runs, or null if not found.
+
+
+
+ Gets the primary test step run of a test with the given code reference.
+
+
+
+ If there are multiple primary steps, returns the first one found.
+
+
+ Can only be called after the tests have run.
+
+
+ The code reference of the test.
+ The first test step run, or null if not found.
+
+
+
+ Gets the primary test step run that match a predicate.
+
+
+
+ If there are multiple primary steps, returns the first one found.
+
+
+ Can only be called after the tests have run.
+
+
+ The predicate to match.
+ The first test step run, or null if not found.
+
+
+
+ Gets the primary test step run of a test with the code reference infered from the method of the specified type.
+
+
+
+ If there are multiple primary steps, returns the first one found.
+
+
+ Can only be called after the tests have run.
+
+
+ The searched type.
+ The name of the searched method.
+ The first test step run, or null if not found.
+
+
+
+ Gets all test step runs that represent test cases within a test with
+ the specified code reference.
+
+
+
+ Can only be called after the tests have run.
+
+
+ The code reference of the test.
+ The first test step run, or null if not found.
+
+
+
+ Explores the tests but does not run them.
+
+
+
+
+ Runs the tests.
+
+
+
+
+ Gets the test report that was produced by the test run.
+
+
+
+
+ Gets the result of the test run.
+
+
+
+
+ Gets the test package for the test run.
+
+
+
+ The returned object may be modified prior to running the tests to configure
+ various parameters of the test run.
+
+
+
+
+
+ Gets or sets the name of the test runner factory to use.
+
+ The test runner factory name, defaults to
+
+
+
+ Gets the test runner options.
+
+
+
+
+ An annotation associates a message with a source code location
+ to inform the user about a problem.
+
+
+
+
+ Creates an annotation with a detail message string.
+
+ The annotation type.
+ The associated code element, or null if none.
+ The annotation message.
+ Additional details such as exception text or null if none.
+ Thrown if is null.
+
+
+
+ Creates an annotation with a detail exception.
+
+ The annotation type.
+ The associated code element, or null if none.
+ The annotation message.
+ The exception to use as additional details or null if none.
+ Thrown if is null.
+
+
+
+ Creates an annotation with no details.
+
+ The annotation type.
+ The associated code element, or null if none.
+ The annotation message.
+ Thrown if is null.
+
+
+
+ Gets the annotation type.
+
+
+
+
+ Gets the code element associated with the annotation.
+
+
+
+
+ Gets the annotation message.
+
+
+
+
+ Gets additional details such as exception text, or null if none.
+
+
+
+
+ Specifies the type of an annotation.
+
+
+
+
+ An informational annotation.
+
+
+
+
+ A warning annotation.
+
+
+
+
+ An error annotation.
+
+
+
+
+ Describes the configuration of a Gallio installation.
+
+
+
+
+ Loads the configuration from the registry.
+
+ The installed configuration.
+
+
+
+ Clears the list of additional plugin directories.
+
+
+
+
+ Adds an additional plugin directory if not already in the configuration.
+
+ The relative or absolute path of a directory to be
+ searched for plugin configuration files in addition to the
+ primary Gallio directories.
+ Thrown if is null.
+
+
+
+ Removes an additional plugin directory.
+
+ The plugin directory to remove.
+ Thrown if is null.
+
+
+
+ Saves the additional plugin directories into the registry.
+
+
+
+
+ Saves the installation id into the registry.
+
+
+
+
+ Get or sets the version that was installed, or null if Gallio is not installed.
+
+
+
+
+ Get or sets the folder where Gallio was installed, or null if Gallio is not installed.
+
+
+
+
+ Gets or sets the unique id of this Gallio installation.
+
+
+
+ Returns if Gallio does not appear to have an installation id.
+
+
+
+
+
+ Gets a read-only list of additional plugin directories.
+
+
+
+
+ A implementation based on a .
+
+
+
+
+ A test command requests the execution of a tree of s.
+ The test command hierarchy mirrors a filtered subset of the test hierarchy.
+
+
+
+ The order in which commands appear in the command tree is significant.
+ Commands should be sorted such that if command A depends on command B,
+ then B will appear before A in a pre-order traversal of the tree.
+
+
+ The ordering constraint is intended to simplify the implementation of
+ s. Test drivers may assume that executing
+ s in pre-order traversal sequence will be
+ sufficient to ensure that all dependencies can be evaluated in time.
+
+
+ However, a is not required to run the
+ tests in the specified order. Moreover, it is not required to run them
+ serially at all. (In fact, it is not even required to use this API.)
+ A smart might run tests in parallel or take
+ into account additional sequencing constraints governing execution order.
+
+
+ In order to achieve correct behavior, a
+ should satisfy the following guarantees with respect to test commands:
+
+ - A test command runs within the scope of its parent test command.
+ - A test command runs only after all of the test commands it depends on have passed.
+ - A test command with a failed dependency or that is not run for internal reasons reports a test outcome of
.
+
+
+
+
+
+
+ Gets a list consisting of this command and all of its descendants as
+ enumerated by pre-order tree traversal.
+
+ The list of all command.
+
+
+
+ Returns true if all of the dependencies of this test command have
+ been satisfied including transitive dependencies.
+
+ True if the dependencies of this test command have been satisfied.
+
+
+
+ Starts a new step of the test using the specified test step object.
+
+
+
+ The current thread's test context is set to a new context for the
+ test step that is starting. The new context will be a child of the
+ current thread's context.
+
+
+ The test step to start.
+ The test context for the test step.
+ Thrown if is null.
+ Thrown if does not
+ belong to the test associated with this test command.
+
+
+
+ Starts the primary step of the test associated with this command as a child
+ of the specified test step and returns its test context.
+
+
+
+ This method is equivalent to calling
+ using a default implementation of that is
+ initialized with the metadata of the test associated with this test command.
+
+
+ The parent test step, or null if none.
+ The test context for the new primary test step.
+
+
+
+
+ Gets the test that is to be executed.
+
+
+
+
+ Gets the total number of tests in the command subtree, including itself.
+
+
+
+
+ Returns true if the test was explicitly selected by a filter.
+
+
+
+ This flag enables test controllers to distinguish the case when a particular test
+ was explicitly selected by a user-specified filter rather than by virtue of
+ one of its parents having been selected.
+
+
+
+
+
+ Gets the number of times that a root step of this test has failed.
+
+
+
+ The value of this field is automatically updated as each root step
+ created by finishes.
+
+
+
+
+
+ Gets the list of child commands to run within the scope of this command.
+
+
+
+ Each child command represents a test that is a child of the test
+ managed by this command.
+
+
+ The children are listed in an order that is consistent with
+ their dependencies. See class commends for details.
+
+
+
+
+
+ Gets the list of other commands that this command depends upon.
+
+
+
+ The dependent commands are guaranteed to have appeared before this
+ command in a pre-order traversal of the command tree.
+ A test command cannot depend on one of its direct ancestors.
+
+
+ There must be no circular dependencies.
+
+
+
+
+
+ Enumerates this command and all of its descendants in pre-order tree
+ traversal.
+
+
+
+
+ Creates a test command.
+
+ The test context manager.
+ The test.
+ True if the test is being executed explicitly.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adds a child test command.
+
+ The child to add.
+
+
+
+ Adds a test command dependency.
+
+ The dependency to add.
+
+
+
+ Clears the children of the command.
+
+
+
+
+ Gets the list of children as an array.
+
+ The array of children.
+
+
+
+ Returns a description of the test command for debugging purposes.
+
+ A description of the test command.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An observable test context monitors translates state changes on the
+ test context into notifications on a .
+
+
+
+
+ The context provides information about the environment in which
+ a test is executing. A new context is created each time a test or
+ test step begins execution.
+
+
+
+ Contexts are arranged in a hierarchy that corresponds to the order in which
+ the contexts were entered. Thus the context for a test likely has as
+ its parent the context for its containing test fixture.
+
+
+ Arbitrary user data can be associated with a context. Furthermore, client
+ code may attach event handlers to perform resource
+ reclamation or other updates when the test step is finished.
+
+
+ When the context is disposed, its associated test step is automatically
+ marked as being finished unless was previously called.
+ When this occurs the test step is finished with an outcome of
+ .
+
+
+
+
+
+ Adds the specified amount to the assert count atomically.
+
+ The amount to add to the assert count.
+ Thrown if the test is not running.
+
+
+
+ Adds metadata to the step that is running in the context.
+
+ The metadata key.
+ The metadata value.
+ Thrown if
+ or is null.
+ Thrown if the test is not running.
+
+
+
+ Sets the step's interim .
+
+
+
+ The interim outcome is used to communicate the anticipated outcome of the step to
+ later phases of execution.
+
+
+ The value set here will be overridden by whatever final outcome the step
+ returns. Consequently the actual outcome may still differ from the anticipated
+ outcome that was set using this method.
+
+
+ Thrown if attempting to set the outcome while the test is not running.
+
+
+
+
+ Starts a child step of the test and returns its context.
+
+
+
+ The current thread's test context is set to the context of the
+ test step that is starting.
+
+
+ The step to start.
+ The context of the child step.
+ Thrown if the step has finished.
+ Thrown if is null.
+ Thrown if is not a child
+ of the this step.
+
+
+
+ Finishes a step and submits its final result.
+
+
+
+ If any children of the step are still executing their contexts are automatically
+ disposed. Then actions are executed. Finally, the current
+ thread's test context is exited (unless was called).
+
+
+ The final test outcome.
+ The actual duration of the step, if null the step monitor
+ will record the duration as the total amount of time since the step monitor was started.
+ The final test result.
+
+
+
+
+ This method informs the test context that it may be finished on a
+ different thread than it started. This changes how the test context
+ will exit when finished.
+
+
+
+ After this method is called, the caller will become responsible for
+ exiting the context after if necessary.
+
+
+
+
+
+ Gets the parent context or null if this context has no parent.
+
+
+
+
+ Gets the test step associated with the context.
+
+
+
+
+ Gets the log writer for the test executing in this context.
+
+
+
+ Each test step gets its own log writer that is distinct from those
+ of other steps. So the log writer returned by this property is
+ particular to the step represented by this test context.
+
+
+
+
+
+ Gets or sets the lifecycle phase the context is in.
+
+ Thrown if is null.
+ Thrown if attempting to set the phase while the test is not running.
+
+
+
+
+ Gets the step's outcome or its interim outcome if the test is still running.
+
+
+
+ The value of this property is initially but may change
+ over the course of execution to reflect the anticipated outcome of the test. When
+ the test finishes, its outcome is frozen.
+
+
+ For example, this property enables code running as part of the tear down phase to
+ determine whether the test is failing and to perform different actions in that case.
+
+
+
+
+
+
+ Gets the user data collection associated with the context.
+
+
+
+ It may be used to associate arbitrary key/value pairs with the context.
+
+
+ Each context has its own distinct user data collection.
+
+
+
+
+
+ Gets the current assertion count.
+
+
+
+
+ Gets the final test result or null if the test has not yet finished running.
+
+
+
+ The test result cannot be changed.
+
+
+
+
+
+ Gets the message sink to which custom test messages may be published.
+
+
+
+
+ Returns true if the step associated with the context has finished execution
+ and completed all actions.
+
+
+
+
+ The event is raised when the test step
+ is finishing to perform resource reclamation or other updates.
+
+
+
+ Clients may attach handlers to this event to perform cleanup
+ activities and other tasks as needed. If a new event handler is
+ added and the step has already finished, the handler is immediately invoked.
+
+
+
+
+
+ Creates an observable test context.
+
+ The test context manager.
+ The test step.
+ The parent test context.
+ Thrown if or is null.
+
+
+
+ An observable test context manager creates and tracks test contexts and
+ publishes test messages back to a .
+
+
+
+
+ A test context manager provides access to the
+ and creates new s with the help of the tracker.
+
+
+
+
+ Starts a test step and returns its associated test context.
+
+
+
+ The current thread's test context is set to a new context for the
+ test step that is starting. The new context will be a child of the
+ current thread's context.
+
+
+ The test step.
+ The test context associated with the test step.
+ Thrown if is null.
+
+
+
+ Gets the test context tracker.
+
+
+
+
+ Creates a test context manager.
+
+ The test context tracker.
+ The message sink to which test message are published.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+ Gets the message sink to which test messages are published.
+
+
+
+
+ A log writer that sends messages to a .
+
+
+
+
+ Creates a log writer.
+
+ The test listener to which test messages are published.
+ The step id.
+ Thrown if or
+ is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A stub implementation of using a .
+
+
+
+ Does not fully support nested test steps or other dynamic features.
+
+
+
+
+
+
+
+ Creates a stub context.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The stub context tracker is a dummy implementation of
+ that is used in situations where the runtime environment has not been initialized.
+
+
+
+ A typical use of this stub is to support the use of certain framework methods from
+ clients that are not being executed inside of the Gallio test harness such as when
+ test code is run by third party tools.
+
+
+
+
+
+ The default context tracker tracks the current context by way
+ of the thread's and .
+
+
+
+ The .Net framework ensures that this context information flows across threads
+ during asynchronous callbacks, timer events and thread pool work item execution.
+
+
+
+
+
+ The context tracker tracks the associated with threads.
+
+
+
+ All context tracker operations are thread safe.
+
+
+
+
+
+ Enters a context.
+
+ The context to enter, or null to enter a scope without a context.
+ A cookie that can be used to restore the current thread's context to its previous value when disposed.
+
+
+
+ Sets the default context for the specified thread.
+
+
+
+ The default context for a thread is unless the thread's
+ default context has been overridden with .
+
+
+ Changing the default context of a thread is useful for capturing existing threads created
+ outside of a test into a particular context. Among other things, this ensures that side-effects
+ of the thread, such as writing text to the console, are recorded as part of the step
+ represented by the specified context.
+
+
+ The thread.
+ The context to associate with the thread, or null to reset the
+ thread's default context to inherit the once again.
+ Thrown if is null.
+
+
+
+ Gets the default context for the specified thread.
+
+
+
+ The default context for a thread is unless the thread's
+ default context has been overridden with .
+
+
+ Changing the default context of a thread is useful for capturing existing threads created
+ outside of a test into a particular context. Among other things, this ensures that side-effects
+ of the thread, such as writing text to the console, are recorded as part of the step
+ represented by the specified context.
+
+
+ The thread.
+ The default context of the thread.
+ Thrown if is null.
+
+
+
+ Gets the context of the current thread, or null if there is no
+ current context.
+
+
+
+ A thread's current context is determined in the following manner:
+
+ - If the thread's context stack is not empty then the top-most item of the
+ stack is used.
pushed a new item on this stack.
+ - Otherwise, if the thread has an default context, then it is used.
+
sets the default context for a thread.
+ - Otherwise, the
is used.
+
+
+
+ Context information may flow across threads by inheritance such that a child
+ thread acquires the context of its parent. However, each thread has its own
+ context stack distinct from that of any other.
+
+
+
+
+
+ Gets or the global context of the environment, or null if there is no
+ such context.
+
+
+
+
+ Initializes the context tracker.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creates a stub context tracker.
+
+
+
+
+ A function with zero arguments.
+
+ The result type.
+ The function result.
+
+
+
+ A function with one argument.
+
+ The first argument type.
+ The result type.
+ The first argument.
+ The function result.
+
+
+
+ A function with two arguments.
+
+ The first argument type.
+ The second argument type.
+ The result type.
+ The first argument.
+ The second argument.
+ The function result.
+
+
+
+ A function with three arguments.
+
+ The first argument type.
+ The second argument type.
+ The third argument type.
+ The result type.
+ The first argument.
+ The second argument.
+ The third argument.
+ The function result.
+
+
+
+ A function with four arguments.
+
+ The first argument type.
+ The second argument type.
+ The third argument type.
+ The fourth argument type.
+ The result type.
+ The first argument.
+ The second argument.
+ The third argument.
+ The fourth argument.
+ The function result.
+
+
+
+ This exception type is used to signal that a test has not produced a conclusive
+ pass or fail result.
+
+
+
+ The exception message, if present, should explain the
+ reason no conclusive result was obtained.
+
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Returns .
+
+
+
+
+ Attaches to a to provide assembly resolution services.
+
+
+
+
+ Installs an assembly resolver that provides access to the installation path
+ using the .
+
+
+
+ Does nothing if the host is local.
+
+
+ This hook is recommended for newly created domains.
+
+
+ The host.
+ The Gallio runtime path.
+ Thrown if or
+ is null.
+
+
+
+ Installs an assembly resolver that delegates to the creating 's
+ assembly resolver to locate assemblies whenever the host is unable to find them.
+
+
+
+ Does nothing if the host is local.
+
+
+ This hook is useful for testing but should not be used in production code.
+
+
+ The host.
+ Thrown if is null.
+
+
+
+ An isolated app domain host is a the runs code within an
+ isolated of this process. Communication with the
+ occurs over an inter- .Net
+ remoting channel.
+
+
+
+ The does not support the
+
+ option because it seems to be ignored by the .Net runtime except when set on
+ the default AppDomain of the process.
+
+
+
+
+
+ An implementation of that communicates with a
+ that resides in a different context
+ using .Net remoting.
+
+
+
+ This implementation also provides a mechanism for periodically polling
+ the remote service to keep it alive and to detect abrupt disconnection.
+
+
+
+
+
+ Creates an uninitialized host.
+
+ The host setup.
+ The logger for host message output.
+ The automatic ping interval, or null if none.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Connects to the remote host service.
+
+ The remote host service.
+
+
+
+
+
+
+ Creates an uninitialized host.
+
+ The host setup.
+ The logger for host message output.
+ The debugger manager.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+
+
+
+ An isolated process host is a that runs code within a
+ new external process.
+
+
+
+ Communication with the external process occurs over
+ an inter-process communication channel.
+
+
+ The host application is copied to a unique temporary folder and configured
+ in place according to the . Then it is launched
+ and connected to with inter-process communication. The process is pinged
+ periodically by the . Therefore it
+ can be configured to self-terminate when it looks like the connection
+ has been severed.
+
+
+
+
+
+ Creates an uninitialized host.
+
+ The host setup.
+ The logger for host message output.
+ The runtime path where the hosting executable will be found.
+ Thrown if
+ , or is null.
+
+
+
+
+
+
+
+
+
+ Creates the process task to start the process.
+
+
+
+ This method can be overridden to change how the process is started.
+
+
+ The executable path.
+ The command-line arguments.
+ The working directory.
+ The process task.
+
+
+
+ Prepares the parameters for the remote connection.
+
+ The unique id of the host.
+ Set to the host application arguments used to configure its server channel.
+ Set to a factory used to create the local client channel.
+ Set to a factory used to create the local server channel to allow the remote host to call back to this one.
+
+
+
+ Provides support for working with different implementations of the .Net runtime.
+
+
+
+
+ When using Mono, creates that re-enters the Mono runtime
+ if the executable is .Net otherwise creates a standard process start info.
+
+ The executable path.
+ The arguments.
+ The process start info.
+ Thrown if
+ or is null.
+
+
+
+ Returns true if the application is running within the Mono runtime.
+
+
+
+ It is occasionally necessary to tailor the execution of the test runner
+ depending on whether Mono is running. However, the number of such
+ customizations should be very limited.
+
+
+
+
+
+ Get the type of the .Net runtime currently executing this process.
+
+
+
+
+ Gets the .Net runtime version in use.
+
+
+
+ The runtime version indicates the version of the virtual machine that is running.
+ It cannot be used to distinguish among the .Net 2.0, 3.0 and 3.5 frameworks because
+ those frameworks are just libraries that usually run on the 2.0.50727 runtime on the CLR.
+
+
+ The runtime version, eg. "v2.0.50727" or "v4.0.30319"
+
+
+
+ Gets the version of the installed .Net 2.0 runtime, or null if not installed.
+
+ The runtime version, eg. "v2.0.50727"
+
+
+
+ Gets the version of the installed .Net 4.0 runtime version, or null if not installed.
+
+ The runtime version, eg. "v4.0.30319"
+
+
+
+ Gets the version of the most recent installed .Net runtime version.
+
+ The runtime version, eg. "v4.0.30319"
+
+
+
+ An exception that expresses a problem performing a runtime service.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Describes the runtime configuration of a .
+
+
+
+
+ Creates a default host configuration.
+
+
+
+
+ Clears the list of supported runtime versions.
+
+
+
+
+ Adds a supported runtime version number if it is not already in the configuration.
+
+ The version number, eg. "v2.0.50727".
+ Thrown if is null.
+
+
+
+ Removes a supported runtime version number.
+
+ The version number, eg. "v2.0.50727".
+ Thrown if is null.
+
+
+
+ Adds a binding to the configuration for the specified assembly.
+
+
+
+ Depending on how the binding is configured, this method will add an assembly dependency
+ record and possibly an assembly qualification record.
+
+
+ The assembly binding.
+ Thrown if is null.
+
+
+
+ Clears the list of assembly dependencies.
+
+
+
+
+ Adds an assembly dependency if it is not already in the configuration.
+
+ The assembly dependency to add.
+ Thrown if is null.
+
+
+
+ Adds an assembly dependency element if a suitable one does not already exist.
+
+ The assembly name.
+ The assembly public key token, or null if none.
+ The assembly culture.
+ The assembly processor architecture, or null if none.
+ The assembly dependency element.
+
+
+
+ Removes an assembly dependency.
+
+ The assembly dependency to remove.
+ Thrown if is null.
+
+
+
+ Clears the list of assembly qualifications.
+
+
+
+
+ Adds an assembly qualification if it is not already in the configuration.
+
+ The assembly qualification to add.
+ Thrown if is null.
+
+
+
+ Adds an assembly qualification element if a suitable one does not already exist.
+
+ The partial name to quality.
+ The full name.
+ The assembly qualification element.
+ Thrown if an assembly qualification already
+ exists for the same partial name but with a different full name.
+
+
+
+ Removes an assembly qualification.
+
+ The assembly qualification to remove.
+ Thrown if is null.
+
+
+
+ Overlays the with the additional configuration
+ entries necessary to enable the features described by this instance and returns
+ the combined Xml configuration.
+
+ The combined Xml configuration.
+
+
+
+ Overlays the with the additional configuration
+ entries necessary to enable the features described by this instance and writes
+ the combined Xml configuration to a .
+
+ The TextWriter where the Xml configuration will be written to.
+ Thrown if is null.
+ Thrown if the configuration could not be written.
+
+
+
+ Overlays the with the additional configuration
+ entries necessary to enable the features described by this instance and writes
+ the combined Xml configuration to a file with the given path.
+
+ The file path.
+ Thrown if is null.
+ Thrown if the configuration could not be written.
+
+
+
+ Creates a copy of the host configuration information.
+
+ The copy.
+
+
+
+ Gets or sets the primary Xml configuration data, or null if none.
+
+
+ The default value is null .
+
+
+
+
+ Gets or sets whether the legacy unhandled exception policy is enabled.
+
+
+ The default value is true which prevents the application from terminating
+ abruptly when an unhandled exception occurs.
+
+
+
+
+ Gets or sets whether to allow assemblies to be loaded from remote sources on .Net 4.0.
+
+
+ The default value is true which enables loading from remote sources.
+
+
+
+
+ Gets or sets whether the failure dialog is enabled.
+
+
+ The default value is false which prevents the assertion dialog from appearing
+ when an assertion fails.
+
+
+
+
+ Gets or sets whether remoting exceptions are substituted with custom errors instead
+ of being passed through to the remote client.
+
+
+ The default value is false which ensures that the remote client receives
+ all exception details.
+
+
+
+
+ Gets a read-only list of assembly qualifications.
+
+
+
+
+ Gets a read-only list of assembly dependencies.
+
+
+
+
+ Gets a read-only list of supported runtime versions in order of preference.
+
+
+
+ When the list is empty, the runtime version used to build the application is used.
+ Otherwise one of the supported runtimes in the list is used.
+
+
+ The default value is an empty list. Each entry should start with a "v". eg. "v2.0.50727".
+
+
+ Note that the host factory will use the property
+ to determine the actual runtime used for hosting. The purpose of this property is to
+ facilitate writing configuration files with supported runtime version information keeping
+ in mind that it can be ignored.
+
+
+
+
+
+ Describes an assembly name qualification configuration entry that
+ maps an assembly partial name to its full name.
+
+
+
+
+ Creates an assembly name qualification.
+
+ The assembly partial name to qualify.
+ The assembly full name to use.
+ Thrown if
+ or is null.
+
+
+
+ Creates a copy of the assembly qualification information.
+
+ The copy.
+
+
+
+ Gets or sets the assembly partial name to qualify.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the assembly full name to use.
+
+ Thrown if is null.
+
+
+
+ Describes a dependent assembly configuration entry that optionally
+ specifies the codebase, a publisher policy and binding redirects.
+
+
+
+
+ Creates an assembly dependency.
+
+ The assembly name.
+ Thrown if is null.
+
+
+
+ Creates a copy of the assembly dependency information.
+
+ The copy.
+
+
+
+ Clears the list of assembly binding redirects.
+
+
+
+
+ Adds an assembly binding redirect if it is not already in the configuration.
+
+ The assembly binding redirect to add.
+ Thrown if is null.
+
+
+
+ Adds an assembly binding redirect element if a suitable one is not already present.
+
+ Th old version range.
+ The new version for redirection.
+ The binding redirect element.
+
+
+
+ Removes an assembly binding redirect.
+
+ The assembly binding redirect to remove.
+ Thrown if is null.
+
+
+
+ Clears the list of assembly codebases.
+
+
+
+
+ Adds an assembly codebase if it is not already in the configuration.
+
+ The assembly codebase to add.
+ Thrown if is null.
+
+
+
+ Removes an assembly codebase.
+
+ The assembly codebase to remove.
+ Thrown if is null.
+
+
+
+ Adds an assembly code-base element if a suitable one is not already present.
+
+
+
+ If another codebase element exists with the same version but perhaps
+ a different Uri, then we do not add a new codebase since this most
+ likely indicates that the same assembly can be loaded from multiple locations.
+
+
+ The assembly version.
+ The code base uri.
+ The code base element.
+
+
+
+ Gets or sets assembly name.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the assembly public key token, or null if none.
+
+
+
+
+ Gets or sets the assembly culture, or null if none.
+
+
+
+
+ Gets or sets the assembly processor architecture, or null if none.
+
+
+
+
+ Gets or sets whether to apply the publisher policy for this assembly.
+
+
+ The default value is true.
+
+
+
+
+ Gets a read-only list of assembly binding redirect elements.
+
+
+
+
+ Gets a mutable list of assembly code base elements.
+
+
+
+
+ Describes an assembly binding redirection from an old version range to
+ a new version.
+
+
+
+
+ Creates an assembly binding redirect.
+
+ The range of old versions to redirect, specified
+ either as a single version such as "1.2.3.4" or as a range such as "1.2.3.4-10.11.12.13".
+ The new version to which the binding should be redirected
+ such as "1.2.3.4".
+ Thrown if
+ or is null.
+
+
+
+ Creates a copy of the assembly binding redirect information.
+
+ The copy.
+
+
+
+ Gets or sets the range of old versions to redirect, specified
+ either as a single version such as "1.2.3.4" or as a range such as "1.2.3.4-10.11.12.13"
+
+ Thrown if is null.
+
+
+
+ Gets or sets the new version to which the binding should be redirected
+ such as "1.2.3.4"
+
+ Thrown if is null.
+
+
+
+ Describes the location of the codebase of a particular assembly version.
+
+
+
+
+ Creates an assembly code base element.
+
+ The assembly version to which this element applies
+ such as "1.2.3.4"
+ The Uri that specifies the location of the assembly.
+ Thrown if
+ or is null.
+ Thrown if is not an absolute Uri.
+ Thrown if is not a well-formed Uri.
+
+
+
+ Creates a copy of the assembly binding redirect information.
+
+ The copy.
+
+
+
+ Gets or sets the assembly version to which this element applies
+ such as "1.2.3.4".
+
+ Thrown if is null.
+
+
+
+ Gets or sets the Uri that specifies the location of the assembly.
+
+ Thrown if is null.
+ Thrown if is not an absolute Uri.
+ Thrown if is not a well-formed Uri.
+
+
+
+ The type of exception thrown when hosting operations fail.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Provides utilities to interact with a over a
+ or .
+
+
+
+
+ Gets the name used to register the .
+
+
+
+
+ Gets a remote host service using the specified channel.
+
+ The channel.
+ The remote host service.
+
+
+
+ Registers the host service with a channel.
+
+ The remote host service.
+ The channel.
+ Thrown if or
+ is null.
+
+
+
+ Specifies a collection of parameters for setting up a .
+
+
+
+
+ Creates a default host setup.
+
+
+
+
+ Clears the list of hint directories.
+
+
+
+
+ Adds the relative or absolute path of a hint directory if it is not already in the host setup.
+
+
+
+ If relative, the path is based on the current working directory,
+ so a value of "" causes the current working directory to be used.
+
+
+ Relative paths should be canonicalized as soon as possible.
+ See .
+
+
+ The directory to add.
+ Thrown if is null.
+
+
+
+ Removes a hint directory.
+
+ The directory to remove.
+ Thrown if is null.
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the host setup information.
+
+ The copy.
+
+
+
+ Makes all paths in this instance absolute.
+
+ The base directory for resolving relative paths,
+ or null to use the current directory.
+
+
+
+ Writes a temporary configuration file for the application to disk and returns its path
+ based on .
+
+
+
+ The file is created with a unique name each time.
+
+
+ The file should be deleted by the caller when no longer required.
+
+
+ The full path of the configuration file that was written, or null if no file was written.
+ Thrown if
+ is null but is .
+ Thrown if the configuration file could not be written.
+
+
+
+ Gets a read-only collection of configuration properties for the host.
+
+
+
+
+ Gets or sets the relative or absolute path of the application base directory,
+ or null to use a default value selected by the consumer.
+
+
+
+ If relative, the path is based on the current working directory,
+ so a value of "" causes the current working directory to be used.
+
+
+ Relative paths should be canonicalized as soon as possible.
+ See .
+
+
+
+ The application base directory. Default is null .
+
+
+
+
+ Gets or sets the relative or absolute path of the working directory
+ or null to use a default value selected by the consumer.
+
+
+
+ If relative, the path is based on the current working directory,
+ so a value of "" causes the current working directory to be used.
+
+
+ Relative paths should be canonicalized as soon as possible.
+ See .
+
+
+
+ The working directory. Default is null .
+
+
+
+
+ Gets the read-only list of relative or absolute paths of
+ hint directories used to resolve assemblies.
+
+
+
+ If relative, the path is based on the current working directory,
+ so a value of "" causes the current working directory to be used.
+
+
+ Relative paths should be canonicalized as soon as possible.
+ See .
+
+
+
+
+
+ Gets or sets whether assembly shadow copying is enabled.
+
+ True if shadow copying is enabled. Default is false .
+
+
+
+ Gets or sets the debugger setup options, or null if not debugging.
+
+ The debugger setup options. Default is null .
+
+
+
+ Gets or sets the .Net runtime version of the host, or null to auto-detect.
+
+ The runtime version, eg. "v2.0.50727". Default is null .
+
+
+
+ Gets or sets whether the host should run with elevated privileges.
+
+ True if the host should have elevated privileges. Default is false .
+
+
+
+ Gets or sets where the host should write out the configuration file for the hosted components.
+
+ The configuration file location. Default is .
+
+
+
+ Gets or sets the host configuration information.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the processor architecture that the host should target, when supported.
+
+ The processor architecture. Default is
+
+
+
+ A factory for initialized hosts.
+
+
+
+
+ Gets the component Id of this factory.
+
+
+
+
+ Creates a host factory.
+
+ A reference to the debugger manager.
+ Thrown if is null.
+
+
+
+
+
+
+ A factory for initialized hosts.
+
+
+
+
+ Gets the component Id of this factory.
+
+
+
+
+ Creates a host factory.
+
+ The runtime.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the path of the runtime components, in particular the folder where Gallio.Host.exe is located.
+
+
+
+
+ A remotely accessible host service.
+
+
+
+
+
+ Creates a host service.
+
+ The maximum amount of time to wait for a ping
+ before automatically disposing the host service, or null if there should be no timeout.
+
+
+
+ Waits until the host service is shutdown or a ping timeout occurs.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns true if the watchdog timer expired.
+
+
+
+
+ Wraps a logger so that it can be accessed remotely.
+
+
+
+
+ Creates a wrapper for the specified logger.
+
+ The logger.
+ Thrown if is null.
+
+
+
+
+
+
+ Forwards messages to the host's logger.
+
+
+
+
+ Static service locator for .
+
+
+
+ Handles the case where the runtime is not initialized by returning a
+ .
+
+
+
+
+
+ Gets the global test context tracker singleton.
+
+
+
+
+ Generates test commands from a tree of tests using topological sort to
+ order tests by dependencies and a test order strategy for tie-breaking.
+
+
+
+
+ Creates a test command factory with a default test order strategy.
+
+
+
+
+
+
+
+ Gets or sets the test order strategy to use when deciding how test commands
+ should be sorted.
+
+ The test order strategy. Defaults to .
+ Thrown if is null.
+
+
+
+ A filter that matches objects whose
+ matches the specified name filter.
+
+
+
+
+ Abstract base class for filters that encapsulate a rule
+ for selecting some property of an object to be compared
+ against a string value filter.
+
+
+
+
+ A filter is a serializable predicate.
+
+
+
+ The framework uses filters to select among tests discovered through
+ the process of test enumeration.
+
+
+ Filters must be serializable objects defined in the framework assembly
+ or in plugins. The reason is that filter definitions may need to be
+ transferred across AppDomains so the filter's concrete type must be
+ known to the recipient. Filters do not implement
+ because there is no guarantee that a valid remoting context will exist
+ in which to carry out the operation. So, if you need a new filter type
+ put it in a plugin.
+
+
+
+
+
+ Determines whether the filter matches the value.
+
+ The value to consider, never null.
+ True if the filter matches the value.
+
+
+
+ Accepts a visitor and performs double-dispatch.
+
+ The visitor, never null.
+
+
+
+ Formats the filter to a string suitable for parsing by .
+
+ The formatted filter expression.
+
+
+
+ Creates a filter for some property by string value.
+
+ The string value filter.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the key that represents the filtered property.
+
+
+
+
+ Gets the string value filter.
+
+
+
+
+ Creates a name filter.
+
+ A filter for the name.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Describes an annotation in a portable manner for serialization.
+
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates an annotation.
+
+ The annotation type.
+ The code location.
+ The code reference.
+ The annotation message.
+ Additional details such as exception text or null if none.
+ Thrown if is null.
+
+
+
+ Copies the contents of an annotation.
+
+ The source annotation.
+ Thrown if is null.
+
+
+
+ Recreates a object from the annotation data.
+
+
+
+ Because an annotation data object does not contain all of the details of the original
+ annotation some information may be lost in the round trip.
+
+
+ The annotation.
+
+
+
+ Writes the annotation to a logger for presentation.
+
+ The logger.
+ If true, includes an identifying prefix to describe
+ the annotation type, otherwise we assume that the logger will do its own
+ thing based on the log severity.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the code element or null if none. (not serialized)
+
+
+
+
+ Gets or sets the annotation type.
+
+
+
+
+ Gets or sets the code location associated with the annotation.
+
+
+
+
+ Gets or sets the code reference associated with the annotation.
+
+
+
+
+ Gets or sets the annotation message.
+
+ Thrown if is null.
+
+
+
+ Gets or sets additional details such as exception text, or null if none.
+
+
+
+
+ A factory for .
+
+
+
+
+ A test tunner factory is a service that creates an
+ given a set of options.
+
+
+
+ Each factory has a name which is used by to select
+ the particular factory to use for a given test run.
+
+
+
+
+
+ Creates a test runner.
+
+ The test runner.
+
+
+
+ Creates a test runner factory.
+
+ The test isolation provider.
+ The test framework manager.
+ The extension manager.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ The default implementation of .
+
+
+
+
+ A test runner manager enumerates the names of the
+ services that are available and
+ provides a mechanism for creating instances.
+
+
+
+
+ Gets the factory by name, or null if none.
+
+ The name of the test runner factory, matched case-insensitively.
+ The test runner.
+ Thrown if is null.
+
+
+
+ Creates a test runner.
+
+ The name of the test runner factory, matched case-insensitively.
+ The test runner.
+ Thrown if is null.
+
+
+
+ Gets handles for all registered test runner factories.
+
+
+
+
+ Creates a test runner manager.
+
+ The factory handles.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Utilities for working with .
+
+
+
+
+ Recursively copies files and folders from the source path in the native
+ file system to the destination path within the report container.
+
+ The container.
+ The source file or directory path in the native file system.
+ The destination file or directory path in the report container.
+ Thrown if ,
+ or is null.
+
+
+
+ Describes the number of test cases with a particular .
+
+
+
+
+
+ Gets or sets the outcome.
+
+
+
+
+ Gets or sets the number of test cases with the specified outcome.
+
+
+
+
+ Provides constant names for the standard test runner factories.
+
+
+
+
+ Runs the test runner in the local AppDomain.
+
+
+
+ This is is usually the default mode because tests typically
+ run inside of isolated AppDomains of their own nested within
+ the test runner.
+
+
+
+
+
+ Runs the test runner in an isolated AppDomain of the current process.
+
+
+
+
+ Runs the test runner in an isolated process.
+
+
+
+
+ Initializes and shuts down the runtime.
+
+
+
+
+ Initializes the runtime.
+
+
+
+ Loads plugins and initalizes the runtime component model. The
+ specifics of the system can be configured by editing the appropriate
+ *.plugin files to register new components and facilities as required.
+
+
+ The runtime setup parameters.
+ The logger to attach, or null if none.
+ An object that when disposed automatically calls .
+ This is particularly useful in combination with the C# "using" statement
+ or its equivalent.
+ Thrown if is null.
+ Thrown if the runtime has already been initialized.
+
+
+
+ Shuts down the runtime if it is currently initialized.
+
+
+
+ Does nothing if the runtime has not been initialized.
+
+
+
+
+
+ Provides support for working with different process execution models.
+
+
+
+
+ Returns true if the current process is running in 32bit mode.
+
+
+
+
+ Returns true if the current process is running in 64bit mode.
+
+
+
+
+ Gets the process type of the current process.
+
+
+
+
+ Gets the integrity level of the current process.
+
+
+
+
+ Returns true if the current process has elevated privileges.
+
+
+
+
+ Specifies the version of the .Net framework.
+
+
+
+
+
+ .Net Framework 2.0.
+
+
+
+
+ .Net Framework 3.0.
+
+
+
+
+ .Net Framework 3.5.
+
+
+
+
+ .Net Framework 4.0.
+
+
+
+
+ Default implementation of .
+
+
+
+
+ The runtime is instantiated within the test runner to provide a suitable
+ hosting environment for test enumeration and execution.
+
+
+
+ The runtime provides services to support the Gallio test automation platform.
+ New services are typically registered by adding them to plugin configuration
+ files.
+
+
+
+
+
+ Initializes the runtime.
+
+ Thrown if the runtime could not be initialized.
+
+
+
+ Gets a deep copy of the runtime setup used to configure this runtime.
+
+ The runtime setup.
+
+
+
+ Gets the list of all plugin assembly bindings.
+
+ The assembly bindings.
+
+
+
+ Verifies that the runtime is correctly installed. Writes details to the log.
+
+ True if the installation appears ok.
+
+
+
+ Adds a log listener that will receive log messages dispatched to the runtime logger.
+
+ The log listener to add.
+ Thrown if is null.
+
+
+
+ Removes a log listener so that it will no longer receive log messages dispatched to the runtime logger.
+
+ The log listener to remove.
+ Thrown if is null.
+
+
+
+ Gets the plugin, service and component registry.
+
+
+
+
+ Gets the service locator.
+
+
+
+
+ Gets the resource locator.
+
+
+
+
+ Gets the runtime logger.
+
+
+
+
+ Gets the runtime assembly loader.
+
+
+
+
+ Gets the condition context that is used to enable or disable plugins,
+ components and services based on characteristics of the runtime environment.
+
+
+
+
+ An event that is fired when a log message is sent to the runtime logger.
+
+
+
+
+ Initializes the runtime.
+
+ The registry.
+ The plugin loader.
+ The assembly loader.
+ The runtime setup options.
+ Thrown if ,
+ , or
+ is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Default implementation of .
+
+
+
+
+ Provides privilege elevation services to perform tasks that require administrative rights.
+
+
+
+ This service interacts with the OS to determine whether the current user has administrative
+ rights and to prompt for elevation when required. For example, on Windows Vista this may
+ result in the appearance of a UAC dialog.
+
+
+ Windows does not support privilege elevation in process. Consequently the requested tasks
+ may be performed in a separate process when required. Parameters and results are
+ serialized and communicated with the foreign process via .Net serialization.
+
+
+ Since acquiring an elevation context may require prompting the user, they should
+ be used sparingly and in a reasonably coarse-grained manner (without compromising
+ security by running everything in an elevation context).
+
+
+
+
+
+ Acquires a context for performing elevated commands.
+
+
+
+ Provides the action with an elevation context for executing elevated commands.
+ Note that the action itself does not run with elevated privileges.
+
+
+ An action to be provided with an elevation context
+ within which elevated commands may be invoked.
+ Specifies the reason an elevation is required. The
+ reason may be displayed to the user to explain the purpose of the request.
+ True if the elevation context was acquired and the action completed
+ successfully, false if the action failed or elevation was forbidden by the user or by the
+ operating system.
+ Thrown if
+ or is null.
+
+
+
+ Returns true if the user of the current process has elevated privileges.
+
+
+
+
+ Creates an elevation manager.
+
+ The runtime, not null.
+
+
+
+
+
+
+
+
+
+ Provides a context within which commands may be executed with elevated privileges.
+
+
+
+
+ Executes an elevated command.
+
+ The command id.
+ The command arguments, must be null or serializable.
+ The progress monitor.
+ The command result.
+ Thrown if
+ or is null.
+
+
+
+ Performs an action using an elevation context.
+
+ The elevation context, not null.
+ True if the action completed successfully.
+
+
+
+ Impersonate a user according to the specified credentials.
+
+
+
+ Ref. Microsoft Help and Support .
+
+
+
+
+
+
+
+
+ Starts the impersonation process.
+
+ The name of the user to impersonate.
+ The domain where the user is defined.
+ The password.
+ Thrown if , ,
+ or is null.
+ Thrown when the impersonation process has failed.
+
+
+
+ Stops the impersonation process.
+
+
+
+
+ The Gallio.Runtime.Security namespace contains types for managing permissions
+ and performing privilege elevation on demand.
+
+
+
+
+ An exception that expresses a problem while trying to impersonata user account.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ A utility command to clear the current user's plugin metadata cache.
+
+
+
+
+
+
+
+ A utility command to load an XML test report and save
+
+
+
+
+
+
+
+ The arguments for the command.
+
+
+
+
+ The format of the output report name.
+
+
+
+
+ The format of the output report name.
+
+
+
+
+ The path of the output report (optiona).
+
+
+
+
+ Pack the resulting report in a compressed archive (optional).
+
+
+
+
+ The type of the output report.
+
+
+
+
+ An elevated command used for resetting the installation id.
+
+
+
+
+ The id of this elevated command.
+
+
+
+
+ Initializes the command.
+
+
+
+
+
+
+
+ Arguments for the command.
+
+
+
+
+ A utility command to reset the installation id.
+
+
+
+
+ Creates the command.
+
+ The elevation manager, not null.
+
+
+
+
+
+
+ The default utility command manager implementation.
+
+
+
+
+ Provides services for managing utility commands.
+
+
+
+
+ Gets the utility command with the specified name ignoring case, or null if not registered.
+
+ The command name.
+ The command.
+ Thrown if is null.
+
+
+
+ Gets handles for all registered utility commands.
+
+
+
+
+ Creates a utility command manager.
+
+ The command handles, not null.
+
+
+
+
+
+
+
+
+
+ The Gallio.Runtime.UtilityCommands namespace contains types for defining
+ an extensible set of utility commands that can be invoked from the
+ Gallio.Utility.exe application.
+
+
+
+
+ Describes the execution context of a utility command and allows it
+ to interact with the environment.
+
+
+
+
+ Creates a utility command context.
+
+ The parsed command line arguments.
+ The console.
+ The logger.
+ The progress monitor provider.
+ The verbosity.
+ Thrown if ,
+ , or is null.
+
+
+
+ Gets the parsed command-line arguments.
+
+
+
+
+ Gets the console.
+
+
+
+
+ Get the logger for writing messages to the console colored and
+ filtered by severity.
+
+
+
+
+ Gets the progress monitor provider for obtaining console progress monitors,
+ or a null progress monitor provider if progress monitoring has been disabled.
+
+
+
+
+ Gets the verbosity requested by the user.
+
+
+
+
+ Provides traits for .
+
+
+
+
+ Creates utility command traits.
+
+ The unique name of the utility command.
+ The description of the utility command.
+
+
+
+ Gets the unique name of the utility command.
+
+
+
+
+ Gets the description of the utility command.
+
+
+
+
+ A utility command to verify that the plugin metadata and installation parameters are correct.
+
+
+
+
+ Creates the command.
+
+ The runtime, not null.
+
+
+
+
+
+
+ Describes an assembly used by a plugin and how the loader should bind to it.
+
+
+
+
+ Creates an uninitialized assembly reference for XML deserialization.
+
+
+
+
+ Creates an assembly reference.
+
+ The assembly full name.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the assembly full name.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the assembly code base as a relative path to the plugin
+ base directory or to the 'bin' directory within, or null if none.
+
+
+
+
+ Gets or sets whether the assembly full name should be used to qualify all partial
+ name references to the assembly.
+
+
+
+
+ Gets or sets whether to apply the assembly publisher policy. Default is true .
+
+
+
+
+ Gets the mutable list of assembly binding redirects.
+
+
+
+
+ Describes a plugin cache file.
+
+
+
+ This type supports the framework and is not intended to be used by client code.
+
+
+
+
+
+ Creates an empty cache.
+
+
+
+
+
+
+
+ Gets or sets the installation id of the Gallio installation whose plugin information has been recorded in the cache, or null if not known.
+
+
+
+
+ Gets the mutable list of plugin information records in the cache.
+
+
+
+
+ Represents a component descriptor in Xml.
+
+
+
+
+ Creates an uninitialized component descriptor for XML deserialization.
+
+
+
+
+ Creates a component descriptor.
+
+ The component id.
+ The service id.
+ The assembly-qualified component type name.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ Gets or sets the component id.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the service id.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the assembly-qualified component type name, or null to use the
+ default for the service.
+
+
+
+
+ Gets or sets the component parameters, or null if there are none.
+
+
+
+
+ Gets or sets the component traits, or null if there are none.
+
+
+
+
+ Describes information about a plugin whose metadata has been cached.
+
+
+
+ This type supports the framework and is not intended to be used by client code.
+
+
+
+
+
+
+
+
+ Gets or sets the plugin file path.
+
+
+
+
+ Gets or sets the plugin file modification time stamp.
+
+
+
+
+ Gets or sets the plugin metadata.
+
+
+
+
+ Gets or sets the plugin base directory path.
+
+
+
+
+ Specifies an old version range for an assembly binding redirect.
+
+
+
+
+ Creates an uninitialized assembly binding redirect for XML deserialization.
+
+
+
+
+ Creates an assembly binding redirect.
+
+
+
+ Accepts a version number like "1.2.3.4" or a range like "1.0.0.0-1.1.65535.65535".
+
+
+ The old assembly version number or range.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the old assembly version number or range.
+
+
+
+ Accepts a version number like "1.2.3.4" or a range like "1.0.0.0-1.1.65535.65535".
+
+
+ Thrown if is null.
+
+
+
+ Describes a file that belongs to a plugin.
+
+
+
+
+ Creates an uninitialized file description for XML deserialization.
+
+
+
+
+ Creates a file description.
+
+ The path of the file relative to the plugin base directory.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the path of the file relative to the plugin base directory.
+
+ Thrown if is null.
+
+
+
+ Describes a dependency on another plugin.
+
+
+
+
+ Creates an uninitialized dependency for XML deserialization.
+
+
+
+
+ Creates an plugin dependency reference.
+
+ The referenced plugin id.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the referenced plugin id.
+
+ Thrown if is null.
+
+
+
+ The Gallio.Runtime.Extensibility.Schema namespace contains the plugin Xml schema.
+
+
+
+
+ Represents a plugin descriptor in Xml.
+
+
+
+
+ Creates an uninitialized plugin descriptor for XML deserialization.
+
+
+
+
+ Creates a plugin descriptor with an id.
+
+ The plugin id.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the plugin id.
+
+ Thrown if is null.
+
+
+
+ Gets or sets a condition governing the activation of the plugin,
+ or null if there is no condition. The plugin will be disabled if a
+ condition is provided but is not satisfied.
+
+
+
+
+
+ Gets or sets the recommended installation path for the plugin files relative to
+ the runtime installation directory, or null if there is no preference.
+
+
+
+
+ Gets or sets the assembly-qualified plugin type name, or null if the default
+ implementation may be used.
+
+
+
+
+ Gets the mutable list of plugin dependencies.
+
+
+
+
+ Gets the mutable list of files that belong to a plugin.
+
+
+
+
+ Gets the mutable list of plugin assembly bindings.
+
+
+
+
+ Gets the mutable list of services belonging to the plugin.
+
+
+
+
+ Gets the mutable list of components belonging to the plugin.
+
+
+
+
+ Gets or sets the plugin parameters, or null if there are none.
+
+
+
+
+ Gets or sets the plugin traits, or null if there are none.
+
+
+
+
+ Gets the mutable list of additional probing paths in which to
+ attempt to locate referenced assemblies.
+
+
+
+
+ Represents a table of key and value pairs as a sequence of Xml elements whose local name
+ represents the key and whose text body contains the value.
+
+
+
+
+ Creates an empty key value table.
+
+
+
+
+ Gets or sets the Xml elements that describe the property entries
+ during serialization.
+
+ Thrown if is null.
+
+
+
+ Gets or sets a mutable view of the properties as a property set.
+
+ Thrown if is null.
+
+
+
+ Represents a service descriptor in Xml.
+
+
+
+
+ Creates an uninitialized service descriptor for XML deserialization.
+
+
+
+
+ Creates a service descriptor.
+
+ The service id.
+ The service type.
+ Thrown if or
+ is null.
+
+
+
+
+
+
+ Gets or sets the service id.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the assembly-qualified service type name.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the assembly-qualified default component type name, or null if none.
+
+
+
+
+ An exception that expresses a data validation error.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Represents a collection of preferences in Xml.
+
+
+
+
+ Creates a preference container.
+
+
+
+
+
+
+
+ Gets the mutable list of preference settings.
+
+
+
+
+ Represents a preference setting in Xml.
+
+
+
+
+ Creates an uninitialized preference setting for XML deserialization.
+
+
+
+
+ Creates a preference setting.
+
+ The setting name.
+ The setting value.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ Gets or sets the preference setting name.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the preference setting value.
+
+ Thrown if is null.
+
+
+
+ Defines constants used throughout the Gallio schema.
+
+
+
+
+ The XML namespace for all schema types.
+
+
+
+
+ Validation utilities.
+
+
+
+ These utilities are not intended to be used for argument validation; use
+ code that throws for that instead. The validation
+ utilities are intended for use by self-validating objects
+ that provide the ability to validate their state after construction for internal
+ consistency.
+
+
+
+
+
+ Validates that an item is not null.
+
+ The item type.
+ The name of the item.
+ The item to validate.
+
+
+
+ Validates that an item is a valid assembly name.
+
+ The name of the item.
+ The value to validate.
+
+
+
+ Validates that all items in a collection are not null.
+
+ The item type.
+ The name of the collection.
+ The collection to validate.
+ Thrown if the validation fails.
+
+
+
+ Validates all non-null items of an enumeration of validatable elements.
+
+ The item type.
+ The items to validate.
+ Thrown if the validation fails.
+
+
+
+ An immutable record that holds three values.
+
+ The type of the first value.
+ The type of the second value.
+ The type of the third value.
+
+
+
+ Creates a triple.
+
+ The first value.
+ The second value.
+ The third value.
+
+
+
+ Gets the first value.
+
+
+
+
+ Gets the second value.
+
+
+
+
+ Gets the third value.
+
+
+
+
+ Default implementation of IFileSystem using System.IO classes.
+
+
+
+
+ Wrapper for static System.IO.File operations to
+ allow testing.
+
+
+
+
+ Checks if a given file exists (File.Exists).
+
+ The path of the file.
+ True if the file exists, otherwise False.
+
+
+
+ Checks if a path is relative or absolute (Path.IsPathRooted).
+
+ The path to check.
+ True if the path is absolute, otherwise False.
+
+
+
+ Checks if a directory exists (Directory.Exists)
+
+ The location of the directory.
+ True if the directory exists, otherwise False.
+
+
+
+ Attempts to create a directory.
+
+ The location of the directory.
+
+
+
+ Attempts to delete a file.
+
+ The location of the file.
+
+
+
+ Attempts to open a file using the default program.
+
+ The location of the file.
+
+
+
+ Opens an existing file for reading.
+
+ The location of the file.
+ The content of the file as a readable stream.
+
+
+
+ Returns a list of matching files in the specified directory.
+
+ The directory to inspect.
+ The pattern to match files with.
+ Whether to search all directories or just
+ the top-level one.
+ A string array of filenames.
+
+
+
+ Copies an existing file to a new file. Overwriting a file of the same name is allowed.
+
+ The file to copy.
+ The name of the destination file.
+ This cannot be a directory or an existing file.
+ true if the destination file can be overwritten;
+ otherwise, false.
+
+
+
+ Deletes the specified directory and, if indicated,
+ any subdirectories in the directory.
+
+ The name of the directory to remove.
+ true to remove directories, subdirectories,
+ and files in path; otherwise, false.
+
+
+
+ Copy a directory and contents.
+
+ The path of the directory to copy.
+ The destination.
+
+
+
+ Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
+
+ The location of the file.
+ The binary contents of the file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides Xml serialization and deserialization services.
+
+
+
+
+ Saves an object graph to a pretty-printed Xml file using .
+
+ The root object.
+ The filename.
+ The root object type.
+ Thrown if
+ or is null.
+
+
+
+ Loads an object graph from an Xml file using .
+
+ The filename.
+ The root object.
+ The root object type.
+ Thrown if is null.
+
+
+
+ A structure that memoizes the result of some computation for later reuse.
+
+
+
+ Not thread safe.
+
+
+ The value type.
+
+ valueMemoizer = new Memoizer();
+
+ public int GetValue()
+ {
+ return valueMemoizer.Memoize(() =>
+ {
+ // Expensive calculation here.
+ return 42;
+ });
+ }
+ }
+ ]]>
+
+
+
+
+ Gets the memoized value if available, otherwise populates it
+ using the specified populator function and stores it for later reuse.
+
+ The populator.
+ The value returned by the populator, possibly memoized.
+
+
+
+ Sets when created, then
+ restores it when disposed.
+
+
+
+
+ Saves the current directory then changes it to the specified value.
+
+ The new directory.
+ Thrown if is null.
+ Thrown if the current directory could not be set.
+
+
+
+ Resets the current directory to its original saved value.
+
+ Thrown if the current directory could not be reset.
+
+
+
+ Resets the current directory to its original saved value if disposing.
+
+ True if was called directly.
+ Thrown if the current directory could not be reset.
+
+
+
+ Provides a few functions for working with and
+ and reporting unhandled exceptions in event
+ handlers safely via .
+
+
+
+
+ Safely invokes each delegate in the invocation list of an event handler.
+ Sends any exceptions thrown by the handler to .
+
+ The event handler chain.
+ The sender.
+ The event arguments.
+
+
+
+ Safely invokes each delegate in the invocation list of an event handler.
+ Sends any exceptions thrown by the handler to .
+
+ The event handler chain.
+ The sender.
+ The event arguments.
+
+
+
+ A structure that memoizes the result of some computation for later reuse.
+ Maintains an internal dictionary to memoize results by key.
+
+
+
+ Not thread safe.
+
+
+ The key type.
+ The value type.
+
+ valueMemoizer = new KeyedMemoizer();
+
+ public int GetValue(string key)
+ {
+ return valueMemoizer.Memoize(key, () =>
+ {
+ // Expensive calculation here.
+ return 42;
+ });
+ }
+ }
+ ]]>
+
+
+
+
+ Gets the memoized value for the given key if available, otherwise populates it
+ using the specified populator function and stores it in association with its keys
+ for later reuse.
+
+ The key by which to look up a memoized result.
+ The populator for the value associated with the key.
+ The value returned by the populator, possibly memoized.
+
+
+
+ This class provides a mechanism for reporting unhandled exceptions when the infrastructure
+ is otherwise unable to deal with them locally.
+
+
+
+ The methods of this class should be considered as the last resort for reporting failures
+ that might otherwise cause the system to crash.
+
+
+
+
+
+ Reports an unhandled exception.
+
+ A message to explain how the exception was intercepted.
+ The unhandled exception.
+ Thrown if or is null.
+
+
+
+ Adds or removes an event handler that is notified when unhandled exceptions occur
+ and is given a chance to add additional information the event about the
+ context in which the exception occurred.
+
+
+
+
+
+ Adds or removes an event handler that is notified when unhandled exceptions occur.
+
+
+
+
+ Returns true if there is at least one handler registered for
+ .
+
+
+
+ This property can be used to avoid duplicate exception reporting
+ if some other system component has already registered a handler.
+
+
+
+
+
+ Formats filters in such manner that they can be reparsed using the
+ .
+
+
+
+
+
+ Visits the structure of filters.
+
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+ Visits a .
+
+ The filter.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the formatted filter contents.
+
+ The formatted filter.
+
+
+
+ An equality filter compares values for strict equality.
+
+
+
+
+ Creates an equality filter.
+
+ The value to compare for equality.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the value to compare for equality.
+
+
+
+
+ Provides utilities for manipulating filters.
+
+
+
+
+ Parses a test filter set.
+
+ The filter expression.
+ The parsed filter set.
+
+
+
+ Parses a test filter.
+
+ The filter expression.
+ The parsed filter.
+
+
+
+ Creates filters of a given type based on a specification that
+ consists of a filter key and a rule for matching values.
+
+ The filter type.
+
+
+
+ Creates a filter from a specification
+
+ The filter key that identifies the kind of filter to create.
+ The filter to use as a rule for matching values.
+ The filter.
+
+
+
+ Builds filters for objects.
+
+
+
+ Recognizes the following filter keys:
+
+ - Id: Filter by id
+ - Name: Filter by name
+ - Assembly: Filter by assembly name
+ - Namespace: Filter by namespace name
+ - Type: Filter by type name, including inherited types
+ - ExactType: Filter by exact type name, excluding inherited types
+ - Member: Filter by member name
+ - *: All other names are assumed to correspond to metadata keys
+
+
+
+ The subtype.
+
+
+
+
+
+
+ A regex filter matches strings against a given .
+
+
+
+ Null string values are converted to empty strings for regex evaluation purposes.
+
+
+
+
+
+ Creates an regex filter.
+
+ The regular expression for matching strings.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the regular expression for matching strings.
+
+
+
+
+ Filter record for Gallio project.
+
+
+
+
+ Parameterless constructor for serialization.
+
+
+
+
+ Creates a filter description.
+
+ The name of the filter.
+ The filter expression.
+ Thrown if or
+ is null.
+
+
+
+ Creates a copy of the filter.
+
+ The new copy.
+
+
+
+
+
+
+ Gets or sets the name of the filter.
+
+ Thrown if is null.
+
+
+
+ Gets or sets a string representation of the filter expression.
+
+ Thrown if is null.
+
+
+
+ Describes a test project in a portable manner for serialization.
+
+
+
+
+ Creates an empty test project.
+
+
+
+
+ Copies the contents of a test project.
+
+ The source test project.
+ Thrown if is null.
+
+
+
+ Initializes a test project with the contents of this structure.
+
+ The test project to populate.
+ Thrown if is null.
+
+
+
+ Creates a test project with the contents of this structure.
+
+ The test project.
+
+
+
+ Makes the test project paths relative to the specified base path.
+
+ The base path.
+ Thrown if is null.
+
+
+
+ Makes the test project paths absolute given the specified base path.
+
+ The base path.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the test package.
+
+ Thrown if is null.
+
+
+
+ Gets a mutable list of named test filters for the project.
+
+
+
+
+ Gets a mutable list of test runner extensions used by the project.
+
+
+
+
+ Gets or sets the folder to save generated reports to.
+
+
+
+ Relative to project location, if not absolute.
+
+
+ Thrown if is null.
+
+
+
+ Gets or sets the format for the filename of generated reports.
+
+ Thrown if is null.
+
+
+
+ Default implementation of a report reader.
+
+
+
+
+ A report reader provides services for loading a previously saved report
+ from a .
+
+
+
+
+ Loads the report from an XML file.
+
+
+
+ The path of the saved report is constructed by appending the extension ".xml"
+ to the container's .
+
+
+ If true, loads attachment
+ contents in referenced content files if they were not embedded otherwise
+ the attachment contents are not loaded (but may be loaded later using ).
+ The progress monitor.
+ The loaded report.
+ Thrown if is null.
+
+
+
+ Loads referenced report attachments from the container.
+
+
+
+ This method has the effect of populating the contents of all
+ nodes in the report that have non-null .
+
+
+ The report whose attachments are to be loaded.
+ The progress monitor.
+ Thrown if or is null.
+
+
+
+ Gets the report container.
+
+
+
+
+ Creates a report reader.
+
+ The report container.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Default implementation of a report writer.
+
+
+
+
+ A report writer provides services for formatting or saving a report
+ to a .
+
+
+
+ The writer tracks the paths of the report documents paths
+ that are created within the report container. Likewise it remembers whether
+ attachments have been saved so as to avoid redundantly resaving them when
+ the same report is generated in multiple formats.
+
+
+
+
+
+ Adds the path of a report document that has been created within the report container.
+
+ The document path.
+
+
+
+ Serializes the report to XML.
+
+ The XML writer.
+ The content disposition to use for all attachments.
+ Thrown if is null.
+
+
+
+ Saves the report as an XML file.
+
+
+
+ The saved report XML file is automatically added to the list.
+
+
+ The path of the saved report is constructed by appending the extension ".xml"
+ to the container's .
+
+
+ This method may do nothing if the report has already been saved.
+
+
+ The content disposition to use for all attachments. If
+ the content disposition is then
+ this method will automatically call to save the attachments.
+ The progress monitor.
+ Thrown is null.
+
+
+
+ Saves all report attachments as individual content files to the container.
+
+
+
+ The convention for attachments is to save them in a directory with the same name
+ as the container's arranged in folders
+ first by test id then by step id then by attachment name.
+ For example: "Report\{testid}\{stepid}\attachment.jpg".
+
+
+ This method may do nothing if the attachments have already been saved.
+
+
+ The progress monitor.
+ Thrown if is null.
+
+
+
+ Gets the report being generated.
+
+
+
+
+ Gets the report container.
+
+
+
+
+ Gets the paths of all report documents that have been generated within
+ the report container.
+
+
+
+ Report documents are the primary files when reports
+ are formatted or saved such as an XML file, a Text file, or the main
+ HTML file that contains the body of the report.
+
+
+
+
+
+ Creates a report writer for the specified report.
+
+ The report.
+ The report container.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A file-system based representation of a report container that uses
+ ordinary files and folders to store report contents.
+
+
+
+
+ Creates a file-system based representation of a report container.
+
+ The report directory path.
+ The report name.
+ Thrown if or
+ is null.
+ Thrown if is an empty string.
+
+
+
+
+
+
+
+
+
+
+
+
+ Contains the result of a complete test run.
+
+
+
+
+ Creates a launcher result object.
+
+ The test report.
+
+
+
+ Sets the result code of the result.
+
+ The new result code.
+
+
+
+ Adds a new report document path.
+
+ The report document path.
+ Thrown if is null.
+
+
+
+ Generates reports of the desired forms.
+
+
+
+ This method adds the paths of the generated report documents to .
+
+
+ The report directory.
+ The report name.
+ Determines whether to enclose the resulting test report in a compressed archive file.
+ The report formats to generate.
+ The report formatter options.
+ The report manager.
+ A progress monitor for the operation.
+ Thrown if ,
+ , , ,
+ , or is null.
+
+
+
+ Shows the report documents enumerated in the launcher result.
+
+ True if the report documents were successfully opened.
+
+
+
+ Gets the result code.
+
+
+
+
+ Gets the test report.
+
+
+
+ The report might be incomplete in varying degrees depending on how much
+ of the test execution was successfully performed.
+
+
+
+
+
+ Gets a short summary with the number of test that passed, failed and so on.
+
+
+
+
+ Gets the statistics of the execution from the report
+ or an empty statistics object if none.
+
+
+
+
+ Gets the full paths of the formatted report documents.
+
+ The full paths of the formatted report documents.
+
+
+
+ Describes a test model component in a portable manner for serialization.
+
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates a test component.
+
+ The component id.
+ The component name.
+ Thrown if or is null.
+
+
+
+ Copies the contents of a test component.
+
+ The source object.
+
+
+
+ Gets or sets the code element or null if none. (not serialized)
+
+
+
+
+ Gets or sets the test component id. (non-null)
+
+ Thrown if is null.
+
+
+
+
+ Gets or sets the test component name. (non-null)
+
+ Thrown if is null.
+
+
+
+
+ Gets or sets the code reference or if not available.
+
+
+
+
+
+ Gets or sets the code location or if not available.
+
+
+
+
+
+ Gets or sets the metadata map. (non-null)
+
+ Thrown if is null.
+
+
+
+
+ Describes a test step in a portable manner for serialization.
+
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates a step.
+
+ The step id.
+ The step name.
+ The full name of the step.
+ The test id.
+ Thrown if , ,
+ or is null.
+
+
+
+ Copies the contents of a test step.
+
+ The source test step.
+ Thrown if is null.
+
+
+
+ Recreates a object from the test data.
+
+
+
+ Because a test step data object does not contain all of the details of the original
+ test step some information may be lost in the round trip.
+
+
+ The test to which the step belongs.
+ The parent test step, or null if none.
+ The test step.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the full name of the step.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the id of the parent step.
+
+
+
+
+ Gets or sets the id of the test to which the step belongs.
+
+ Thrown if is null.
+
+
+
+ Gets or sets whether the test step is primary.
+
+
+
+
+
+ Gets or sets whether the test step represents a test case.
+
+
+
+
+
+ Gets or sets whether the test step is dynamic.
+
+
+
+
+
+ Describes a test parameter in a portable manner for serialization.
+
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates a parameter data object.
+
+ The component id.
+ The component name.
+ Thrown if or
+ is null.
+
+
+
+ Copies the contents of a test parameter.
+
+ The source test parameter.
+ Thrown if is null.
+
+
+
+ Recreates a object from the test data.
+
+
+
+ Because a test parameter data object does not contain all of the details of the original
+ test parameter some information may be lost in the round trip.
+
+
+ The test parameter.
+
+
+
+
+
+
+ Describes a test in a portable manner for serialization.
+
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates a test data object.
+
+ The component id.
+ The component name.
+ The full name of the test.
+ Thrown if , ,
+ or is null.
+
+
+
+ Copies the contents of a test recursively including its children.
+
+ The source test.
+ Thrown if is null.
+
+
+
+ Copies the contents of a test.
+
+ The source test.
+ If true, does not recursively populate the children of the test.
+ Thrown if is null.
+
+
+
+ Recreates a object from the test data.
+
+
+
+ Because a test data object does not contain all of the details of the original
+ test some information may be lost in the round trip.
+
+
+ The test.
+
+
+
+
+
+
+
+
+
+ Gets or sets the full name of the test.
+
+ Thrown if is null.
+
+
+
+ Gets or sets whether this node is a test case.
+
+
+
+
+
+ Gets the mutable list of children.
+
+
+
+
+
+ Gets the mutable list of parameters.
+
+
+
+
+
+ Recursively enumerates this test and all of its descendants.
+
+
+
+
+ Provides options that control how test execution occurs.
+
+
+
+
+ Creates a default set of test execution options.
+
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the options.
+
+ The copy.
+
+
+
+ Gets or sets the filter set.
+
+ Defaults to an empty filter set.
+ Thrown if is null.
+
+
+
+ Gets or sets whether the filter exactly specifies all tests to select.
+
+
+
+ If false , then children of the selected tests are also included.
+
+
+ Defaults to false.
+
+
+
+ Gets or sets whether to skip running tests that use dynamic data items.
+
+
+
+ This flag can be useful in combination with
+ to enumerate non-dynamic tests only.
+
+
+ Defaults to false
+
+
+
+ Gets or sets whether to skip the execution of tests.
+
+
+
+ The test runner will go through most of the motions of running tests but will skip
+ the actual execution phase. This option can be used to enumerate data-driven test
+ steps without running them. It can also be used to verify that the execution
+ environment is sane without doing most of the work of running the tests.
+
+
+ Defaults to false
+
+
+
+ Gets or sets whether to run tests within a single thread. This ensures that the
+ tests will run on the same thread as the initial call to the test harness (unless
+ the test framework itself spawns any new threads).
+
+
+
+ When tests are run single-threaded, the test harness will no longer be able to guarantee
+ that the default apartment state is .
+
+
+ Defaults to false .
+
+
+
+ Gets a read-only collection of configuration properties for test execution.
+
+
+
+
+ The test model captures the root of the test data tree along with an index by id.
+
+
+
+ This class is safe for used by multiple threads.
+
+
+
+
+
+ Creates an empty test model with just a root test.
+
+
+
+
+ Copies the contents of a test model.
+
+ The source test model.
+ Thrown if is null.
+
+
+
+ Creates a test model.
+
+ The root test.
+ Thrown if is null.
+
+
+
+ Gets the number of error annotations on the model.
+
+ The numer of error annotations present.
+
+
+
+ Gets a test by its id.
+
+ The test id.
+ The test, or null if not found.
+ Thrown if is null.
+
+
+
+ Resets the test index by id in case the test model has been modified.
+
+
+
+
+ Merged a subtree of tests into the model.
+
+
+
+ Merges tests with duplicate ids. Adds new tests in place.
+
+
+ The id of the parent test, or null if adding the root.
+ The top test of the subtree to add.
+ The merged test, if the test was already present in the tree.
+ Thrown if is null.
+
+
+
+ Gets or sets the root test in the model.
+
+ Thrown if is null.
+
+
+
+ Gets the mutable list of annotations.
+
+
+
+
+
+ Recursively enumerates all tests including the root test.
+
+
+
+
+ A test result describes the final result of having executed a test.
+
+
+
+
+ Creates a test result with an inconclusive outcome.
+
+
+
+
+ Creates a test result with a particular outcome.
+
+ The outcome.
+
+
+
+ Creates a copy of the test result.
+
+ The copy.
+
+
+
+
+
+
+ Gets or sets the test outcome, including its children (unless they were skipped
+ or are otherwise irrelevant to the outcome of their parent).
+
+
+ Defaults to .
+
+
+
+
+ Gets or sets the number of assertions evaluated by the test, including its children.
+
+
+
+
+ Gets or sets the test duration, including its children.
+
+
+
+
+ Gets or sets the test duration in seconds, including its children.
+
+
+
+
+ The default implementation of .
+
+
+
+
+ The report manager provides services for manipulating reports.
+
+
+
+
+ Gets the report formatter with the specified name, or null if none.
+
+ The formatter name.
+ The formatter, or null on failure.
+ Thrown if is null.
+
+
+
+ Formats the report indicated by the report writer.
+
+ The report writer.
+ The formatter name.
+ The report formatter options.
+ The progress monitor.
+ Thrown if , ,
+ or is null.
+ Thrown if there is no formatter with the specified name.
+
+
+
+ Gets a report reader to load a report from the specified container.
+
+ The report container.
+ The report reader.
+ Thrown if is null.
+
+
+
+ Gets a report writer to save or format a report to the specified container.
+
+ The report.
+ The report container.
+ The report writer.
+ Thrown if or is null.
+
+
+
+ Gets handles for all registered formatters.
+
+
+
+
+ Creates a report manager.
+
+ The report formatter handles.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A report formatter provides a strategy for formatting reports for human consumption.
+
+
+
+
+ Formats the report indicated by the report writer.
+
+ The report writer.
+ The report formatter options.
+ The progress monitor.
+ Thrown if ,
+ or is null.
+
+
+
+ Summarizes the execution of a test package for reporting purposes.
+
+
+
+
+ Creates an empty package run.
+
+
+
+
+ Gets or sets the time when the package run started.
+
+
+
+
+ Gets or sets the time when the package run ended.
+
+
+
+
+ Gets or sets the root test step run, or null if the root test has not run.
+
+
+
+
+ Gets or sets the statistics for the package run.
+
+ Thrown if is null.
+
+
+
+ Recursively enumerates all test step runs including the root test step run.
+
+
+
+
+ Collects summary statistics about test execution for reporting purposes.
+
+
+
+
+ Creates an empty statistics record.
+
+
+
+
+ Gets the number of tests with the specified outcome.
+
+ The outcome.
+ The number of tests with the specified outcome.
+
+
+
+ Sets the number of tests with the specified outcome.
+
+ The outcome.
+ The count.
+ Thrown if is less than 0.
+
+
+
+ Formats a single line of text summarizing test case results.
+
+
+
+
+ Merges statistics from a test step run, incrementing the relevant counters.
+
+ The test step run.
+ Thrown if is null.
+
+
+
+ Updates the test outcome statistics counters with an the outcome of a test.
+
+
+ Does not update the test or step count.
+
+ The test outcome.
+
+
+
+ Gets or sets the number of assertions evaluated.
+
+
+
+
+ Gets or sets the total duration summarized tests in seconds.
+
+
+
+
+ Gets or sets the number of test cases that were run.
+
+
+
+
+ Gets or sets the number of test cases that ran and passed.
+
+
+
+
+ Gets or sets the number of test cases that ran and failed.
+
+
+
+
+ Gets or sets the number of test cases that ran and were inconclusive.
+
+
+
+
+ Gets or sets the number of test cases that did not run.
+
+
+
+
+ Gets or sets the total number of test cases.
+
+
+
+
+ Gets or sets the total number of test steps.
+
+
+
+
+ Gets or sets the test outcome summaries.
+
+ Thrown if is null.
+
+
+
+ A report includes a description of the test package, the model objects,
+ the combined results of all test runs and summary statistics.
+
+
+
+
+ Creates an empty report.
+
+
+
+
+ Adds a log entry to the report.
+
+ The log entry to add.
+ Thrown if is null.
+
+
+
+ Formats the specified name.
+
+
+
+ The following tags are processed:
+
+ {0} is replaced by the start date of the test run, or by the current date if not applicable ("yyyyMMdd").
+ {1} is replaced by the start time of the test run, or by the current time if not applicable ("HHmmss").
+
+
+
+ The report name format.
+ The resulting formatted report name.
+
+
+
+ Gets or sets the test package configuration, or null if none.
+
+
+
+
+ Gets or sets the test model, or null if none.
+
+
+
+
+ Gets or sets the test package run results, or null if none.
+
+
+
+
+ Gets a mutable list of log entries.
+
+
+
+
+ Summarizes the execution of a single test step for reporting purposes.
+
+
+
+
+ Creates an uninitialized instance for Xml deserialization.
+
+
+
+
+ Creates a test run step.
+
+ Information about the step.
+ Thrown if is null.
+
+
+
+ Returns the name of the test step run.
+
+
+
+
+ Gets or sets information about the step.
+
+ Thrown if is null.
+
+
+
+ Gets the list of child step runs.
+
+
+
+
+ Gets or sets the time when the test run started.
+
+
+
+
+ Gets or sets the time when the test run ended.
+
+
+
+
+ Gets or sets the test result from the run.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the test log.
+
+ Thrown if is null.
+
+
+
+ Recursively enumerates all test step runs including this one.
+
+
+
+
+ The type of exception thrown when the test runner or one of its
+ supportive components like a test domain fails in an unrecoverable manner.
+
+
+
+ It can happen that the test results will be lost or incomplete.
+
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ A filter parser constructs filters from its textual representation as a filter
+ expression.
+
+
+
+ A filter rule consists of zero or more filter expressions
+ that may be combined using 'and', 'or', and 'not' and grouped with
+ parentheses. A filter expression consists of a filter key followed by one or
+ more comma-delimited matching values in the form 'key: value, "quoted value",
+ /regular expression/'.
+
+ The filter grammar is defined as follows:
+
+ ::= [^:,*()/\"']+
+
+ ::= '"' .* '"' # String delimited by double quotation marks
+ | "'" .* "'" # String delimited by single quotation marks
+
+ ::=
+ |
+
+ ::= "/" .* "/" # Regular expression
+ | "/" .* "/i" # Case-insensitive regular expression
+
+ ::=
+
+ ::= # Value specified by exact string
+ | # Value specified by regular expression
+
+ ::= (',' )* # One or more comma-separated values
+
+ ::= "*" # "Any"
+ | ":" matchSeq>
+ | OR filterExpr> # Combine filter expressions with OR
+ | AND filterExpr> # Combine filter expressions with AND
+ | NOT # Negate filter expression
+ | "(" ")" # Grouping filter expression
+
+ ::= # Inclusion rule (default case)
+ | INCLUDE # Inclusion rule
+ | EXCLUDE # Exclusion rule
+
+ ::= # Filter set consists of at least one filter rule.
+ | # But may be a sequence of rules.
+ ]]>
+
+ - By default this property takes the value "*", which means the "Any" filter will be applied.
+ -
+ The operator precedence is, from highest to lowest: NOT, AND, and OR. All these operators are
+ left-associative.
+
+ -
+ The commas used to separate the values are interpreted as OR operators, so "Type:Fixture1,Fixture2"
+ is equivalent to "Type:Fixture1 or Type:Fixture2".
+
+ -
+ White-space is ignored outside quoted strings, so "Type:Fixture1|Type:Fixture2" is equivalent
+ to "Type : Fixture1 | Type : Fixture2".
+
+ -
+ Commas, colons, slashes, backslashes and quotation marks can be escaped with a backslash. For
+ example, \' will be interpreted as '. Using a single backslash in front of any other character
+ is invalid.
+
+ -
+ Currently the following filter keys are recognized:
+
+ - Id: Filter by id.
+ - Name: Filter by name.
+ - Assembly: Filter by assembly name.
+ - Namespace: Filter by namespace name.
+ - Type: Filter by type name, including inherited types.
+ - ExactType: Filter by type name, excluding inherited types.
+ - Member: Filter by member name.
+ -
+ *: All other names are assumed to correspond to metadata keys. See
for standard metadata keys. Common keys are: AuthorName, Category, Description, Importance, TestsOn.
+
+
+
+
+
+
+
+ Assuming the following fixtures have been defined:
+ The following filters could be applied:
+ -
+
Type: Fixture1
+ All the tests within Fixture1 will be run.
+
+
+ -
+
Member: Test1
+ Only Fixture1.Test1 and Fixture2.Test1 will be run.
+
+
+ -
+
Type: Fixture1, Fixture2
+ All the tests within Fixture1 or Fixture2 will be run.
+
+
+ -
+
Type:Fixture1 or Type:Fixture2
+ All the tests within Fixture1 or Fixture2 will be run.
+
+
+ -
+
Type:Fixture1, Fixture2 and Member:Test2
+ Only Fixture1.Test2 and Fixture2.Test2 will be run.
+
+
+ -
+
Type:/Fixture*/ and Member:Test2
+ Only Fixture1.Test2 and Fixture2.Test2 will be run.
+
+
+ -
+
AuthorName:AlbertEinstein
+ All the tests within Fixture1 will be run because its author attribute is set to "AlbertEinstein".
+
+
+ -
+
Category: IntegrationTest
+ All the tests within Fixture2 will be run because its category attribute is set to "IntegrationTest".
+
+
+ -
+
("Type": 'Fixture1' and "Member":/Test*/) or (Type : Fixture2 and Member: /Test*/)
+ All the tests will be run. This example also shows that you can enclose key and
+ values with quotation marks, and group expressions with parentheses.
+
+
+ -
+
exclude AuthorName: AlbertEinstein
+ All the tests within Fixture2 will be run because its author attribute is not set to "AlbertEinstein".
+
+
+ -
+
exclude Type: Fixture2 include Member: Test2
+ Only Fixture1.Test2 will be run because Fixture2 was excluded from consideration before the inclusion rule was applied.
+
+
+
+
+
+
+
+ Creates a filter parser.
+
+ The factory to use for constructing
+ filters based on filter keys and a filter rule for matching string values.
+ Thrown if is null.
+
+
+
+ Creates a filter set from its textual representation as a filter set expression
+ consisting of inclusion and exclusion rules.
+
+
+
+ If the filter set expression is empty or contains only whitespace then the
+ resulting filter set will be empty.
+
+
+ The filter set expression.
+ The parsed filter set.
+
+
+
+ Creates a filter from its textual representation as a filter expression.
+
+ The filter expression.
+ The parsed filter.
+
+
+
+ Monitors events and writes debug messages to the
+ runner's logger.
+
+
+
+
+
+
+
+ The log extension writes a summary of test execution progress to the test runner's logger
+ so the user can monitor what's going on.
+
+
+
+ Passing tests are recorded with severity , warnings are
+ recorded with severity and failures are recorded
+ with severity .
+
+
+
+
+
+
+
+
+ Logs an annotation.
+
+ The annotation to log.
+
+
+
+ Logs a message about a test case that has started.
+
+
+
+ This method is not called for test steps that have set to false.
+
+
+ The event.
+
+
+
+ Logs a message about a test case that has finished.
+
+
+
+ This method is not called for test steps that have set to false.
+
+
+ The event.
+
+
+
+ Logs a message about a non-test case that has finished with some problem that
+ may have prevented other test cases from running correctly.
+
+
+
+ This method is not called for steps within test cases.
+
+
+ This method is not called for test steps that have set to true.
+
+
+ The event.
+
+
+
+ Describes the result codes used by the application.
+
+
+
+
+ The tests ran successfully or there were no tests to run.
+
+ 0
+
+
+
+ Some tests failed.
+
+ 1
+
+
+
+ The tests were canceled.
+
+ 2
+
+
+
+ A fatal runtime exception occurred.
+
+ 3
+
+
+
+ Invalid arguments were supplied on the command-line.
+
+ 10
+
+
+
+ No tests were found.
+
+ 16
+
+
+
+ The test launcher encapsulated the entire test execution lifecycle from
+ start to finish and provides a simplified pattern for running tests.
+
+
+
+ The basic usage pattern is as follows:
+
+ - Create the launcher.
+ - Set properties to specify the inputs and outputs of the test run.
+ - Run the tests all in one go.
+ - Optionally do something with the contents of the final report.
+
+
+
+ By default, the launcher assumes that a runtime environment has already been
+ established and is accessible via the . If there
+ is no runtime yet, then you can cause one to be configured automatically for the
+ duration of the test run by setting the property accordingly.
+
+
+
+
+
+ Creates a launcher with default options and no test assemblies specified.
+
+
+
+
+ Clears the list of file patterns.
+
+
+
+
+ Adds a file pattern if not already added to the launcher.
+
+ The file path or a wildcard pattern to add.
+ Thrown if is null.
+
+
+
+ Removes a file pattern.
+
+ The file pattern to remove.
+ Thrown if is null.
+
+
+
+ Clears the list of report formats.
+
+
+
+
+ Adds a report format if not already added to the launcher.
+
+ The report format to add.
+ Thrown if is null.
+
+
+
+ Removes a report format.
+
+ The report format to remove.
+ Thrown if is null.
+
+
+
+ Cancels the test run and prevents a new one from starting.
+
+
+
+
+ Runs the test package as configured.
+
+
+
+ If is non-null ,
+ initializes the runtime for the duration of this method then shuts it down automatically
+ before returning. Otherwise assumes the runtime has already been initialized and
+ accesses it using .
+
+
+ Runtimes cannot be nested. So if the launcher is asked to initialize the runtime and
+ it has already been initialized, then it will not be initialized again.
+
+
+ A result object.
+
+
+
+ Processes test file patterns and generates a consolidated test project.
+
+
+
+
+ Gets or sets the progress monitor provider to use.
+
+
+
+ The default provider is .
+
+
+ Thrown if is null.
+
+
+
+ Gets or sets the logger to use.
+
+
+
+ The default logger is .
+
+
+ Thrown if is null.
+
+
+
+ Gets or sets the to use for automatically initializing
+ the runtime during test execution or null if the runtime is already initialized.
+
+
+
+ If this value if not null then the launcher will initialize the runtime
+ using this (unless already initialized) just prior to
+ test execution and will automatically shut down the runtime just afterwards.
+
+
+ The default value is null which assumes that the runtime is already initialized.
+
+
+
+
+
+ Gets or sets the test runner options.
+
+ Thrown if is null.
+
+
+
+ Gets a read-only list of test file patterns (with wildcards) or test project files
+ that are to be resolved and included in the test package prior to execution.
+
+
+
+
+ Gets or sets the test project.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the test exploration options.
+
+ Thrown if is null.
+
+
+
+ Gets or sets the test execution options.
+
+ Thrown if is null.
+
+
+
+ Controls whether the test runner will echo result to the
+ as each test finishes.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Gets or sets whether to skip test execution.
+
+
+
+ This option may be used to produce a report that contains test
+ metadata for consumption by other tools.
+
+
+ The default value is false .
+
+
+
+
+
+ Gets a read-only list of report formats to generate.
+
+
+
+
+ Gets or sets the report formatter options.
+
+ Thrown if is null.
+
+
+
+ Gets or sets whether to show the reports after the test run finishes.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Gets or sets whether to ignore annotations when determining the result code.
+
+
+
+ If false, then error annotations, usually indicative of broken tests, will cause
+ a failure result to be generated.
+
+
+ The default value is false .
+
+
+
+
+
+ Gets or sets the maximum amount of time the tests can run before they are canceled.
+
+
+
+ The default value is null , meaning an infinite time.
+
+
+
+
+
+ Resolves assemblies using hint paths and custom resolvers.
+
+
+
+
+ Provides support for resolving and loading assemblies using hint paths and custom resolvers.
+
+
+
+
+ Adds an assembly load hint directory to search when standard assembly
+ resolution fails.
+
+ The hint directory.
+ Thrown if is null.
+
+
+
+ Adds a custom assembly resolver to use when standard assembly resolution fails.
+
+ The assembly resolver.
+ Thrown if is null.
+
+
+
+ Loads an assembly from the specified file.
+
+ The assembly file.
+ The loaded assembly.
+ Thrown if the is null.
+ Thrown if the assembly could not be loaded.
+
+
+
+ Initializes the assembly resolver manager.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides configuration parameters for setting up the .
+
+
+
+
+ Creates a default runtime setup.
+
+
+
+
+ Creates a deep copy of the runtime setup parameters.
+
+ The copy.
+
+
+
+ Makes all paths in this instance absolute.
+
+ The base directory for resolving relative paths,
+ or null to use the current directory.
+
+
+
+ Sets the configuration file path to the *.config file associated with an assembly.
+
+ The assembly.
+ Thrown if is null.
+
+
+
+ Clears the list of plugin directories.
+
+
+
+
+ Adds a plugin directory if not already in the configuration.
+
+ The relative or absolute path of a directory to be
+ searched for plugin configuration files in addition to the
+ primary Gallio directories.
+ Thrown if is null.
+
+
+
+ Removes a plugin directory.
+
+ The plugin directory to remove.
+ Thrown if is null.
+
+
+
+ Gets a read-only list of relative or absolute paths of directories to be
+ searched for plugin configuration files in addition to the
+ primary Gallio directories.
+
+
+
+
+ Gets or sets the runtime path, or null to determine it automatically
+ based on the location of the application itself.
+
+
+
+ The runtime path specifies where the standard runtime plugins are located.
+
+
+
+ The runtime path. Default is null .
+
+
+
+
+ Gets or sets the installation configuration which specifies characteristics
+ about the Gallio installation on the local machine, or null to determine it automatically.
+
+
+ The installation configuration. Default is null .
+
+
+
+
+ Gets or sets the path of the primary configuration file to be
+ loaded by the runtime (if it exists).
+
+
+
+ This is useful when Gallio is launched by a library instead of as a standalone
+ executable.
+
+
+
+ The primary configuration file path. Default is null to load the
+ configuration from the .
+
+
+
+
+ Provides helper functions for test runner tools.
+
+
+
+
+ Presents a generated report to the user using the default viewing
+ application for the report's document type.
+
+ The path of the report.
+ True if the report document was successfully opened.
+
+
+
+ Creates a test runner given its factory name.
+
+ The test runner factory name.
+ The test runner.
+ Thrown if is null.
+
+
+
+ Provides helper functions for manipulating s.
+
+
+
+
+ Safely converts an exception to a string.
+
+
+
+ This method protects the caller from unexpected failures that may occur while
+ reporting an exception of untrusted origin. If an error occurs while converting the
+ exception to a string, this method returns a generic description of the exception
+ that can be used instead of the real thing.
+
+
+ It can happen that converting an exception to a string produces a secondary exception
+ because the method has been overridden or because the
+ stack frames associated with the exception are malformed. For example, we observed
+ one case of a being thrown while printing an exception
+ because one of the stack frames referred to a dynamic method with incorrect metadata.
+
+
+ The exception.
+ The string contents.
+ Thrown if is null.
+
+
+
+
+ Safely obtains the component of an exception.
+
+ The message.
+ Thrown if is null.
+
+
+
+
+ Safely obtains the component of an exception.
+
+ The stack trace.
+ Thrown if is null.
+
+
+
+
+ Rethrows an exception without discarding its stack trace.
+ This enables the inner exception of
+ to be unwrapped.
+
+
+
+ This implementation is based on code by Brad Wilson .
+
+
+ The exception to rethrow.
+
+
+
+ Invokes a method without producing a
+
+ The method to invoke.
+ The instance on which to invoke the method, or null if none.
+ The method arguments, or null if none.
+ The method return value, or null if none.
+ Thrown if is null.
+
+
+
+ Invokes a constructor without producing a
+
+ The constructor to invoke.
+ The constructor arguments, or null if none.
+ The new instance, or null if none.
+ Thrown if is null.
+
+
+
+ Creates an object using without producing a
+
+ The type of object to create.
+ The constructor arguments, or null if none.
+ The new instance, or null if none.
+ Thrown if is null.
+
+
+
+ Utilities for manipulating files.
+
+
+
+
+ Replaces invalid characters in a file or directory name with underscores
+ and trims it if it is too long.
+
+ The file or directory name.
+ The encoded file or directory name.
+ Thrown if is null.
+
+
+
+ Gets the full path of the containing directory.
+
+ The path.
+ The full path of the parent directory or null if it is at the root.
+ Thrown if is null.
+
+
+
+ Recursively copies files and folders from the source path to the destination.
+
+ The source file or directory path.
+ The destination file or directory path.
+ If true, overwrites existing files in the destination.
+ Thrown if or is null.
+
+
+
+ Recursively copies files and folders from the source path to the destination
+ using an indirect mechanism to actually create a file or folder.
+
+ The source file or directory path.
+ The destination file or directory path.
+ A delegate used to create a directory with a given destination directory path, or null to do nothing.
+ A delegate used to copy a source file to a given destination file path, or null to do nothing.
+ Thrown if or is null.
+
+
+
+ Recursively deletes a file or directory.
+ Does nothing if the file or directory does not exist.
+
+ The path.
+
+
+
+ Makes all paths in the list absolute.
+
+ The base directory for resolving relative paths,
+ or null to use the current directory.
+ The list of paths to canonicalize in place.
+
+
+
+ Makes an absolute path.
+
+ The base directory for resolving relative paths,
+ or null to use the current directory.
+ The path to canonicalize, or null if none.
+ The absolute path, or null if none.
+
+
+
+ Strips the trailing backslash off of a directory path, if present.
+
+ The path to strip, or null if none.
+ The stripped path, or null if none.
+
+
+
+
+ Copies the contents of a source stream to a destination stream.
+
+
+
+ Does not close either stream.
+
+ The source stream.
+ The destination stream.
+ Thrown if
+ or is null.
+
+
+
+ Makes a relative path from an absolute path if possible.
+
+ The absolute path.
+ The base path.
+ The path relative to the base path, or an absolute path if the paths are unrelated.
+
+
+
+ Makes an absolute path from an relative path if possible.
+
+ The relative path.
+ The base path.
+ The absolute path.
+
+
+
+ A 64 bit hash code value type.
+
+
+
+ Provides somewhat more protection against collisions than 32 bit hashes.
+
+
+
+
+
+ Gets a hash code containing the specified 64bit value.
+
+ The 64bit value.
+
+
+
+ Creates a proabilistically unique 64bit hash code.
+
+
+
+
+ Produces a new hash code by combining information from the specified string
+ with this hash code.
+
+ The string, may be null if none.
+ The augmented hash code.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The test context provides information about the environment in which
+ a test is executing. A new context is created each time a test or
+ test step begins execution.
+
+
+
+ Test contexts are arranged in a hierarchy that corresponds to the order in which
+ the contexts were entered. Thus the context for a test likely has as
+ its parent the context for its containing test fixture.
+
+
+ Arbitrary user data can be associated with a test context. Furthermore, client
+ code may attach event handlers to perform resource
+ reclamation just prior to marking the test step as finished.
+
+
+
+
+
+
+ Creates a wrapper for a .
+
+ The context to wrap.
+ The sandbox to use, or null if none.
+ Thrown if is null.
+
+
+
+ Sets the default context for the specified thread.
+
+
+
+ The default context for a thread is unless the thread's
+ default context has been overridden with .
+
+
+ Changing the default context of a thread is useful for capturing existing threads created
+ outside of a test into a particular context. Among other things, this ensures that side-effects
+ of the thread, such as writing text to the console, are recorded as part of the step
+ represented by the specified context.
+
+
+ The thread.
+ The context to associate with the thread, or null to reset the
+ thread's default context to inherit the once again.
+ Thrown if is null.
+
+
+
+ Gets the default context for the specified thread.
+
+
+
+ The default context for a thread is unless the thread's
+ default context has been overridden with .
+
+
+ Changing the default context of a thread is useful for capturing existing threads created
+ outside of a test into a particular context. Among other things, this ensures that side-effects
+ of the thread, such as writing text to the console, are recorded as part of the step
+ represented by the specified context.
+
+
+ The thread.
+ The default context.
+ Thrown if is null.
+
+
+
+ Enters the specified context with the current thread.
+
+
+
+ Conceptually this method pushes the specified context onto the context
+ stack for the current thread. It then returns a cookie that can be used
+ to restore the current thread's context to its previous value.
+
+
+ The context to enter, or null to enter a scope
+ without a context.
+ A cookie that can be used to restore the current thread's context to its previous value.
+
+
+
+
+ Automatically executes an action when a triggering event occurs.
+
+ The triggering event.
+ The action to execute when triggered.
+ Thrown if is null.
+
+
+
+ Automatically executes an action when a triggering event occurs.
+
+ The triggering event.
+ The action to execute when triggered.
+ The action to execute to clean up after triggering or when the test finishes without triggering having occurred, or null if none.
+ Thrown if is null.
+
+
+
+ Returns true if a trigger event has been satisfied.
+
+
+
+ This method assumes that the body of the test has already finished and is
+ currently running tear down, dispose, or finishing actions.
+
+
+ The trigger event.
+ True if the trigger event is satisfied.
+
+
+
+ Performs an action as a new step within the current context and associates it
+ with the specified code reference. Does not verify the outcome of the step.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method does not verify that the test step completed successfully. Check the
+ of the test step or call
+ to ensure that the expected outcome was obtained.
+
+
+ The name of the step.
+ The action to perform.
+ The step execution timeout, or null if none.
+ True if the step represents an independent test case.
+ The associated code element, or null if none.
+ Thrown if or
+ is null.
+ The context of the step that ran.
+ Thrown if is the empty string.
+ Thrown if is negative.
+
+
+
+ Performs an action as a new step within the current context and associates it
+ with the specified code reference. Verifies that the step produced the expected outcome.
+
+
+
+ This method creates a new child context with a new nested ,
+ enters the child context, performs the action, then exits the child context.
+
+
+ This method may be called recursively to create nested steps or concurrently
+ to create parallel steps.
+
+
+ This method verifies that the step produced the expected outcome. If a different outcome
+ was obtained, then raises an assertion failure.
+
+
+ The name of the step.
+ The action to perform.
+ The step execution timeout, or null if none.
+ True if the step represents an independent test case.
+ The associated code element, or null if none.
+ The expected outcome of the step.
+ Thrown if or
+ is null.
+ The context of the step that ran.
+ Thrown if is the empty string.
+ Thrown if is negative.
+ Thrown if the expected outcome was not obtained.
+
+
+
+ Adds metadata to the step that is running in the context.
+
+ The metadata key.
+ The metadata value.
+ Thrown if
+ or is null.
+
+
+
+ Sets the step's interim .
+
+
+
+ The interim outcome is used to communicate the anticipated outcome
+ of the step to later phases of execution.
+
+
+ The value set here will be overridden by whatever final outcome the step
+ returns. Consequently the actual outcome may still differ from the anticipated outcome
+ that was set using this method.
+
+
+ Thrown if attempting to set the outcome while the test is not running.
+
+
+
+
+ Enters this context with the current thread.
+
+
+
+ Conceptually this method pushes this context onto the context
+ stack for the current thread. It then returns a cookie that can be used
+ to restore the current thread's context to its previous value.
+
+
+ A cookie that can be used to restore the current thread's context to its previous value.
+
+
+
+
+ Increments the assert count atomically.
+
+
+
+
+ Adds the specified amount to the assert count atomically.
+
+ The amount to add to the assert count.
+
+
+
+ Publishes a message to the message sink.
+
+ The message to publish.
+ Thrown if is null.
+
+
+
+ Starts a child step of the context.
+
+ The name of the step.
+ The code element, or null if none.
+ True if the step represents an independent test case.
+ The context of the child step.
+ Thrown if is null.
+
+
+
+ Finishes the step represented by the context.
+
+ The outcome.
+ The final test result.
+
+
+
+ Prepares a wrapper for the given inner context.
+
+
+
+ The wrapper is cached for the duration of the lifetime of the inner context.
+
+
+ The new inner context.
+ The sandbox to use, or null if none.
+ The wrapper context.
+ Thrown if is null.
+
+
+
+ Wraps an existing context.
+
+
+
+ If the context has already been prepared, returns
+ the prepared context. Otherwise creates a new wrapper.
+
+
+ The context to wrap, or null if none.
+ The wrapped context, or null if none.
+
+
+
+ Gets the context of the current thread, or null if there is no
+ current context.
+
+
+
+
+ Gets the global context of the environment, or null if there is no
+ such context.
+
+
+
+
+ Gets the parent context or null if this context has no parent.
+
+
+
+
+ Gets the test associated with the context.
+
+
+
+
+ Gets the test step associated with the context.
+
+
+
+
+ Gets the log writer for this context.
+
+
+
+ Each test step gets its own log writer that is distinct from those
+ of other steps. So the log writer returned by this property is
+ particular to the step represented by this test context.
+
+
+
+
+
+ Gets the sandbox of the test step, or null if none.
+
+
+
+ The value will typically only be null in the case where the test step
+ belongs to a different test framework that does not use sandboxes.
+
+
+
+
+
+ Gets or sets the lifecycle phase the context is in.
+
+
+ Thrown if is null.
+
+
+
+ Gets the current assertion count.
+
+
+
+
+ Gets the step's outcome or its interim outcome if the test is still running.
+
+
+
+ The value of this property is initially but may change
+ over the course of execution to reflect the anticipated outcome of the test. When
+ the test finishes, its outcome is frozen.
+
+
+ For example, this property enables code running as part of the tear down phase to
+ determine whether the test is failing and to perform different actions in that case.
+
+
+
+
+
+
+ Gets a copy of the step's final result or null if the test has not finished yet.
+
+
+
+ The test result cannot be changed.
+
+
+
+
+
+ Returns true if the step associated with the context has finished execution
+ and completed all actions.
+
+
+
+
+ Gets the user data collection associated with the context. It may be used
+ to associate arbitrary key/value pairs with the context.
+
+
+
+ Each context has its own distinct user data collection.
+
+
+
+
+
+ The event is raised when the test is finishing to provide
+ clients with an opportunity to perform additional clean up tasks after all ordinary
+ test processing is finished.
+
+
+
+
+ A context cookie is used to unwind the context stack of the current thread
+ to its previous state prior to a context having been entered.
+
+
+
+
+ Creates a context cookie with a given dispose action.
+
+ The inner disposable object.
+
+
+
+ Exits the context that was entered when the cookie was granted.
+
+
+
+ Equivalent to calling . This method is provded as a
+ convenience for use with the C# using statement.
+
+
+ This method will also exit nested contexts on the current thread that were
+ entered after the context for which this cookie was produced but have not
+ yet been exited.
+
+
+ Thrown if the cookie belongs to a different
+ or if the context was already exited.
+ Thrown if the context manager has been disposed.
+
+
+
+ Exits the context that was entered when the cookie was granted.
+
+
+
+ This method will also exit nested contexts on the current thread that were
+ entered after the context for which this cookie was produced but have not
+ yet been exited.
+
+
+ Thrown if the cookie belongs to a different
+ or if the context was already exited.
+ Thrown if the context manager has been disposed.
+
+
+
+ A custom assembly resolver participates in assembly resolution when
+ standard assembly resolution fails to load the desired assembly
+ but before assembly load paths are considered.
+
+
+
+
+
+ Resolves the assembly with the specified name.
+
+ The full name of the assembly as was provided
+ to .
+ True if the assembly is to be resolved in the
+ reflection-only context.
+ The assembly, or null if it could not be resolved.
+
+
+
+ An action chain captures a sequence of actions to be performed as
+ part of a complex multi-part process.
+
+
+ Later actions in a chain will not run if prior ones throw an exception.
+ To catch and handle exceptions, use to register a
+ decorator that runs around the current action whose execution is then
+ under your control.
+
+
+
+
+ Gets a singleton action that does nothing when invoked.
+
+
+
+
+ Registers an action to perform before all other actions
+ currently in the chain.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified before
+ the current .
+
+
+ The action to register.
+ Thrown if is null.
+
+
+
+ Registers an action to perform after all other actions
+ currently in the chain.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified after
+ the current .
+
+
+ The action to register.
+ Thrown if is null.
+
+
+
+ Registers an action to perform around all other actions
+ currently in the chain. The contained part of the chain
+ is passed in as an action to the decorator that the decorator
+ can choose to run (or not) as needed.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified around
+ the current .
+
+
+ The decorator to register.
+ Thrown if is null.
+
+
+
+ Clears the chain and sets it action to .
+
+
+
+
+ Gets or sets a representation of the chain as a single action.
+
+
+
+ The action is progressively augmented as new contributions are
+ registered using , and
+ . By default the action is .
+
+
+ Thrown if is null.
+
+
+
+ An action chain captures a sequence of actions to be performed as
+ part of a complex multi-part process.
+
+
+ Later actions in a chain will not run if prior ones throw an exception.
+ To catch and handle exceptions, use to register a
+ decorator that runs around the current action whose execution is then
+ under your control.
+
+ The action argument type.
+
+
+
+ Gets a singleton action that does nothing when invoked.
+
+
+
+
+ Registers an action to perform before all other actions
+ currently in the chain.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified before
+ the current .
+
+
+ The action to register.
+ Thrown if is null.
+
+
+
+ Registers an action to perform after all other actions
+ currently in the chain.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified after
+ the current .
+
+
+ The action to register.
+ Thrown if is null.
+
+
+
+ Registers an action to perform around all other actions
+ currently in the chain. The contained part of the chain
+ is passed in as an action to the decorator that the decorator
+ can choose to run (or not) as needed.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified around
+ the current .
+
+
+ The decorator to register.
+ Thrown if is null.
+
+
+
+ Clears the chain and sets it action to .
+
+
+
+
+ Gets or sets a representation of the chain as a single action.
+
+
+
+ The action is progressively augmented as new contributions are
+ registered using , and
+ . By default the action is .
+
+
+ Thrown if is null.
+
+
+
+ An action chain captures a sequence of actions to be performed as
+ part of a complex multi-part process.
+
+
+
+ Later actions in a chain will not run if prior ones throw an exception.
+ To catch and handle exceptions, use to register a
+ decorator that runs around the current action whose execution is then
+ under your control.
+
+
+ The first argument type.
+ The second argument type.
+
+
+
+ Gets a singleton action that does nothing when invoked.
+
+
+
+
+ Registers an action to perform before all other actions
+ currently in the chain.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified before
+ the current .
+
+
+ The action to register.
+ Thrown if is null.
+
+
+
+ Registers an action to perform after all other actions
+ currently in the chain.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified after
+ the current .
+
+
+ The action to register.
+ Thrown if is null.
+
+
+
+ Registers an action to perform around all other actions
+ currently in the chain. The contained part of the chain
+ is passed in as an action to the decorator that the decorator
+ can choose to run (or not) as needed.
+
+
+
+ The value of will be set to a new instance
+ that performs the specified around
+ the current .
+
+
+ The decorator to register.
+ Thrown if is null.
+
+
+
+ Clears the chain and sets it action to .
+
+
+
+
+ Gets or sets a representation of the chain as a single action.
+
+
+
+ The action is progressively augmented as new contributions are
+ registered using , and
+ . By default the action is .
+
+
+ Thrown if is null.
+
+
+
+ Represents a delegate that decorates an action.
+
+ The action to decorate which should be called in
+ the middle of applying the decoration.
+
+
+
+ Represents a delegate that decorates an action.
+
+ The type of object the action is performed upon.
+ The object to act upon.
+ The action to decorate which should be called in
+ the middle of applying the decoration.
+
+
+
+ Represents a delegate that decorates an action.
+
+ The first argument type.
+ The second argument type.
+ The first argument.
+ The second argument.
+ The action to decorate which should be called in
+ the middle of applying the decoration.
+
+
+
+ A filter combinator that matches a value when all of its constituent filters
+ match the value.
+
+
+
+
+ Creates an AND-filter.
+
+ The filters that must all jointly be matched.
+ If the list is empty, the filter matches everything.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the filters that must jointly be matched.
+
+
+
+ If the list is empty, the filter matches everything.
+
+
+
+
+
+ A filter that matches anything and always returns true.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A filter that matches objects whose
+ matches the specified assembly name filter.
+
+
+
+
+ Creates an assembly filter.
+
+ A filter for the assembly name that is used
+ to match one of the following values:
+
+ - Full name as returned by
.
+ - Simple name (aka. partial name) as returned by
.
+
+
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ A filter that matches objects whose
+ matches the specified id filter.
+
+
+
+
+ Creates an identity filter.
+
+ A filter for the id.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ A filter that matches objects whose
+ matches the specified member name filter. This filter should normally be used together with
+ a to ensure the accuracy of the member match.
+
+
+
+
+ Creates a member filter.
+
+ A filter for the member name as returned by .
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ A filter that matches objects whose
+ has a key with a value that matches the value filter.
+
+
+
+
+ Creates a metadata filter.
+
+ The metadata key to look for.
+ A filter for the metadata value to match.
+ Thrown if or is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ A filter that matches objects whose
+ matches the specified namespace name.
+
+
+
+
+ Creates a namespace filter.
+
+ A filter for the namespace name
+ obtained via reflection on types.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ A filter that matches nothing and always returns false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A filter combinator that is the negation of another filter.
+
+
+
+
+ Creates a NOT-filter.
+
+ The filter to be negated.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the filter to be negated.
+
+
+
+
+ A filter combinator that matches a value when at least one of its constituent filters
+ matches the value.
+
+
+
+
+ Creates an OR-filter.
+
+ The filters from which at least one match must be found.
+ If the list is empty, the filter matches everything.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the filters from which at least one match must be found.
+
+
+
+ If the list is empty, the filter matches everything.
+
+
+
+
+
+ A filter that matches objects whose
+ matches the specified type name.
+
+
+
+ Generic types should be specified by the name of their generic type definition.
+ eg. Foo`1.
+
+
+
+
+
+ Creates a type filter.
+
+ A filter to match the type name obtained via reflection
+ on the type in one of the following ways:
+
+ - Fully qualified by namespace and assembly as returned by
+ - Qualified by namespace as returned by
+ - Unqualified as returned by the type's
+
+
+ If true, subclasses and interface implementations of the specified
+ type are also matched by the filter if they can be located.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+ A list of standard test kind names provided by Gallio.
+
+
+
+ The test kind has no effect on the semantics of the test runner but it allows tests to
+ be classified so that a user interface can provide appropriate icons, descriptions,
+ decorations and affordances for registered test kinds.
+
+
+ To create your own custom test kinds for your test framework, register a
+ component in your plugin metadata with a unique name.
+
+
+
+
+
+
+
+
+ The test represents the root of the test tree.
+
+
+
+
+ The test represents the tests contained in a single test file.
+
+
+
+ A file should have an associated metadata.
+
+
+
+
+
+ The test represents the tests contained in a single test assembly.
+
+
+
+ An assembly should have an associated metadata.
+
+
+
+
+
+ The test represents the tests contained in a single test namespace.
+
+
+
+
+ The test represents a grouping of tests for descriptive purposes.
+
+
+
+
+ The test represents a test suite.
+
+
+
+
+ The test represents a test fixture.
+
+
+
+
+ The test represents a test case.
+
+
+
+
+ The test is a placeholder for an unsupported test file or element.
+
+
+
+
+ Defines the names of common test step lifecycle phases.
+
+
+
+ Custom phases may also be defined.
+
+
+
+
+
+ The test step is starting.
+
+
+
+
+ The test is being initialize. (Fixture construction, etc.)
+
+
+
+
+ The test step is being set up.
+
+
+
+
+ The test step is executing its main body.
+
+
+
+
+ The test step is being torn down.
+
+
+
+
+ The test step's context is being disposed.
+
+
+
+
+ The test step is finishing.
+
+
+
+
+ Provides common metadata keys.
+
+
+
+
+ The metadata key for the author's email.
+
+
+
+ May be derived from AuthorAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for the author's name.
+
+
+
+ May be derived from AuthorAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for the author's homepage.
+
+
+
+ May be derived from AuthorAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for the name of a category to which a test belongs.
+
+
+
+ May be derived from CategoryAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The matadata key for the location of an assembly as a local
+ file path or as a Uri.
+
+
+
+ May be derived from the assembly's property.
+
+
+
+
+
+ The metadata key for the name of the company associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for build/release configuration information associated with a test.
+
+
+
+ It describes the target environment or usage for the test.
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for a copyright associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for specifying the origin of data used by a test.
+
+
+
+ May be the file name and line number of a record in a file, the ID
+ of a database record or some other identifying characteristic.
+
+
+
+
+
+ The metadata key for the description of a test component.
+
+
+
+ May be derived from
+ or DescriptionAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for the expected exception type which should be the name,
+ full name or assembly-qualified name of the expected exception type.
+
+
+
+ May be derived from ExpectedExceptionAttribute in MbUnit
+ or its equivalent.
+
+
+
+
+
+ The metadata key for the expected exception message.
+ May be a substring of the actual exception message.
+
+
+
+ May be derived from ExpectedExceptionAttribute in MbUnit
+ or its equivalent.
+
+
+
+
+
+ The metadata key that describes the reason that a test should be run explicitly.
+
+
+
+ Tests may of course be marked explicit without a declared reason.
+
+
+ May be derived from ExplicitAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for a file associated with a test.
+
+
+
+ The file key should be associated with the top test produced by a file that
+ the test framework was asked to explore. For example, if the test package
+ included "C:\Tests\MyTests.dll" then the assembly-level test emitted by the framework
+ should have a File metadata entry with the value "C:\Tests\MyTests.dll".
+
+
+
+
+
+ The metadata key for a file version number associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for the test framework name associated with a test assembly in the test tree.
+
+
+
+ The value should be the descriptive name of the framework including its version. eg. "MbUnit v3.1 build 200"
+
+
+ A single assembly may have multiple associated frameworks.
+
+
+
+
+
+ The metadata key that describes the reason that a test is being ignored.
+
+
+
+ Tests may of course be ignored without a declared reason.
+
+
+ May be derived from IgnoreAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for the importance of a test component as the
+ string representation of one of the TestImportance constants in MbUnit
+ or its equivalent.
+
+
+
+ May be derived from ImportantAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for an informational version number associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key that describes the reason that a test is pending.
+
+
+
+ Tests may of course be marked pending without a declared reason.
+
+
+ May be derived from PendingAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key for a product associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for the name of the type being tested.
+
+
+
+ The associated value should be the full name of the type from
+ or the assembly qualified name of the type from .
+
+
+ May be derived from TestsOnAttribute in MbUnit or its equivalent.
+
+
+
+
+
+ The metadata key used to describe the kind of a test as the
+ string representation of one of the constants.
+
+
+
+
+ The metadata key for a title associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for a trademark associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for a version number associated with a test.
+
+
+
+ May be derived from .
+
+
+
+
+
+ The metadata key for the XML documentation of the test derived from
+ XML code documentation comments.
+
+
+
+
+ The type of exception thrown when test model and test framework
+ operations fail.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Provides utility functions for manipulating the object model.
+
+
+
+
+ Populates the provided metadata map with asembly-level metadata derived
+ from custom attributes.
+
+
+
+ Currently recognized attributes:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The assembly.
+ The metadata map.
+
+
+
+ The root test in the test tree.
+
+
+
+
+ Gets the root test name.
+
+
+
+
+ Creates the root test.
+
+
+
+
+ Provides options that control how test exploration occurs.
+
+
+
+
+ Creates a default set of test execution options.
+
+
+
+
+ Clears the collection of properties.
+
+
+
+
+ Adds a property key/value pair.
+
+ The property key.
+ The property value.
+ Thrown if or is null.
+ Thrown if is already in the property set.
+
+
+
+ Removes a property key/value pair.
+
+ The property key.
+ Thrown if is null.
+
+
+
+ Creates a copy of the options.
+
+ The copy.
+
+
+
+ Gets a read-only collection of configuration properties for test exploration.
+
+
+
+
+ Describes the outcome of a test.
+
+
+
+ An outcome consists of two parts. First, a required that describes
+ whether test passed, failed or was inconclusive. Second, an optional
+ that enables different outcomes with the same status to be distinguished. The category
+ also provides an opportunity to extend the definition of a test outcome to include
+ custom semantic details.
+
+
+
+
+
+ Creates a test outcome with no category.
+
+ The test .
+
+
+
+ Creates a test outcome with an optional category.
+
+ The test
+ The test , or null or an empty string if none.
+
+
+
+ If the other outcome is more severe than this one, returns it.
+ Otherwise returns this outcome.
+
+
+
+ This combination rule has the nice property of preserving the first
+ failure encountered even if subsequent failures occur and are combined.
+
+
+ The other outcome.
+ The combined outcome.
+ for test status severity ranking information.
+
+
+
+ Produces an outcome with the same status but omitting the category information.
+
+ The generalized outcome.
+
+
+
+
+
+
+ Returns the of the outcome.
+
+ The display name.
+
+
+
+ Provides the Xml schema for this element.
+
+ The schema set.
+ The schema type of the element.
+
+
+
+ Compares two outcomes for equality.
+
+ The first outcome.
+ The second outcome.
+ True if the outcomes are equal.
+
+
+
+ Compares two outcomes for inequality.
+
+ The first outcome.
+ The second outcome.
+ True if the outcomes are not equal.
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets the test status.
+
+
+
+ The test status describes whether a test passed, failed or produced an inconclusive
+ result. This information may be reported to the user with icons and textual
+ labels to explain the overall significance of the outcome.
+
+
+
+
+
+ Gets the test outcome category, or null if none. Never an empty string.
+
+
+
+ The category, when provided, provides additional information to describe what happened
+ to result in this particular outcome.
+
+
+ Examples: "ignored", "skipped", "pending", "canceled", "aborted", "timeout".
+
+
+ Naming guidelines:
+
+ - A category should be a single lower-case word.
+ - It should be a word that can appear on its own or following a number. Consequently, nouns are poor choices because they may need to be pluralized.
+ - It should not repeat the information already provided by the
. Consequently, "passed", "failed" and "inconclusive" are poor choices.
+ - It should be a standard category, if possible.
+ - It should not be too granular. If too many categories are in common usage, test result summaries by category may become unwieldly.
+
+
+
+
+
+
+ Gets the name of the outcome as it should be displayed.
+
+
+
+ The display name is the outcome's , if available.
+ Otherwise it is a lowercase rendition of the outcome's .
+
+
+
+
+
+ Gets a standard outcome for a test that passed.
+
+
+
+ Status: .
+ Category: null.
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that failed.
+
+
+
+ Status: .
+ Category: null.
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that failed due to an error.
+
+
+
+ Status: .
+ Category: "error".
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that failed because it ran out of time.
+
+
+
+ Status: .
+ Category: "timeout".
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that was inconclusive.
+
+
+
+ Status: .
+ Category: null.
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that has an inconclusive outcome because it was canceled.
+
+
+
+ Status: .
+ Category: "canceled".
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that did not run.
+
+
+
+ Status: .
+ Category: null.
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that did not run because the user is choosing
+ to ignore it. Perhaps the test is broken or non-functional.
+
+
+
+ Status: .
+ Category: "ignored".
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that did not run because it has unsatisfied
+ prerequisites. The test may depend on functionality that has not yet been implemented
+ or perhaps the test itself has yet to be implemented.
+
+
+
+ Status: .
+ Category: "pending".
+
+
+ The outcome.
+
+
+
+ Gets a standard outcome for a test that did not run because it must be selected explicitly.
+ The test may be particularly expensive or require manual supervision by an operator.
+
+
+
+ Status: .
+ Category: "explicit".
+
+
+ The outcome.
+
+
+
+ Describes whether a test passed, failed, was skipped or was inconclusive.
+
+
+
+ The status codes are ranked in order of severity from least to greatest
+ as follows: , , ,
+ .
+
+
+
+
+
+ The test passed.
+
+
+
+
+ The test did not run so nothing is known about its status.
+
+
+
+
+ The test did not run or its result was inconclusive.
+
+
+
+
+ The test failed or encountered an error during execution.
+
+
+
+
+ Provides helpers for cross-thread synchronization.
+
+
+
+
+ Synchronizes an action.
+
+ The invoker, such as a WinForms control.
+ The action.
+ The exception thrown by the action.
+
+
+
+ Synchronizes a function that returns a value.
+
+ The invoker, such as a WinForms control.
+ The function.
+ The value returned by the function.
+ The function return type.
+ The exception thrown by the function.
+
+
+
+ Default IXmlSerializer implementation.
+
+
+
+
+
+
+
+
+
+
+ Provides utilities for manipulating Xml.
+
+
+
+
+ Produces an XPathDocument given an action applied to an XmlWriter.
+
+ The action to perform.
+ The XPathDocument.
+ Thrown if is null.
+
+
+
+ Describes an exception that is to be reported.
+
+
+
+
+ Creates event arguments for reporting an exception.
+
+ The message associated with the exception.
+ The exception that occurred.
+ The stack trace of the code that called to report the exception, or null if not available.
+ True if a second exception occurred while attempting to report a previous
+ unhandled exception on the same thread.
+ Thrown if or
+ is null.
+
+
+
+ Adds a message that serves to describe the context in which the exception occurred.
+ The will be augmented with these details.
+
+ The correlation message to append.
+ Thrown if is null.
+
+
+
+
+ Formats a description of the exception to a string like: "Message\nException\nReported by: ReporterStackTrace".
+
+ The formatted string.
+
+
+
+ Formats the defaults of the exception to a string like: "Exception\nReported by: ReporterStackTrace".
+
+ The formatted string.
+
+
+
+ Gets the message associated with the exception.
+
+
+
+
+ Gets the exception that occurred.
+
+
+
+ The event handler should use care when processing the exception object as it
+ may have been obtained from an untrusted source.
+
+
+
+
+
+ Gets the stack trace of the code that called to report the exception or null if not available.
+
+
+
+
+ Returns true if a second exception occurred while attempting to report a previous
+ exception on the same thread.
+
+
+
+
+ Provides utility functions for working with strings.
+
+
+
+
+ Truncates the string to the specified maximum length.
+ Discards characters at the end of the string with indices greater than
+ or equal to .
+
+ The string to truncate.
+ The maximum length of the string to retain.
+ The truncated string.
+ Thrown if is null.
+ Thrown if is negative.
+
+
+
+ If the string is longer than the specified maximum length, truncates
+ it and appends an ellipsis mark ("..."). If the maximum length is
+ less than or equal to 3, omits the ellipsis mark on truncation.
+
+ The string to truncate.
+ The maximum length of the string to retain
+ including the ellipsis mark when used.
+ The truncated string.
+ Thrown if is null.
+ Thrown if is negative.
+
+
+
+ Gets a lowercase hexadecimal digit corresponding to the least significant nybble of
+ the specified value.
+
+ The value, only the last 4 bits of which are used.
+ The hexadecimal digit.
+
+
+
+ Formats a character value as "'x'" or "'\n'" with support for escaped characters
+ as a valid literal value. Encloses the char in single quotes (').
+
+
+
+ Replaces common escaped characters with C# style escape codes. Unprintable characters
+ are represented by a Unicode character escape.
+
+
+ The character value to format.
+ The formatted character.
+
+
+
+ Escapes a character value as "x" or "\n". Unlike ,
+ does not enclose the literal in single quotes (').
+
+
+
+ Replaces common escaped characters with C# style escape codes. Unprintable characters
+ are represented by a Unicode character escape.
+
+
+ The character value to format.
+ The unquoted char literal.
+
+
+
+ Formats a string value as ""abc\ndef"" with support for escaped characters
+ as a valid literal value. Encloses the string in quotes (").
+
+
+
+ Replaces common escaped characters with C# style escape codes. Unprintable characters
+ are represented by a Unicode character escape.
+
+
+ The string value to format.
+ The formatted string.
+
+
+
+ Escapes a string value such as "abc\ndef". Unlike ,
+ does not enclose the literal in quotes (").
+
+
+
+ Replaces common escaped characters with C# style escape codes. Unprintable characters
+ are represented by a Unicode character escape.
+
+
+ The string value to format.
+ The unquoted string literal.
+
+
+
+ Parses a key/value pair from an input string of the form "key=value", with the
+ value optionally quoted and optional surrounding whitespace removed.
+
+
+
+ If the value is quoted, the outermost quotes will be removed.
+ If the equals or value is absent then an empty string will be used as the value.
+ Also trims whitespace around the key and value.
+
+
+ The input string.
+ The key value pair.
+ Thrown if is null.
+
+
+
+ Parses a string of whitespace delimited and possibly quoted arguments and
+ returns an array of each one unquoted.
+
+ The arguments string, eg. "/foo 'quoted arg' /bar.
+ The parsed and unquoted arguments.
+ Thrown if is null.
+
+
+
+ The test log class provides services for writing information to the
+ execution log associated with a test.
+
+
+
+ A test log records the output of a test during its execution including any text
+ that was written to console output streams, exceptions that occurred, and
+ anything else the test writer might want to save.
+
+
+ A log consists of zero or more log streams that are opened automatically
+ on demand to capture independent sequences of log output. Each stream can
+ further be broken down into possibly nested sections to classify output
+ during different phases of test execution (useful for drilling into complex tests).
+ In addition to text, a log can contain attachments that are either attached
+ at the top level of the log or embedded into log streams. Attachments are
+ typed by mime-type and can contain Text, Xml, Images, Blobs, or any other content.
+ Certain test frameworks may automatically create attachments to gather all manner
+ of diagnostic information over the course of the test.
+
+
+ Test log messages are not echoed to the console or runtime log during test execution,
+ they are incorporated into the test report. Use instead if you
+ wish to write messages immediately where the operator can see them.
+
+
+
+
+
+
+ Flushes the log writer.
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+
+
+
+ Attaches an attachment to the execution log.
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The attachment to include.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an plain text attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The text to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an HTML attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The HTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XHTML attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The XHTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XML attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The XML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an image attachment with a mime-type compatible with its internal representation.
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The image to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches a video attachment with a mime-type compatible with its internal representation.
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The video to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XML-serialized object as an XML attachment with mime-type
+ using the default for the object's type.
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The object to serialize and embed, must not be null.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Attaches an XML-serialized object as an XML attachment with mime-type
+ using the specified .
+
+
+
+ This is a convenience method that forwards the request to the current log
+ writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The object to serialize and embed, must not be null.
+ The to use, or null to use the default
+ for the object's type.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Writes a character.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The character value.
+
+
+
+ Writes a string.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The string value.
+
+
+
+ Writes a formatted object.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The object value.
+
+
+
+ Writes an array of characters.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The array of characters.
+
+
+
+ Writes an array of characters.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The character buffer.
+ The index of the first character in the buffer to write.
+ The number of characters from the buffer to write.
+ Thrown if is null.
+ Thrown if or are out of range.
+
+
+
+ Writes a formatted string.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The format string.
+ The format string arguments.
+ Thrown if is null.
+
+
+
+
+ Writes a line delimiter.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+
+
+
+ Writes a character followed by a line delimiter.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The character value.
+
+
+
+ Writes a string followed by a line delimiter.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The string value.
+
+
+
+ Writes a formatted object followed by a line delimiter.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The object value.
+
+
+
+ Writes an array of characters followed by a line delimiter.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The array of characters.
+
+
+
+ Writes a formatted string followed by a line delimiter.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The format string.
+ The format string arguments.
+ Thrown if is null.
+
+
+
+
+ Writes a test log stream writable object to the stream.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The object to write, or null if none.
+
+
+
+ Writes an exception.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception to write.
+ Thrown if is null.
+
+
+
+ Writes an exception within its own section.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception to write.
+ The section name, or null if none.
+ Thrown if ,
+ or is null.
+
+
+
+ Writes an exception.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception data to write.
+ Thrown if is null.
+
+
+
+ Writes an exception within its own section which provides additional cues for interpretation.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The exception will not be terminated by a new line.
+
+
+ The exception data to write.
+ The section name, or null if none.
+ Thrown if is null.
+
+
+
+ Writes highlighted text.
+
+
+
+ Highlights can be used to emphasize important information such differences
+ between similar expected and actual values.
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ This is a convenience method that simply encapsulates the highlighted text within a
+ marker region of type .
+
+
+ The text to write, or null if none.
+
+
+
+ Writes an ellipsis to indicate where content has been elided for brevity.
+
+
+
+ An ellipsis may be used, for example, when printing assertion failures to clearly
+ identify sections where the user is not being presented all of the information
+ because it was too long and had to be truncated.
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ This is a convenience method that simply encapsulates "..." within a
+ marked region of type . However, tools
+ may reinterpret the special marker to make the "..." less ambiguous.
+
+
+
+
+
+ Begins a section with the specified name. May be nested.
+
+
+
+ A section groups together related content in the test log to make it
+ easier to distinguish. The section name is used as a heading.
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+
+
+
+ The name of the section.
+ A Disposable object that calls when disposed. This
+ is a convenience for use with the C# "using" statement.
+ Thrown if is null.
+
+
+
+ Begins a marked region. May be nested.
+
+
+
+ A marker is a hidden tag that labels its contents with a semantic class.
+ It is roughly equivalent in operation to an HTML "span" tag. Various tools
+ may inspect the markers and modify the presentation accordingly.
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+
+
+
+ The marker.
+ A Disposable object that calls when disposed. This
+ is a convenience for use with the C# "using" statement.
+
+
+
+ Ends the region most recently started with one of the Begin* methods.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ Thrown if there is no current nested region.
+
+
+
+ Embeds an attachment.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+
+ An attachment instance can be embedded multiple times efficiently since each
+ embedded copy is typically represented as a link to the same common attachment instance.
+
+ The attachment to embed.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds another copy of an existing attachment.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+
+
+ This method can be used to
+ repeatedly embed an existing attachment at multiple points in multiple
+ streams without needing to keep the instance
+ itself around. This can help to reduce memory footprint since the
+ original instance can be garbage collected shortly
+ after it is first attached.
+
+
+ An attachment instance can be embedded multiple times efficiently since each
+ embedded copy is typically represented as a link to the same common attachment instance.
+
+
+ The name of the existing attachment to embed.
+
+ Thrown if is null.
+ Thrown if no attachment with the specified
+ name has been previously attached.
+
+
+
+ Embeds an plain text attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The text to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an HTML attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The HTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XHTML attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The XHTML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XML attachment with mime-type .
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The XML to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an image attachment with a mime-type compatible with its internal representation.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The image to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds a video attachment with a mime-type compatible with its internal representation.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The video to attach.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XML-serialized object as an XML attachment with mime-type
+ using the default for the object's type.
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The object to serialize and embed, must not be null.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Embeds an XML-serialized object as an XML attachment with mime-type
+ using the specified .
+
+
+
+ This is a convenience method that forwards the request to the current default
+ log stream writer as returned by the property.
+
+
+ The name of the attachment to create or null to
+ automatically assign one. The attachment name must be unique within the scope of the
+ currently executing test step.
+ The object to serialize and embed, must not be null.
+ The to use, or null to use the default
+ for the object's type.
+ The attachment.
+
+ Thrown if is null.
+ Thrown if there is already an attachment
+ with the same name.
+
+
+
+ Gets the current log writer.
+
+ The execution log, never null.
+ Thrown if there is no current log writer.
+
+
+
+ Gets the current stream writer for captured messages.
+
+
+
+
+ Gets the current stream writer for captured messages.
+
+
+
+
+ Gets the current stream writer for captured messages.
+
+
+
+
+ Gets the current stream writer for diagnostic and messages.
+
+
+
+
+ Gets the current stream writer for reporting failure messages and exceptions.
+
+
+
+
+ Gets the current stream writer for reporting warning messages.
+
+
+
+
+ Gets the current stream writer for generic log messages such as those written
+ using the static methods of this class.
+
+
+
+
+ Provides functions for obtaining runtime services.
+
+
+
+
+ Sets the runtime instance.
+
+
+
+ This method should only be used by applications that host Gallio
+ and not generally by client code.
+
+
+ The runtime instance, or null if none.
+
+
+
+ Gets the runtime instance.
+
+ Thrown if the runtime has not been initialized.
+
+
+
+ Gets the runtime's logger, or a if the runtime is not initialized.
+
+
+
+
+ Gets the runtime's assembly loader.
+
+ Thrown if the runtime has not been initialized.
+
+
+
+ Gets the runtime's registry.
+
+ Thrown if the runtime has not been initialized.
+
+
+
+ Gets the runtime's service locator.
+
+ Thrown if the runtime has not been initialized.
+
+
+
+ Gets the runtime's resource locator.
+
+ Thrown if the runtime has not been initialized.
+
+
+
+ Returns true if the runtime has been initialized.
+
+
+
+
+ The event dispatched when the value of the current runtime
+ changes.
+
+
+
+
+ Gets the path of the Gallio runtime components.
+
+ The runtime path.
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ Looks up a localized string similar to The parameter list already contains a parameter named '{0}'..
+
+
+
+
+ Looks up a localized string similar to The test to be added is already a child of another test..
+
+
+
+
+ Looks up a localized string similar to Parameter '{0}' of .
+
+
+
+
+ Looks up a localized string similar to Collection arguments must have AllowMultiple flag..
+
+
+
+
+ Looks up a localized string similar to Duplicate '{0}' argument..
+
+
+
+
+ Looks up a localized string similar to Duplicate '{0}' argument value '{1}', expected unique values..
+
+
+
+
+ Looks up a localized string similar to Invalid '{0}' argument value '{1}'..
+
+
+
+
+ Looks up a localized string similar to Unique flag only applicable to collection arguments..
+
+
+
+
+ Looks up a localized string similar to Argument long name must be specified..
+
+
+
+
+ Looks up a localized string similar to Missing required argument '/{0}'..
+
+
+
+
+ Looks up a localized string similar to Missing required default argument..
+
+
+
+
+ Looks up a localized string similar to Unsupported value type..
+
+
+
+
+ Looks up a localized string similar to Parsed argument object is not of the correct type..
+
+
+
+
+ Looks up a localized string similar to Duplicate argument name '{0}'..
+
+
+
+
+ Looks up a localized string similar to Error opening response file '{0}': {1}..
+
+
+
+
+ Looks up a localized string similar to A fatal exception occurred while parsing arguments: {0}.
+
+
+
+
+ Looks up a localized string similar to Mismatched quotes in response file '{0}'.
+
+
+
+
+ Looks up a localized string similar to More than one default command line argument has been defined..
+
+
+
+
+ Looks up a localized string similar to No fields tagged with CommandLineArgumentAttribute..
+
+
+
+
+ Looks up a localized string similar to Read response file for more options..
+
+
+
+
+ Looks up a localized string similar to Response file '0' does not exist..
+
+
+
+
+ Looks up a localized string similar to file.
+
+
+
+
+ Looks up a localized string similar to Unrecognized argument '{0}'..
+
+
+
+
+ Looks up a localized string similar to The available options are: .
+
+
+
+
+ Looks up a localized string similar to (Short form: {0}).
+
+
+
+
+ Looks up a localized string similar to {0} - Version {1}.
+
+
+
+
+ Looks up a localized string similar to --- CANCELED ---.
+
+
+
+
+ Looks up a localized string similar to >>> CANCELING <<<.
+
+
+
+
+ Looks up a localized string similar to The runtime could not be initialized..
+
+
+
+
+ Looks up a localized string similar to Cannot escape character {0}.
+
+
+
+
+ Looks up a localized string similar to (char code = {0}).
+
+
+
+
+ Looks up a localized string similar to Colon expected.
+
+
+
+
+ Looks up a localized string similar to Comma expected.
+
+
+
+
+ Looks up a localized string similar to The filter expression can't be empty.
+
+
+
+
+ Looks up a localized string similar to Missing end {0}.
+
+
+
+
+ Looks up a localized string similar to Missing escaped character.
+
+
+
+
+ Looks up a localized string similar to Right bracket expected.
+
+
+
+
+ Looks up a localized string similar to String literal expected.
+
+
+
+
+ Looks up a localized string similar to Unexpected character found ({0}).
+
+
+
+
+ Looks up a localized string similar to Unexpected end of input.
+
+
+
+
+ Looks up a localized string similar to Value expected.
+
+
+
+
+ Looks up a localized string similar to Expected a method with signature ({0}) but found ({1})..
+
+
+
+
+ Looks up a localized string similar to The remote host service threw an exception or could not be reached..
+
+
+
+
+ Looks up a localized string similar to Root.
+
+
+
+
+ Looks up a localized string similar to At most one action may be active within the scope at a time..
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio35.dll b/lib/Gallio_3.2.517.0/Gallio35.dll
new file mode 100644
index 00000000..58e4a672
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio35.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio35.pdb b/lib/Gallio_3.2.517.0/Gallio35.pdb
new file mode 100644
index 00000000..619d1d97
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio35.pdb differ
diff --git a/lib/Gallio_3.2.517.0/Gallio35.plugin b/lib/Gallio_3.2.517.0/Gallio35.plugin
new file mode 100644
index 00000000..856ad628
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio35.plugin
@@ -0,0 +1,35 @@
+
+
+
+ Gallio Extensions for .Net 3.5
+ 3.2.0.0
+ Provides additional Gallio features for use with .Net 3.5.
+ plugin://Gallio/Resources/Gallio.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/Gallio35.xml b/lib/Gallio_3.2.517.0/Gallio35.xml
new file mode 100644
index 00000000..93b8414d
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio35.xml
@@ -0,0 +1,293 @@
+
+
+
+ Gallio35
+
+
+
+
+ Extension methods for delegates.
+
+
+
+
+ Wraps an action as a function that returns a dummy value.
+
+ The function.
+
+
+
+ Extension methods for .
+
+
+
+
+ Binds the arguments of a function expression.
+
+ The parameter type.
+ The result type.
+ The expression.
+ The argument value.
+ The bound function.
+
+
+
+ Binds the arguments of a function expression.
+
+ The first parameter type.
+ The second parameter type.
+ The result type.
+ The expression.
+ The first argument value.
+ The second argument value.
+ The bound function.
+
+
+
+ Returns true if the expression represents a captured variable within a closure.
+
+ The expression.
+ True if the expression represents a captured variable.
+
+
+
+ Returns true if the expression represents a captured variable within a closure.
+
+ The expression.
+ True if the expression represents a captured variable.
+
+
+
+ Returns true if the expression represents a captured variable or a parameter.
+
+ The expression.
+ True if the expression represents a captured variable or a parameter.
+
+
+
+ Instuments an to intercept intermediate results
+ from each sub-expression.
+
+
+
+
+ Compiles an expression to introduce trace points.
+
+ The expression type.
+ The expression tree.
+ The compiled delegate representing expression.
+ Thrown if is null.
+
+
+
+ Rewrites an expression tree to introduce trace points.
+
+ The expression type.
+ The expression tree.
+ The compiled delegate representing expression.
+ Thrown if is null.
+
+
+
+ Evaluates a sub-expression and collects trace information.
+
+ The return type of the sub-expression.
+ The sub-expression to evaluate.
+ The continuation that evaluates the sub-expression.
+ The result of the evaluation.
+
+
+
+ Performs different actions depending on the type of visited.
+
+ The visitor result type.
+
+
+
+ Visits the expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a binary expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a unary expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a call expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a conditional expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a constant expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits an invocation expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a lambda expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits an list init expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a member access expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a member init expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a new expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a new array expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a parameter expression.
+
+ The expression.
+ The result.
+
+
+
+ Visits a type binary expression.
+
+ The expression.
+ The result.
+
+
+
+
+ Visits an expression of any type that does not have other special behavior.
+
+
+ The default implementation throws .
+
+
+ The expression.
+ The result.
+
+
+
+ The Gallio.Common.Linq namespace contains types for manipulating Linq expressions.
+
+
+
+
+ Evaluates a conditional expression. If the condition evaluates differently
+ than expected, returns a detailed that
+ describes the formatted values of relevant sub-expressions within the condtion.
+
+
+
+
+ Evaluates a conditional expression.
+
+ The conditional expression.
+ The expected result.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ The assertion failure if the conditional expression evaluated
+ to a different result than was expected or threw an exception, otherwise null.
+ Thrown if is null.
+
+
+
+ A formatting rule for .
+
+
+
+ Formats expression trees using a more familiar C#-like syntax than
+ the default. Also recognizes captured variables and displays them
+ naturally to conceal the implied field access to an anonymous class.
+
+
+ Made-up syntax for nodes that cannot be directly represented in C#.
+
+ - Power operator: **, as in a ** b
+ - Quote expression: `...`, as in `a + b`
+ - Constants: formatted recursively using other formatters, which may yield unusual syntax
+
+
+
+
+
+
+
+
+
+
+
+
+ Extensions methods for formatting.
+
+
+
+
+ Formats an object using the default .
+
+ The object to format.
+ The formatted object.
+
+
+
+ Formats an object using the specified .
+
+ The object to format.
+ The formatter to use, or null for the default.
+ The formatted object.
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio40.dll b/lib/Gallio_3.2.517.0/Gallio40.dll
new file mode 100644
index 00000000..1701819c
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio40.dll differ
diff --git a/lib/Gallio_3.2.517.0/Gallio40.pdb b/lib/Gallio_3.2.517.0/Gallio40.pdb
new file mode 100644
index 00000000..e654f1e2
Binary files /dev/null and b/lib/Gallio_3.2.517.0/Gallio40.pdb differ
diff --git a/lib/Gallio_3.2.517.0/Gallio40.plugin b/lib/Gallio_3.2.517.0/Gallio40.plugin
new file mode 100644
index 00000000..9730c4b9
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio40.plugin
@@ -0,0 +1,29 @@
+
+
+
+ Gallio Extensions for .Net 4.0
+ 3.2.0.0
+ Provides additional Gallio features for use with .Net 4.0.
+ plugin://Gallio/Resources/Gallio.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Gallio40.xml b/lib/Gallio_3.2.517.0/Gallio40.xml
new file mode 100644
index 00000000..9cd44d01
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Gallio40.xml
@@ -0,0 +1,8 @@
+
+
+
+ Gallio40
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/ICSharpCode.TextEditor.dll b/lib/Gallio_3.2.517.0/ICSharpCode.TextEditor.dll
new file mode 100644
index 00000000..75accd53
Binary files /dev/null and b/lib/Gallio_3.2.517.0/ICSharpCode.TextEditor.dll differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit.Compatibility.dll b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.dll
new file mode 100644
index 00000000..ad5627d8
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.dll differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit.Compatibility.pdb b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.pdb
new file mode 100644
index 00000000..cb839633
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.pdb differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit.Compatibility.plugin b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.plugin
new file mode 100644
index 00000000..78fd870d
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.plugin
@@ -0,0 +1,28 @@
+
+
+
+ MbUnit v3 Extensions for Backwards Compatibility
+ 3.2.0.0
+ Provides extensions for MbUnit v3 to assist with test migration from MbUnit v2.
+ plugin://MbUnit/Resources/MbUnit.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/MbUnit.Compatibility.xml b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.xml
new file mode 100644
index 00000000..9ba837e0
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit.Compatibility.xml
@@ -0,0 +1,3419 @@
+
+
+
+ MbUnit.Compatibility
+
+
+
+
+ Array Assertion class
+
+
+
+
+ Verifies that both array have the same dimension and elements.
+
+ The expected values.
+ The actual values.
+
+
+
+ Checks whether an object is of an type.
+
+ Object instance to check as an array.
+ True if Type, False otherwise.
+
+
+
+ Assertion class
+
+
+
+
+ The Equals method throws an AssertionException. This is done
+ to make sure there is no mistake by calling this function.
+
+ The first object.
+ The second object.
+
+
+
+ override the default ReferenceEquals to throw an AssertionException. This
+ implementation makes sure there is no mistake in calling this function
+ as part of Assert.
+
+ The first object.
+ The second object.
+
+
+
+ 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.
+
+
+
+ Used to compare numeric types. Comparisons between
+ same types are fine (Int32 to Int32, or Int64 to Int64),
+ but the Equals method fails across different types.
+ This method was added to allow any numeric type to
+ be handled correctly, by using ToString and
+ comparing the result
+
+ The expected value.
+ The actual value.
+
+
+
+
+ Asserts that a condition is true. If the condition is false the method throws
+ an .
+
+ The evaluated condition.
+
+ The format of the message to display if the condition is false,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ 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 format of the message to display if the condition is false,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Asserts that a condition is false. If the condition is true the method throws
+ an .
+
+ The evaluated condition.
+
+
+
+ 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 equals then an is
+ thrown.
+
+ The expected value.
+ The actual value.
+ The maximum acceptable difference between the
+ the expected and the actual.
+ The message printed out upon 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 equals then an is
+ thrown.
+
+ The expected value.
+ The actual value.
+ The maximum acceptable difference between the
+ the expected and the actual.
+
+
+
+ Verifies that two floats are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equals then an is
+ thrown.
+
+ The message printed out upon failure.
+ The expected value.
+ The actual value.
+ The maximum acceptable difference between the
+ the expected and the actual.
+
+
+
+ Verifies that two floats are equal considering a delta. If the
+ expected value is infinity then the delta value is ignored. If
+ they are not equals then an is
+ thrown.
+
+ The expected value.
+ The actual value.
+ The maximum acceptable difference between the
+ the expected and the actual.
+
+
+
+ Verifies that two decimals are equal. If
+ they are not equals then an is
+ thrown.
+
+ The message printed out upon failure.
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that two decimals are equal. If
+ they are not equals then an is
+ thrown.
+
+ The expected value.
+ The actual value.
+
+ The format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Verifies that two decimals are equal. If
+ they are not equals then an is
+ thrown.
+
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that two ints are equal. If
+ they are not equals then an is
+ thrown.
+
+ The message printed out upon failure.
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that two ints are equal. If
+ they are not equals then an is
+ thrown.
+
+ The expected value.
+ The actual value.
+
+ The format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Verifies that two ints are equal. If
+ they are not equals then an is
+ thrown.
+
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. All
+ non-numeric types are compared by using the Equals method.
+ If they are not equal an is thrown.
+
+ The value that is expected.
+ The actual value.
+
+ The format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. All
+ non-numeric types are compared by using the Equals method.
+ If they are not equal an is thrown.
+
+ The value that is expected.
+ The actual value.
+ The message to display if objects are not equal.
+
+
+
+ Verifies that two objects are equal. Two objects are considered
+ equal if both are null, or if both have the same value. All
+ non-numeric types are compared by using the Equals method.
+ If they are not equal an is thrown.
+
+ The value that is expected.
+ The actual value.
+
+
+
+ Verifies that the value of the property described by is the same
+ in both ojects.
+
+
+ Property describing the value to test
+
+
+ Reference object
+
+
+ Actual object
+
+
+ Index of the property.
+
+
+
+
+ Asserts that two objects are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the two objects are the same object.
+ Arguments to be used in formatting the message.
+
+
+
+ Asserts that two objects are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the objects are the same.
+
+
+
+ Asserts that two objects are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+
+
+
+ Asserts that two ints are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the two objects are the same object.
+ Arguments to be used in formatting the message.
+
+
+
+ Asserts that two ints are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the objects are the same.
+
+
+
+ Asserts that two ints are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+
+
+
+ Asserts that two uints are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the two objects are the same object.
+ Arguments to be used in formatting the message.
+
+
+
+ Asserts that two uints are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the objects are the same.
+
+
+
+ Asserts that two uints are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+
+
+
+ Asserts that two decimals are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the two objects are the same object.
+ Arguments to be used in formatting the message.
+
+
+
+ Asserts that two decimals are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the objects are the same.
+
+
+
+ Asserts that two decimals are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+
+
+
+ Asserts that two floats are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the two objects are the same object.
+ Arguments to be used in formatting the message.
+
+
+
+ Asserts that two floats are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the objects are the same.
+
+
+
+ Asserts that two floats are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+
+
+
+ Asserts that two doubles are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the two objects are the same object.
+ Arguments to be used in formatting the message.
+
+
+
+ Asserts that two doubles are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+ The message to be displayed when the objects are the same.
+
+
+
+ Asserts that two doubles are not equal. If they are equal
+ an is thrown.
+
+ The expected object.
+ The actual object.
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is not null then an
+ is thrown.
+
+ The object that is to be tested.
+
+ The format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Verifies that the object that is passed in is not equal to null
+ If the object is null then an
+ is thrown with the message that is passed in.
+
+ The object that is to be tested.
+ The message to initialize the with.
+
+
+
+ Verifies that the object that is passed in is not 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 null then an
+ is thrown.
+
+ The object that is to be tested.
+
+ The format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is null then an
+ is thrown with the message that is passed in.
+
+ The object that is to be tested.
+ The message to initialize the with.
+
+
+
+ Verifies that the object that is passed in is equal to null
+ If the object is null then an
+ is thrown.
+
+ The object that is to be tested.
+
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The message to be printed when the two objects are not the same object.
+ The expected object.
+ The actual object.
+
+
+
+ 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 format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Asserts that two objects refer to the same object. If they
+ are not the same an is thrown.
+
+ The expected object.
+ The actual object.
+
+
+
+ Throws an with the message that is
+ passed in. This is used by the other Assert functions.
+
+
+ The format of the message to initialize the with.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ 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 with the message that is
+ passed in. This is used by the other Assert functions.
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is strictly lower than
+ .
+
+
+
+
+ Verifies that is lower equal than
+ .
+
+
+
+
+ Verifies that is lower equal than
+ .
+
+
+
+
+ Verifies that is lower equal than
+ .
+
+
+
+
+ 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 that will be displayed on failure.
+ Arguments 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 that will be displayed on 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 that will be displayed on failure.
+ Arguments 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 that will be displayed on 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 that will be displayed on failure.
+ Arguments 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 that will be displayed on 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 that will be displayed on failure.
+ Arguments 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 that will be displayed on 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 that will be displayed on failure.
+ Arguments 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 that will be displayed on 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 that will be displayed on failure.
+ Arguments 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 that will be displayed on 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 that will be displayed on failure.
+ Arguments 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 that will be displayed on 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 is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are 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 they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are 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 they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are 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 they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are 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 they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are 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 they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are 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 they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+ The message that will be displayed on failure.
+
+
+
+ Verifies that the first value is greater than the second
+ value. If they are not, then an
+ is thrown.
+
+ The first value, expected to be greater.
+ The second value, expected to be less.
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Verifies that is strictly greater than
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is between and
+ .
+
+
+
+
+ Asserts that is not between and
+ .
+
+
+
+
+ Asserts that is not between and
+ .
+
+
+
+
+ Asserts that is not between and
+ .
+
+
+
+
+ Asserts that is not between and
+ .
+
+
+
+
+ Asserts that is not between and
+ .
+
+
+
+
+ Asserts that is not between and
+ .
+
+
+
+
+ Asserts that is not between and
+ .
+
+
+
+
+ Asserts that is in the dic .
+
+
+
+
+ Asserts that is in the dic .
+
+
+
+
+ Asserts that is in the list .
+
+
+
+
+ Asserts that is in the list .
+
+
+
+
+ Asserts that is in the enumerable collection .
+
+
+
+
+ Asserts that is in the enumerable collection .
+
+
+
+
+ Asserts that is not in the dic .
+
+
+
+
+ Asserts that is not in the dic .
+
+
+
+
+ Asserts that is not in the list .
+
+
+
+
+ Asserts that is not in the list .
+
+
+
+
+ Asserts that is not in the enumerable collection .
+
+
+
+
+ Asserts that is not in the enumerable collection .
+
+
+
+
+ Assert that a string is empty - that is equal to string.Empty
+
+ The string to be tested.
+ The message to be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Assert that a string is empty - that is equal to string.Emtpy
+
+ The string to be tested.
+ The message to be displayed on failure.
+
+
+
+ Assert that a string is empty - that is equal to string.Emtpy
+
+ 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 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 ICollection.
+ The message to be displayed on failure.
+
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing ICollection.
+
+
+
+ Assert that a string is empty - that is equal to string.Emtpy
+
+ The string to be tested.
+ The message to be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Assert that a string is empty - that is equal to string.Emtpy
+
+ The string to be tested.
+ The message to be displayed on failure.
+
+
+
+ Assert that a string is empty - that is equal to string.Emtpy
+
+ 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 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 ICollection.
+ The message to be displayed on failure.
+
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing ICollection.
+
+
+
+ Verifies that the double is passed is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The value that is to be tested.
+ The message to be displayed when the object is not null.
+ Arguments to be used in formatting the message.
+
+
+
+ Verifies that the double is passed is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The object that is to be tested.
+ The message to be displayed when the object is not null.
+
+
+
+ Verifies that the double is passed is an NaN value.
+ If the object is not NaN then an
+ is thrown.
+
+ The object that is to be tested.
+
+
+
+ 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 messge 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.
+ 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.
+
+
+
+ Asserts that an object may not be assigned a value of a given Type.
+
+ The expected Type.
+ The object under examination.
+ The messge 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.
+ 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.
+
+
+
+ Asserts that an object is an instance of a given type.
+
+ The expected Type.
+ The object being examined.
+ A 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.
+ A message to display in case of failure.
+ An 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.
+
+
+
+ Asserts that an object is not an instance of a given type.
+
+ The expected Type.
+ The object being examined.
+ A 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.
+ A message to display in case of failure.
+ An array of objects to be used in formatting the message.
+
+
+
+ This method is called when two objects have been compared and found to be
+ different. This prints a nice message to the screen.
+
+ The expected object.
+ The actual object.
+
+ The format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ This method is called when the two objects are not the same.
+
+ The expected object.
+ The actual object.
+
+ The format of the message to display if the assertion fails,
+ containing zero or more format items.
+
+
+ An array containing zero or more objects to format.
+
+
+
+ The error message is formatted using .
+
+
+
+
+
+ Assertion helper for the class.
+
+
+
+ This class contains static helper methods to verify assertions on the
+ class.
+
+
+
+
+
+ Verifies that the property value
+ of and are equal.
+
+
+ Instance containing the expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that the property value
+ of is equal to .
+
+
+ Expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that the property value
+ is true.
+
+
+ Instance containing the expected value.
+
+
+
+
+ Verifies that the property value
+ is false.
+
+
+ Instance containing the expected value.
+
+
+
+
+ Verifies that the property value
+ of and are equal.
+
+
+ Instance containing the expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that the property value
+ of is equal to .
+
+
+ Expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that the property value
+ of and are equal.
+
+
+ Instance containing the expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that the property value
+ of is equal to .
+
+
+ Expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that the property
+ is synchronized with the number of iterated elements.
+
+
+ Collection to test.
+
+
+ is a null reference (Nothing in Visual Basic).
+
+
+
+
+ Verifies that and
+ are equal collections. Element count and element wize equality is verified.
+
+
+ Expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that and
+ are equal collections. Element count and element wize equality is verified.
+
+
+ Expected value.
+
+
+ Instance containing the tested value.
+
+
+
+
+ Verifies that and
+ are equal collections. Element count and element wize equality is verified.
+
+
+ Expected value.
+
+
+ Instance containing the tested value.
+
+
+ Reason for unequality.
+
+
+
+
+ Asserts that all items contained in collection are of the type specified by expectedType.
+
+ ICollection of 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.
+
+ ICollection of 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.
+
+ ICollection of 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.
+
+ ICollection of objects to be considered.
+
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ ICollection of objects to be considered.
+ The message that will be displayed on failure.
+
+
+
+ Asserts that all items contained in collection are not equal to null.
+
+ ICollection 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.
+
+ ICollection of objects to be considered.
+
+
+
+ Ensures that every object contained in collection exists within the collection
+ once and only once.
+
+ ICollection 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.
+
+ ICollection 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 equivalent, containing the same objects but the match may be in any order.
+
+ The first ICollection of objects to be considered.
+ The second ICollection 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 ICollection of objects to be considered.
+ The second ICollection 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 ICollection of objects to be considered.
+ The second ICollection 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 ICollection of objects to be considered.
+ The second ICollection 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 ICollection of objects to be considered.
+ The second ICollection of objects to be considered.
+ The IComparer to use in comparing objects from each ICollection.
+
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first ICollection of objects to be considered.
+ The second ICollection 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 ICollection of objects to be considered.
+ The second ICollection of objects to be considered.
+ The IComparer to use in comparing objects from each ICollection.
+ The message that will be displayed on failure.
+
+
+
+ Asserts that expected and actual are not exactly equal.
+
+ The first ICollection of objects to be considered.
+ The second ICollection 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 ICollection of objects to be considered.
+ The second ICollection of objects to be considered.
+ The IComparer to use in comparing objects from each ICollection.
+ 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 ICollection of objects to be considered.
+ The second ICollection of objects to be considered.
+
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first ICollection of objects to be considered.
+ The second ICollection of objects to be considered.
+ The message that will be displayed on failure.
+
+
+
+ Asserts that expected and actual are not equivalent.
+
+ The first ICollection of objects to be considered.
+ The second ICollection 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.
+
+ ICollection of objects to be considered.
+ Object to be found within collection.
+
+
+
+ Asserts that collection contains actual as an item.
+
+ ICollection 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.
+
+ ICollection 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.
+
+ ICollection of objects to be considered.
+ Object that cannot exist within collection.
+
+
+
+ Asserts that collection does not contain actual as an item.
+
+ ICollection 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.
+
+ ICollection 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 subset is not a subset of superset.
+
+ The ICollection subset to be considered.
+ The ICollection superset to be considered.
+
+
+
+ Asserts that subset is not a subset of superset.
+
+ The ICollection subset to be considered.
+ The ICollection superset to be considered.
+ The message that will be displayed on failure.
+
+
+
+ Asserts that subset is not a subset of superset.
+
+ The ICollection subset to be considered.
+ The ICollection superset to be considered.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Asserts that subset is a subset of superset.
+
+ The ICollection subset to be considered.
+ The ICollection superset to be considered.
+
+
+
+ Asserts that subset is a subset of superset.
+
+ The ICollection subset to be considered.
+ The ICollection superset to be considered.
+ The message that will be displayed on failure.
+
+
+
+ Asserts that subset is a subset of superset.
+
+ The ICollection subset to be considered.
+ The ICollection superset to be considered.
+ The message that will be displayed on failure.
+ Arguments to be used in formatting the message.
+
+
+
+ Checks an item if included in a given collection.
+
+ The collection to check from.
+ The item to be checked.
+ True if item is included, False otherwise.
+
+
+
+ Assertion class
+
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection.
+ 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 ICollection.
+ The message to be displayed on failure.
+
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing ICollection.
+
+
+
+ Assert that an array, list or other collection is empty
+
+ An array, list or other collection implementing ICollection.
+ 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 ICollection.
+ The message to be displayed on failure.
+
+
+
+ Assert that an array,list or other collection is empty
+
+ An array, list or other collection implementing ICollection.
+
+
+
+ Reflection Assertion class
+
+
+
+
+ Asserts whether an instance of the
+ can be assigned from an instance of .
+
+
+ Parent instance.
+
+
+ Child instance.
+
+
+
+
+ Asserts whether is an instance of the
+ .
+
+
+ instance.
+
+
+ Child instance.
+
+
+
+
+ Asserts that the type has a default public constructor
+
+
+
+
+ Asserts that the type has a public instance constructor with a signature defined by parameters.
+
+
+
+
+ Asserts that the type has a constructor, with the specified bindind flags, with a signature defined by parameters.
+
+
+
+
+ Asserts that the type has a public instance method with a signature defined by parameters.
+
+
+
+
+ Asserts that the type has a method, with the specified bindind flags, with a signature defined by parameters.
+
+
+
+
+ Asserts that the type has a public field method with a signature defined by parameters.
+
+
+
+
+ Asserts that the type has a field, with the specified bindind flags, with a signature defined by parameters.
+
+
+
+
+ String Assertion class
+
+
+
+
+ Asserts that two strings are equal, ignoring the case
+
+
+ Expected string.
+
+
+ Actual string.
+
+
+
+
+ Asserts that the string is non null and empty
+
+
+ String to test.
+
+
+
+
+ Asserts that the string is non null and non empty
+
+
+ String to test.
+
+
+
+
+ Asserts the regular expression reg makes a full match on s
+
+
+ String to test.
+
+
+ Regular expression.
+
+
+
+
+ Asserts the regular expression regex makes a full match on
+ .
+
+
+ String to test.
+
+
+ Regular expression.
+
+
+
+
+ Asserts the regular expression reg makes a match on s
+
+
+ String to test.
+
+
+ Regular expression.
+
+
+
+
+ Asserts the regular expression regex makes a match on s
+
+
+ String to test.
+
+
+ A instance.
+
+
+
+
+ Asserts the regular expression reg makes a match on s
+
+
+ String to test.
+
+
+ Regular expression.
+
+
+
+
+ Asserts the regular expression regex makes a match on s
+
+
+ String to test.
+
+
+ A instance.
+
+
+
+
+ Asserts the string does not contain c
+
+
+ String to test.
+
+
+ Variable list of characeters.
+
+
+
+
+ Access modifier of a class or class member.
+
+
+
+
+ Public.
+
+
+
+
+ Protected, internal, private.
+
+
+
+
+ Static.
+
+
+
+
+ Default that includes public, protected, internal, private, and static.
+
+
+
+
+ Member types of a class.
+
+
+
+
+ Method.
+
+
+
+
+ Field or variable.
+
+
+
+
+ Property.
+
+
+
+
+ The MbUnit.Framework.Reflection namespace provides helpers for accessing
+ non-public members of types from test code.
+
+
+
+
+ Indicates that a reflection operation performed by failed.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Helper class to test non-public classes and class members.
+
+
+
+
+ Constructor for object.
+
+ Object to be referred to in methods.
+
+
+
+ Use this constructor if you plan to test default constructor of a non-public class.
+
+ Assembly name.
+ Type name.
+
+
+
+ Use this constructor if you plan to test constructor with arguments of a non-public class.
+
+ Assembly name.
+ Type name.
+ Parameters for a constructor.
+
+
+
+ Gets the public, non-public, or static field value.
+
+ Field name.
+ Field value.
+
+
+
+ Gets the field value.
+
+ Field name.
+ Specify field access modifier.
+ Field value.
+
+
+
+ Gets the field value.
+
+ Field name.
+ Specify field access modifier.
+ Specify if need to look in Base classes.
+ Field value.
+
+
+
+ Sets the field value.
+
+ Field Name.
+ Field Value.
+
+
+
+ Sets the field value.
+
+ Field Name.
+ Field Value.
+ Specify field access modifier.
+
+
+
+ Gets the property value
+
+ Property Name.
+ Property Value.
+
+
+
+ Get the property value
+
+ Specify property access modifier.
+ Property Name.
+ Property Value.
+
+
+
+ Get the property value.
+
+ Specify property access modifier.
+ Property Name.
+ Specify if need to look in Base classes.
+ Property Value.
+
+
+
+ Sets the property value.
+
+ Property Name.
+ Property Value.
+
+
+
+ Sets the property value.
+
+ Specify property access modifier.
+ Property Name.
+ Property Value.
+
+
+
+ Executes a non-public method with arguments on a object
+
+ Method to call.
+ The object the method should return.
+
+
+
+ Executes a non-public method with arguments on a object
+
+ Method to call.
+ Method's parameters.
+ The object the method should return.
+
+
+
+ Executes a non-public method with arguments on a object
+
+ Method to call.
+ Specify method access modifier.
+ Method's parameters.
+ The object the method should return.
+
+
+
+ Creates an instance
+
+ Full assembly path.
+ Type Name such as (System.String).
+ Newly created object.
+
+
+
+ Creates an instance
+
+ Full assembly path.
+ Type Name such as (System.String)
+ Constructor parameters.
+ Newly created object.
+
+
+
+ Gets the public, non-public, or static field value.
+
+ Object where field is defined.
+ Field name.
+ Field value.
+
+
+
+ Gets the field value.
+
+ Specify field access modifier.
+ Object where field is defined.
+ Field name.
+ Field value.
+
+
+
+ Gets the field value.
+
+ Specify field access modifier.
+ Object where field is defined.
+ Field name.
+ Specify if need to look in Base classes.
+ Field value.
+
+
+
+ Sets the field value.
+
+ Object where field is defined.
+ Field Name.
+ Field Value.
+
+
+
+ Sets the field value.
+
+ Specify field access modifier.
+ Object where field is defined.
+ Field Name.
+ Field Value.
+
+
+
+ Sets the field value.
+
+ Specify field access modifier.
+ Object where field is defined.
+ Field Name.
+ Field Value.
+ Specify if need to look in Base classes.
+
+
+
+ Gets the property value.
+
+ Object where property is defined.
+ Property Name.
+ Property Value.
+
+
+
+ Gets the property value.
+
+ Specify property access modifier.
+ Object that has the property.
+ Property Name.
+ Property Value.
+
+
+
+ Gets the property value.
+
+ Specify property access modifier.
+ Object that has the property.
+ Property Name.
+ Set to true if need look for the property in base classes.
+ Property Value.
+
+
+
+ Sets the property value.
+
+ Object where property is defined.
+ Property Name.
+ Property Value.
+
+
+
+ Sets the property value.
+
+ Specify property access modifier.
+ Object where property is defined.
+ Property Name.
+ Property Value.
+
+
+
+ Sets the property value.
+
+ Specify property access modifier.
+ Object where property is defined.
+ Property Name.
+ Property Value.
+ Set to true if need look for the property in base classes.
+
+
+
+ Executes a non-public method with arguments on a object
+
+ Object where method is defined.
+ Method to call.
+ The object the method should return.
+
+
+
+ Executes a non-public method with arguments on a object
+
+ Object where method is defined.
+ Method to call.
+ Method's parameters.
+ The object the method should return.
+
+
+
+ Executes a non-public method with arguments on a object
+
+ Specify method access modifier.
+ Object where method is defined.
+ Method to call.
+ Method's parameters.
+ The object the method should return.
+
+
+
+ Executes a non-public method with arguments on a object
+
+ Specify method access modifier.
+ Object where method is defined.
+ Method to call.
+ Speicifies if to search for the method in the base classes or not.
+ Method's parameters.
+ The object the method should return.
+
+
+
+ Provides compatibility with MbUnit v2 row test feature.
+
+
+
+
+ Security Assertion class
+
+
+
+
+ Asserts that is authenticated.
+
+
+
+
+ Asserts that is not authenticated.
+
+
+
+
+ Asserts that the current windows identity is authenticated.
+
+
+
+
+ Asserts that the current windows identity is not authenticated.
+
+
+
+
+ Asserts that the current windows identity is in .
+
+
+
+
+ Asserts that the current windows identity is in
+ role.
+
+
+
+
+ Asserts that the current windows identity is in
+ role.
+
+
+
+
+ Asserts that the current windows identity is in
+ role.
+
+
+
+
+ Asserts that the current windows identity is in
+ role.
+
+
+
+
+ Provides compatibility with MbUnit v2 test fixture set up.
+
+
+
+
+ Provides compatibility with MbUnit v2 test fixture tear down.
+
+
+
+
+ Class containing generic assert methods for XML markup
+
+
+
+
+ Asserts that two pieces of XML are similar.
+
+ The control text reader.
+ The test text reader.
+
+
+
+ Asserts that two pieces of XML are similar.
+
+ The control text.
+ The test text.
+
+
+
+ Asserts that two pieces of XML are similar.
+
+ The control input.
+ The test input.
+
+
+
+ Asserts that two pieces of XML are identical.
+
+ The control text reader.
+ The test text reader.
+
+
+
+ Asserts that two pieces of XML are identical.
+
+ The control text.
+ The test text.
+
+
+
+ Asserts that two pieces of XML are identical.
+
+ The control input.
+ The test input.
+
+
+
+ Asserts that two pieces of XMl are similar given their diff
+
+ The XML diff.
+
+
+
+ Asserts that two pieces of XMl are not similar given their diff
+
+ The XML diff.
+
+
+
+ Asserts that two pieces of XML are similar (or not) given their diff and a boolean value
+
+ The XML diff.
+ if set to true the assert passes if the XML is similar.
+ if false , the assert passes if the XML is not similar.
+
+
+
+ Asserts that two pieces of XML are identical given their diff
+
+ The XML diff.
+
+
+
+ Asserts that two pieces of XML are not identical given their diff
+
+ The XML diff.
+
+
+
+ Asserts that two pieces of XML are identical (or not) given their diff and a boolean value
+
+ The XML diff.
+ if set to true the assert passes if the XML is identical.
+ if false , the assert passes if the XML is not identical.
+
+
+
+ Asserts that is valid XML.
+
+ The XMl to test.
+
+
+
+ Asserts that is valid XML given a
+
+ The XML to test.
+ The base URI.
+
+
+
+ Asserts that some XML is valid.
+
+ A pointing to the XML to test.
+
+
+
+ Asserts that some XML is valid given a
+
+ A pointing to the XML to test.
+ The base URI.
+
+
+
+ Asserts that some XML is valid.
+
+ The XML input.
+
+
+
+ Asserts that some XML is valid.
+
+ A object containing the XML to validate.
+
+
+
+ Assert that an XPath expression matches at least one node in someXml
+
+ An X path expression.
+ The XML being tested.
+
+
+
+ Assert that an XPath expression matches at least one node in someXml
+
+ An X path expression.
+ A reader ontot eh XML being tested.
+
+
+
+ Assert that an XPath expression matches at least one node in someXml
+
+ An X path expression.
+ The XML to test.
+
+
+
+ Asserts that the flattened String obtained by executing an Xpath on some XML is a particular value
+
+ An X path expression.
+ The XML to test.
+ The expected value.
+
+
+
+ Asserts that the flattened String obtained by executing an Xpath on some XML is a particular value
+
+ An X path expression.
+ The XML to test.
+ The expected value.
+
+
+
+ Asserts that the flattened String obtained by executing an Xpath on some XML is a particular value
+
+ An X path expression.
+ The XML to test.
+ The expected value.
+
+
+
+ Asserts that the results of an XSL transform on some XML are the expected result
+
+ The XSL transform.
+ The XML to transform.
+ The expected result.
+
+
+
+ Asserts that the results of an XSL transform on some XML are the expected result
+
+ The XSL transform.
+ The XML to transform.
+ The expected result.
+
+
+
+ Utilities for manipulating differences.
+
+
+
+
+ Returns true is a difference is considered significant.
+
+
+
+
+ Describes the type of difference found.
+
+
+
+
+ Comparing an implied attribute value against an explicit value
+
+
+
+
+ Comparing 2 elements and one has an attribute the other does not
+
+
+
+
+ Comparing 2 attributes with the same name but different values
+
+
+
+
+ Comparing 2 attribute lists with the same attributes in different sequence
+
+
+
+
+ Comparing 2 CDATA sections with different values
+
+
+
+
+ Comparing 2 comments with different values
+
+
+
+
+ Comparing 2 document types with different names
+
+
+
+
+ Comparing 2 document types with different public identifiers
+
+
+
+
+ Comparing 2 document types with different system identifiers
+
+
+
+
+ Comparing 2 elements with different tag names
+
+
+
+
+ Comparing 2 elements with different number of attributes
+
+
+
+
+ Comparing 2 processing instructions with different targets
+
+
+
+
+ Comparing 2 processing instructions with different instructions
+
+
+
+
+ Comparing 2 different text values
+
+
+
+
+ Comparing 2 nodes with different namespace prefixes
+
+
+
+
+ Comparing 2 nodes with different namespace URIs
+
+
+
+
+ Comparing 2 nodes with different node types
+
+
+
+
+ Comparing 2 nodes but only one has any children
+
+
+
+
+ Comparing 2 nodes with different numbers of children
+
+
+
+
+ Comparing 2 nodes with children whose nodes are in different sequence
+
+
+
+
+ Comparing 2 Documents only one of which has a doctype
+
+
+
+
+ Comparing 2 Documents only one of which has an XML Prefix Declaration
+
+
+
+
+ The MbUnit.Framework.Xml namespace contains types for comparing Xml documents.
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/MbUnit.dll b/lib/Gallio_3.2.517.0/MbUnit.dll
new file mode 100644
index 00000000..9439aa7a
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit.dll differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit.dll.tdnet b/lib/Gallio_3.2.517.0/MbUnit.dll.tdnet
new file mode 100644
index 00000000..367728e3
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit.dll.tdnet
@@ -0,0 +1,6 @@
+
+ MbUnit v{0}.{1}
+ TDNet\Gallio.TDNetRunner.dll
+ Gallio.TDNetRunner.GallioResidentTestRunner
+ Resident
+
diff --git a/lib/Gallio_3.2.517.0/MbUnit.pdb b/lib/Gallio_3.2.517.0/MbUnit.pdb
new file mode 100644
index 00000000..a8f95218
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit.pdb differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit.plugin b/lib/Gallio_3.2.517.0/MbUnit.plugin
new file mode 100644
index 00000000..d55f27db
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit.plugin
@@ -0,0 +1,54 @@
+
+
+
+ MbUnit v3
+ 3.2.0.0
+ Provides support for running MbUnit v3 tests.
+ plugin://MbUnit/Resources/MbUnit.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MbUnit v3
+ MbUnit, Version=3.2.0.0
+ plugin://MbUnit/Resources/MbUnit.ico
+ 3.2.0.0
+ Assembly
+
+
+
+
+
+ MbUnit v3 Assembly
+ MbUnit v3 Test Assembly
+ plugin://MbUnit/Resources/MbUnit.ico
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/MbUnit.xml b/lib/Gallio_3.2.517.0/MbUnit.xml
new file mode 100644
index 00000000..b3740ca5
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit.xml
@@ -0,0 +1,11494 @@
+
+
+
+ MbUnit
+
+
+
+
+ Associates an annotation message of the specified type with the code element.
+
+
+
+ An annotation is a message that is associated with code. This is different
+ from the metadata that may be associated with a test because an annotation
+ can apply to code elements that are not tests.
+
+
+ For example, if an error occurs while parsing the declarative attribute
+ structure that defines a test, then the test itself may not be added to
+ the test tree. Instead, the Pattern Test Framework will associated an
+ error annotation with the point of definition of the test. This annotation
+ is displayed by the test runner as an error. Some test runners, such as the
+ ReSharper test runner, will actually highlight the annotated element in the
+ IDE using an error stripe.
+
+
+ This attribute makes it possible to add annotations to code elements
+ declaratively.
+
+
+ Note: The annotation will only be added if the associated code element is
+ traversed during the normal sequence of test exploration.
+
+
+
+
+
+ Associates an annotation message of the specified type with the code element.
+
+ The annotation type.
+ The annotation message.
+ Thrown if is null.
+
+
+
+ Sets the apartment state to be used to run the decorated test and its children
+ unless subsequently overridden.
+
+
+
+ If no apartment state is specified or if it is
+ the test will inherit the apartment state of its parent test. Consequently if the apartment
+ state is set on the fixture then its tests will use the same apartment state unless overridden.
+
+
+ The default apartment state for a test assembly is and
+ may be overridden by setting attribute on the assembly.
+
+
+
+
+
+ Sets the apartment state to be used to run the decorated test and its children
+ unless subsequently overridden.
+
+
+
+ If no apartment state is specified or if it is
+ the test will inherit the apartment state of its parent test. Consequently if the apartment
+ state is set on the fixture then its tests will use the same apartment state unless overridden.
+
+
+ The default apartment state for a test assembly is and
+ may be overridden by setting attribute on the assembly.
+
+
+ The apartment state to use.
+
+
+
+
+
+
+ Gets the apartment state to be used to run the decorated test.
+
+
+
+
+ Declares that a class contains assembly-level setup and teardown methods.
+
+
+
+ The assembly fixture attribute is applied to a class that contains setup and
+ teardown methods that are to be applied at the assembly level. Conceptually,
+ the adds new behavior to an assembly-level
+ test fixture that contains all of the test fixtures within the assembly.
+
+
+ The following attributes are typically used within an assembly fixture:
+
+ : Performs setup activities before any
+ test fixtures within the assembly are executed.
+ : Performs teardown activities after all
+ test fixtures within the assembly are executed.
+ : Performs setup activities before each
+ test fixture within the assembly is executed.
+ : Performs teardown activities after each
+ test fixture within the assembly is executed.
+
+
+
+ It is also possible to use other attributes as with an ordinary .
+ An assembly fixture also supports data binding. When data binding is used on an assembly
+ fixture, it will cause all test fixtures within the assembly to run once for each combination
+ of data values used.
+
+
+ The class must have a public default constructor. The class may not be static.
+
+
+ There must only be at most one class with an
+ within any given assembly.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines a set of assertions that enable a test to verify the expected
+ behavior of the subject under test.
+
+
+
+ Each assertion is generally provided in at least 4 flavors distinguished by overloads:
+
+ - A simple form that takes only the assertion parameters.
+ - A simple form that accepts a custom message format string and arguments in addition to the assertion parameters.
+ - A rich form that takes the assertion parameters and a custom comparer object.
+ - A rich form that accepts a custom message format string and arguments in addition to the assertion parameters and a custom comparer object.
+
+
+
+ The value upon which the assertion is being evaluated is usually called the "actual value".
+ Other parameters for the assertion are given names such as the "expected value", "unexpected value",
+ or other terms as appropriate. In some cases where the role of a parameter is ambiguous,
+ we may use designations such as "left" and "right" to distinguish the parameters.
+
+
+ The Assert class does not provide direct support for old-style collection types such as
+ and . If you are using .Net 3.5 for your test projects, you may find the
+ "Cast" function helpful.
+
+
+ ICollection myOldCollection = subjectUnderTest.DoSomething();
+ Assert.AreElementsEqual(new[] { "a", "b", "c" }, myOldCollection.Cast<string>());
+
+
+
+
+ Framework authors may choose to extend this class with additional assertions by creating
+ a subclass. Alternately, new assertions can be defined in other classes.
+
+
+ When formatting values for inclusion in assertion failures, it is recommended to use the
+ formatter provided by the property instead
+ of directly calling . This enables custom formatting rules to
+ decide how best to present values of particular types and yields a more consistent user experience.
+ In particular the method and
+ its siblings automatically format values in this manner.
+
+
+
+
+
+ Verifies that the specified sequence, collection, or array contains the expected number of elements.
+
+
+
+ The assertion counts the elements according to the underlying type of the sequence.
+
+ - Uses
if the sequence is an array.
+ - Uses
or if the sequence is a collection such as or . It enumerates and counts the elements as well.
+ - Enumerates and counts the elements if the sequence is a simple
.
+
+
+
+ The expected number of elements.
+ The enumeration of elements to count.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is negative.
+ Thrown if is null.
+
+
+
+ Verifies that the specified sequence, collection, or array contains the expected number of elements.
+
+
+
+ The assertion counts the elements according to the underlying type of the sequence.
+
+ - Uses
if the sequence is an array.
+ - Uses
or if the sequence is a collection such as or . It enumerates and counts the elements as well.
+ - Enumerates and counts the elements if the sequence is a simple
.
+
+
+
+ The expected number of elements.
+ The enumeration of elements to count.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is negative.
+ Thrown if is null.
+
+
+
+ Prevents instantiation.
+ Subclasses should likewise define their constructor to be protected.
+
+
+
+
+ Always throws an .
+ Use instead.
+
+
+
+
+ Always throws an .
+ Use instead.
+
+
+
+
+ Signals an unconditional assertion failure.
+
+
+
+ Use and
+ instead when implementing custom assertions.
+
+
+ Thrown unless the current indicates otherwise.
+
+
+
+ Signals an unconditional assertion failure with a particular message.
+
+
+
+ Use and
+ instead when implementing custom assertions.
+
+
+ The format of the assertion failure message.
+ The arguments for the assertion failure message format string.
+ Thrown unless the current indicates otherwise.
+
+
+
+ Terminates the test and reports an inconclusive test outcome.
+
+
+
+ The test is terminated with an inconclusive test outcome by throwing a
+ . If other code in the test case catches
+ this exception and does not rethrow it then the test might not terminate correctly.
+
+
+ Thrown always.
+
+
+
+ Terminates the test and reports an inconclusive test outcome.
+
+
+
+ The test is terminated with an inconclusive test outcome by throwing a
+ . If other code in the test case catches
+ this exception and does not rethrow it then the test might not terminate correctly.
+
+
+ The custom message format string, or null if none.
+ The custom message arguments, or null if none.
+ Thrown always.
+
+
+
+ Terminates the test and reports a specific test outcome.
+
+
+
+ The test is terminated with by throwing a
+ with the specified outcome. If other code in the test case catches
+ this exception and does not rethrow it then the test might not terminate correctly.
+
+
+ The desired test outcome.
+ Thrown always.
+
+
+
+ Terminates the test and reports a specific test outcome.
+
+
+
+ The test is terminated with by throwing a
+ with the specified outcome. If other code in the test case catches
+ this exception and does not rethrow it then the test might not terminate correctly.
+
+
+ The desired test outcome.
+ The custom message format string, or null if none.
+ The custom message arguments, or null if none.
+ Thrown always.
+
+
+
+ Terminates the test silently and reports a specific test outcome.
+
+
+
+ Unlike this method does not report the
+ stack trace. It also does not include a termination reason unless one is explicitly
+ specified by the caller.
+
+
+ The test is terminated with by throwing a
+ with the specified outcome. If other code in the test case catches
+ this exception and does not rethrow it then the test might not terminate correctly.
+
+
+ The desired test outcome.
+ Thrown always.
+
+
+
+ Terminates the test silently and reports a specific test outcome.
+
+
+
+ Unlike this method does not report the
+ stack trace. It also does not include a termination reason unless one is explicitly
+ specified by the caller.
+
+
+ The test is terminated with by throwing a
+ with the specified outcome. If other code in the test case catches
+ this exception and does not rethrow it then the test might not terminate correctly.
+
+
+ The desired test outcome.
+ The custom message format string, or null if none.
+ The custom message arguments, or null if none.
+ Thrown always.
+
+
+
+ Evaluates a block of code that contains multiple related assertions.
+
+
+
+ While the action delegate runs, the behavior of assertions is change such that
+ failures are captured but do not cause a
+ to be throw. When the delegate returns, the previous assertion failure behavior
+ is restored and any captured assertion failures are reported. The net effect
+ of this change is that the test can continue to run even after an assertion failure
+ occurs which can help to provide more information about the problem.
+
+
+ A multiple assertion block is useful for verifying the state of a single
+ component with many parts that require several assertions to check.
+ This feature can accelerate debugging because more diagnostic information
+ become available at once.
+
+
+ The action to invoke.
+ Thrown if is null.
+
+
+
+ Evaluates a block of code that contains multiple related assertions.
+
+
+
+ While the action delegate runs, the behavior of assertions is change such that
+ failures are captured but do not cause a
+ to be throw. When the delegate returns, the previous assertion failure behavior
+ is restored and any captured assertion failures are reported. The net effect
+ of this change is that the test can continue to run even after an assertion failure
+ occurs which can help to provide more information about the problem.
+
+
+ A multiple assertion block is useful for verifying the state of a single
+ component with many parts that require several assertions to check.
+ This feature can accelerate debugging because more diagnostic information
+ become available at once.
+
+
+ The action to invoke.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains some expected value.
+
+
+
+ This assertion will fail if the string is null.
+
+
+ The actual value.
+ The expected substring.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains some expected value.
+
+
+
+ This assertion will fail if the string is null.
+
+
+ The actual value.
+ The expected substring.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain some unexpected substring.
+
+
+
+ This assertion will fail if the string is null.
+
+
+ The actual value.
+ The unexpected substring.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain some unexpected substring.
+
+
+
+ This assertion will fail if the string is null.
+
+
+ The actual value.
+ The unexpected substring.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Asserts that two strings are equal according to a particular string comparison mode.
+
+ The expected value.
+ The actual value.
+ The string comparison type.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Asserts that two strings are equal according to a particular string comparison mode.
+
+ The expected value.
+ The actual value.
+ The string comparison type.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Asserts that two strings are not equal according to a particular string comparison mode.
+
+ The unexpected value.
+ The actual value.
+ The string comparison type.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Asserts that two strings are not equal according to a particular string comparison mode.
+
+ The unexpected value.
+ The actual value.
+ The string comparison type.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a string matches regular expression pattern exactly.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string matches regular expression pattern exactly.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string matches regular expression pattern exactly.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The regular expression options.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string matches regular expression pattern exactly.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The regular expression options.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string matches regular expression pattern exactly.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string matches regular expression pattern exactly.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The regular expression options.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The regular expression options.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string contains a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The regular expression options.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression pattern.
+ The regular expression options.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string does not contain a full or partial match of a regular expression pattern.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The regular expression.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string starts with the specified text.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The expected pattern.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string starts with the specified text.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The expected pattern.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string ends with the specified text.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The expected pattern.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a string ends with the specified text.
+
+
+
+ This assertion will fail if the string is null.
+
+
+
+ The actual value.
+ The expected pattern.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are referentially equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are referentially equal and in the same order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that unexpected and actual sequences differ in at least one element.
+
+ The type of value.
+ The unexpected sequence.
+ The actual sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are referentially equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that expected and actual sequences have the same number of elements and
+ that the elements are referentially equal but perhaps in a different order.
+
+ The type of value.
+ The expected sequence.
+ The actual sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is in the enumeration .
+
+ The type of value.
+ The enumeration of items.
+ The expected value expected to be found in the collection.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is in the enumeration .
+
+ The type of value.
+ The enumeration of items.
+ The expected value expected to be found in the collection.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is in the dictionary .
+
+ The type of key.
+ The type of value.
+ The dictionary of items.
+ The key expected to be found in the dictionary.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is in the dictionary .
+
+ The type of key.
+ The type of value.
+ The dictionary of items.
+ The key expected to be found in the dictionary.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is not in the enumeration .
+
+ The type of value.
+ The enumeration of items.
+ The unexpected value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is not in the enumeration .
+
+ The type of value.
+ The enumeration of items.
+ The unexpected value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is not in the dictionary .
+
+ The type of key.
+ The type of value.
+ The dictionary of items.
+ The key that should not be found in the dictionary.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that is not in the dictionary .
+
+ The type of key.
+ The type of value.
+ The dictionary of items.
+ The key expected to be found in the dictionary.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value contains no elements.
+
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value contains no elements.
+
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value contains at least one element.
+
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value contains at least one element.
+
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that all the elements of the sequence meet the specified condition.
+
+ The type of values in the sequence.
+ The sequence of values to evaluate.
+ The condition that must be fulfilled (returns true ) by all the elements of the sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that all the elements of the sequence meet the specified condition.
+
+ The type of values in the sequence.
+ The sequence of values to evaluate.
+ The condition that must be fulfilled (returns true ) by all the elements of the sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that at least one element of the sequence meets the specified condition.
+
+ The type of values in the sequence.
+ The sequence of values to evaluate.
+ The condition that must be fulfilled (returns true ) by at least one element of the sequence.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that at least one element of the sequence meets the specified condition.
+
+ The type of values in the sequence.
+ The sequence of values to evaluate.
+ The condition that must be fulfilled (returns true ) by at least one element of the sequence.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value equals some expected value.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+
+ Verifies that an actual value equals some expected value.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value equals some expected value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value equals some expected value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value equals some expected value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value equals some expected value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not equal some unexpected value.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not equal some unexpected value.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not equal some unexpected value according to a particular comparer.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not equal some unexpected value according to a particular comparer.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not equal some unexpected value according to a particular comparer.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not equal some unexpected value according to a particular comparer.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is referentially identical to some expected value.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is referentially identical to some expected value.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is not referentially identical to some unexpected value.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is not referentially identical to some unexpected value.
+
+ The type of value.
+ The unexpected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is true.
+
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is true.
+
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is false.
+
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is false.
+
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is null.
+
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is null.
+
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is not null.
+
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is not null.
+
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value approximately equals some expected value
+ to within a specified delta.
+
+
+
+ The values are considered approximately equal if the absolute value of their difference
+ is less than or equal to the delta.
+
+
+ This method works with any comparable type that also supports a subtraction operator
+ including , , ,
+ , (using a delta),
+ and many others.
+
+
+ The type of values to be compared.
+ The type of the difference produced when the values are
+ subtracted, for numeric types this is the same as but it
+ may differ for other types.
+ The expected value.
+ The actual value.
+ The inclusive delta between the values.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value approximately equals some expected value
+ to within a specified delta.
+
+
+
+ The values are considered approximately equal if the absolute value of their difference
+ is less than or equal to the delta.
+
+
+ This method works with any comparable type that also supports a subtraction operator
+ including , , ,
+ , (using a delta),
+ and many others.
+
+
+ The type of values to be compared.
+ The type of the difference produced when the values are
+ subtracted, for numeric types this is the same as but it
+ may differ for other types.
+ The expected value.
+ The actual value.
+ The inclusive delta between the values.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not approximately equal some unexpected value
+ to within a specified delta.
+
+
+
+ The values are considered approximately equal if the absolute value of their difference
+ is less than or equal to the delta.
+
+
+ This method works with any comparable type that also supports a subtraction operator
+ including , , ,
+ , (using a delta),
+ and many others.
+
+
+ The type of values to be compared.
+ The type of the difference produced when the values are
+ subtracted, for numeric types this is the same as but it
+ may differ for other types.
+ The expected value.
+ The actual value.
+ The inclusive delta between the values.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value does not approximately equal some unexpected value
+ to within a specified delta.
+
+
+
+ The values are considered approximately equal if the absolute value of their difference
+ is less than or equal to the delta.
+
+
+ This method works with any comparable type that also supports a subtraction operator
+ including , , ,
+ , (using a delta),
+ and many others.
+
+
+ The type of values to be compared.
+ The type of the difference produced when the values are
+ subtracted, for numeric types this is the same as but it
+ may differ for other types.
+ The expected value.
+ The actual value.
+ The inclusive delta between the values.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception type then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected type of exception.
+ The action delegate to evaluate.
+ The exception that was thrown.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type; and that
+ the exception has an inner exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception types then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected type of exception.
+ The expected type of the inner exception.
+ The action delegate to evaluate.
+ The exception that was thrown.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception type then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected type of exception.
+ The action delegate to evaluate.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ The exception that was thrown.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type; and that
+ the exception has an inner exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception types then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected type of the exception.
+ The expected type of the inner exception.
+ The action delegate to evaluate.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ The exception that was thrown.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception type then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected exception type.
+ The action delegate to evaluate.
+ The exception that was thrown.
+ Thrown if
+ or is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type; and that
+ the exception has an inner exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception types then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected exception type.
+ The expected inner exception type, or null to ignore the inner exception.
+ The action delegate to evaluate.
+ The exception that was thrown.
+ Thrown if
+ or is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception type then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected exception type.
+ The action delegate to evaluate.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ The exception that was thrown.
+ Thrown if
+ or is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code throws an exception of a particular type; and that
+ the exception has an inner exception of a particular type.
+
+
+
+ If the block of code throws a subtype of the expected exception types then
+ this method will still succeed.
+
+
+ This method returns the exception that was caught. To verify additional
+ properties of the exception, such as the exception message, follow up this
+ assertion with additional ones that verify these properties of the exception object
+ that was returned.
+
+
+ The expected exception type.
+ The expected inner exception type, or null to ignore the inner exception.
+ The action delegate to evaluate.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ The exception that was thrown.
+ Thrown if
+ or is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code does not throw an exception of any type.
+
+
+
+ The purpose of this assertion is to improve the readability of tests
+ that only verify that an exception was not thrown. Using this assertion
+ makes a positive and explicit statement that not throwing an exception
+ is itself the primary behavior that is being verified.
+
+
+ The action delegate to evaluate.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a block of code does not throw an exception of any type.
+
+
+
+ The purpose of this assertion is to improve the readability of tests
+ that only verify that an exception was not thrown. Using this assertion
+ makes a positive and explicit statement that not throwing an exception
+ is itself the primary behavior that is being verified.
+
+
+ The action delegate to evaluate.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a type may be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the actual Type.
+ The Type under examination.
+ Thrown if or is null.
+
+
+
+ Verifies that a type may be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the object's Type.
+ The Type under examination.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if or is null.
+
+
+
+ Verifies that a type may be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the object's Type.
+ The object under examination.
+ Thrown if is null.
+
+
+
+ Verifies that a type may be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the object's Type.
+ The Type under examination.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if is null.
+
+
+
+ Verifies that a Type may not be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the object's Type.
+ The Type under examination.
+ Thrown if or is null.
+
+
+
+ Verifies that a Type may not be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the object's Type.
+ The Type under examination.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if or is null.
+
+
+
+ Verifies that a Type may not be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the object's Type.
+ The Type under examination.
+
+
+
+ Verifies that a Type may not be assigned to a variable of the specified type.
+
+
+
+ This assertion will fail if is null.
+
+
+
+ The Type to compare with the object's Type.
+ The Type under examination.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+
+
+
+ Verifies that an actual value is an instance of some expected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The expected type.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that an actual value is an instance of some expected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The expected type.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that an actual value is an instance of some expected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The expected type.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is an instance of some expected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The expected type.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is not an instance of some unexpected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The unexpected type.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that an actual value is not an instance of some unexpected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The unexpected type.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that an actual value is not an instance of some unexpected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The unexpected type.
+ The actual value.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an actual value is not an instance of some unexpected type.
+
+
+
+ This assertion will fail if the object is null.
+
+
+ The unexpected type.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that the left value is greater than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that the left value is greater than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is greater or equal than right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that the left value is less than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+
+
+
+ Verifies that the left value is less than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the left value is less than or equal to the right value according to a particular comparer.
+
+ The type of value.
+ The expected value.
+ The actual value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+
+
+
+ Verifies that a test value is between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is not between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+
+
+
+ Verifies that a test value is not between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is not between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is not between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is not between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a test value is not between left and right values according to a particular comparer.
+
+ The type of value.
+ The actual value.
+ Inclusive minimum value.
+ Inclusive maximum value.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a type supports the runtime serialization protocol.
+
+
+
+ Ensures that the type has the . Also ensures that if it
+ implements then it also has a deserialization constructor with
+ signature .ctor(SerializationInfo info, StreamingContext context).
+
+
+ The type to verify.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a type supports the runtime serialization protocol.
+
+
+
+ Ensures that the type has the . Also ensures that if it
+ implements then it also has a deserialization constructor with
+ signature .ctor(SerializationInfo, StreamingContext).
+
+
+ The type to verify.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that an object can be serialized to a stream using the specified
+ and returns the resulting stream.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The object serialization formatter.
+ The serialized stream.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized to a stream using the specified
+ and returns the resulting stream.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The object serialization formatter.
+ The serialized stream.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be deserialized from a stream using the
+ specified and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The stream to deserialize.
+ The object serialization formatter.
+ The deserialized object.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be deserialized from a stream using the specified
+ and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The stream to deserialize.
+ The object serialization formatter.
+ The deserialized object.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized then deserialized to and from a stream using the
+ specified and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The object serialization formatter.
+ The serialized then deserialized object.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized and deserialized to and from a stream using the
+ specified and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The object serialization formatter.
+ The serialized then deserialized object.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized to a stream using a
+ and returns the resulting stream.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized stream.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized to a stream using a
+ and returns the resulting stream.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized stream.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be deserialized from a stream using a
+ and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The stream to deserialize.
+ The deserialized object.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be deserialized from a stream using a
+ and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The stream to deserialize.
+ The deserialized object.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized then deserialized to and from a stream using a
+ and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized then deserialized object.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized and deserialized to and from a stream using a
+ and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized then deserialized object.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a type supports the Xml serialization protocol used by .
+
+
+
+ Ensures that an for the type can be constructed without error.
+
+
+ The type to verify.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that a type supports the Xml serialization protocol used by .
+
+
+
+ Ensures that an for the type can be constructed without error.
+
+
+ The type to verify.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if is null.
+
+
+
+ Verifies that an object can be serialized to Xml using an
+ and returns the resulting Xml as a string.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized Xml.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized to Xml using
+ an and returns the resulting Xml as a string.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized Xml.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be deserialized from Xml using
+ an and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The Xml.
+ The deserialized object.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be deserialized from Xml using
+ an and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The Xml.
+ The deserialized object.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized then deserialized to and from Xml using
+ an and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized then deserialized object.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that an object can be serialized then deserialized to and from Xml using
+ an and returns the resulting deserialized object.
+
+
+
+ The assertion fails if is null.
+
+
+ The value.
+ The serialized then deserialized object.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of values are sorted in the specified order.
+
+ The type of value.
+ The sequence of values to be tested.
+ The expected sort order.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of values are sorted in the specified order.
+
+ The type of value.
+ The sequence of values to be tested.
+ The expected sort order.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of values are sorted in the specified order.
+
+ The type of value.
+ The sequence of values to be tested.
+ The expected sort order.
+ A comparer instance to be used to compare two elements of the sequence, or null to use a default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of values are sorted in the specified order.
+
+ The type of value.
+ The sequence of values to be tested.
+ The expected sort order.
+ A comparer instance to be used to compare two elements of the sequence, or null to use a default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of values are sorted in the specified order.
+
+ The type of value.
+ The sequence of values to be tested.
+ The expected sort order.
+ A comparison function to be used to compare two elements of the sequence, or null to use a default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of values are sorted in the specified order.
+
+ The type of value.
+ The sequence of values to be tested.
+ The expected sort order.
+ A comparison function to be used to compare two elements of the sequence, or null to use a default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of objects contains distinct values.
+
+ The type of value.
+ The sequence of values to be tested.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of objects contains distinct values.
+
+ The type of value.
+ The sequence of values to be tested.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of objects contains distinct values.
+
+ The type of value.
+ The sequence of values to be tested.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of objects contains distinct values.
+
+ The type of value.
+ The sequence of values to be tested.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of objects contains distinct values.
+
+ The type of value.
+ The sequence of values to be tested.
+ The comparer to use, or null to use the default one.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that the sequence of objects contains distinct values.
+
+ The type of value.
+ The sequence of values to be tested.
+ The comparer to use, or null to use the default one.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Provides methods for composing assertions to map over complex data structures.
+
+
+
+
+ Returns true if there is a pending unreported assertion failure.
+
+
+
+ This property is used in conjuction with the
+ feature to determine whether there is a pending assertion failure yet
+ to be reported within a multiple-assertion block.
+
+
+
+
+
+ Assertions for XML data.
+
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ A reader to get the expected XML fragment.
+ A reader to get the actual XML fragment.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if or is null.
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ A reader to get the expected XML fragment.
+ A reader to get the actual XML fragment.
+ Equality options.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ A reader to get the expected XML fragment.
+ A reader to get the actual XML fragment.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if or is null.
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ A reader to get the expected XML fragment.
+ A reader to get the actual XML fragment.
+ Equality options.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ The expected XML fragment.
+ The actual XML fragment.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if or is null.
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ The expected XML fragment.
+ The actual XML fragment.
+ Equality options.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ The expected XML fragment.
+ The actual XML fragment.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if or is null.
+
+
+
+ Asserts that two XML fragments have the same content.
+
+ The expected XML fragment.
+ The actual XML fragment.
+ Equality options.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that it has the expected value.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that it has the expected value.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that it has the expected value.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ The expected value of the searched item (element or attribute).
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+ Thrown if , , or is null.
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute.
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that it has the expected value.
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+ If is set to null , the assertion behaves like .
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that it has the expected value.
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ The expected value of the searched item (element or attribute).
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+ If is set to null , the assertion behaves like .
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that it has the expected value.
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+ If is set to null , the assertion behaves like .
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that it has the expected value.
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+ If is set to null , the assertion behaves like .
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The path specified in should start with a slash character ('/').
+ Elements must be separated by a slash, and attributes denoted by a colon (':').
+
+
+ Assuming the following XML fragment exits:
+
+
+
+
+
+
+ ]]>
+
+ The following path would be valid:
+
+
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, and that this element or attribute is unique in the entire fragment.
+
+
+
+ Options not related to the name case of elements and attributes are going to be ignored.
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ A reader to get the actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ The expected value of the searched item (element or attribute).
+ Options for the search.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ Asserts that the XML fragment contains the searched element or attribute, that it has the expected value, and that this element or attribute is unique in the entire fragment.
+
+
+
+ If is set to null , the assertion behaves like .
+
+
+ The actual XML fragment.
+ The path of the searched element or attribute in the XML fragment.
+ Options for the search.
+ The expected value of the searched item (element or attribute).
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+ Thrown if , , or is null.
+
+
+
+ The bind attribute overrides the default binding rules for a test parameter
+ by specifying a different data source, a binding path or an index.
+
+
+
+ At most one such attribute may appear on any given test parameter.
+
+
+ The bind attribute supports more complex data binding binding scenarios.
+ For example, in a typical use of , the binding
+ of test parameters to CSV columns is performed by name and by position.
+ This assumes that the CSV file either contains a header with columns that
+ are named the same as the test parameter or that the columns appear in the
+ same order as the test parameters. Should this not be the case, we may
+ apply the to the test parameter to specify
+ an explicit column name (by setting the path) or column position (by
+ setting the index).
+
+
+
+
+
+ Sets the binding path for the associated test parameter.
+
+ The binding path.
+ Thrown if is null.
+
+
+
+ Sets the binding index for the associated test parameter.
+
+ The binding index.
+
+
+
+
+
+
+ Gets or sets the name of the data source to bind, or null to bind
+ the default data source for the test parameter.
+
+
+
+ The default source for a test parameter is the anonymous data source defined
+ within the scope of the test parameter or by its enclosing test.
+
+
+
+
+
+ Gets the binding path, or null if none.
+
+
+
+
+ Gets the binding index, or null if none.
+
+
+
+
+ Provides a column of literal values as a data source.
+
+
+
+ This attribute is a compact equivalent to providing a sequence of values
+ using with 1 element in each. It is particularly
+ useful for specifying combinatorial tests.
+
+
+ By default, the column provided by the column data source is unnamed.
+ Use to provide an explicit name for the column.
+
+
+
+
+
+
+
+ An abstract base class for MbUnit attributes that contribute values to data sources
+ along with metadata such a description or expected exception type.
+
+
+
+ You may define a new data source by creating a subclass of this attribute
+ and overriding .
+
+
+ for more information about data binding attributes in general.
+
+
+
+ Gets the metadata for the data source.
+
+ The metadata keys and values.
+
+
+
+ Gets or sets a description of the values provided by the data source.
+
+
+
+
+ Gets or sets the type of exception that should be thrown when the
+ values provided by the data source are consumed by test.
+
+
+
+
+ Gets or sets the message of the exception that should be thrown when the
+ values provided by the data source are consumed by test.
+ May be a substring of the actual exception message.
+
+
+
+
+ Adds a column of literal values.
+
+
+
+ There exist two ambiguities in the use of this attribute that
+ result from how the C# compiler handles functions that accept
+ a variable number of arguments.
+
+
+ Case 1: If there is only 1 argument and its value is null , the
+ compiler will pass a null array reference to the attribute constructor.
+ Since the value array cannot be null, the attribute will assume that
+ you meant to create an array consiting of a single null .
+
+
+
+ Case 2: If there is only 1 argument and its value is an object array, the
+ compiler will pass the array itself as the argument values. Unfortunately,
+ the attribute constructor cannot distinguish this case from the usual case
+ when multiple arguments are present. So you need to disambiguate this case
+ explicitly.
+
+
+
+ To fix this case, you must provide explicit disambiguation.
+ (We cannot do it automatically based on the number of method parameters provided
+ because the row attribute can be applied to other elements besides methods and
+ its contents might be consumed in other ways.)
+
+
+
+ The array of values in the column.
+
+
+
+
+
+
+ Gets the array of values in the column.
+
+
+
+
+ Sets the join strategy of a test to be combinatorial.
+
+
+
+ The test will be executed using all possible combinations of values from each data source.
+
+
+ If there are two data sources, A and B with values A1, A2, B1 and B2, then the test will
+ be run four times with inputs: (A1, B1), (A1, B2), (A2, B1) and (A2, B2).
+
+
+ This is the default join strategy for tests. So you do not need to specify this attribute
+ unless you want to be explicit about selecting it.
+
+
+
+
+
+
+
+
+ An abstract class for attributes that specify the join strategy of a test.
+
+
+
+ You may define a new join strategy by creating a subclass of this attribute
+ and overriding .
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The code element.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Gets the join strategy to use.
+
+ The join strategy.
+
+
+
+
+
+
+ A map that stores the occurences of hash code values and computes various statistical data.
+
+
+
+
+ Constructs a map from the specified hash codes.
+
+ An enumeration of hash codes.
+
+
+
+ Gets the results of the analysis.
+
+
+
+
+ Simple container for hash code stochastic analysis results.
+
+
+
+
+ Constructor.
+
+ The total number of hash codes used to perform the analysis.
+ The probability that two values randomly chosen have the same hash code.
+ The probability of deviation from a uniform distribution.
+
+
+
+ Gets the total number of hash codes used to perform the analysis.
+
+
+
+
+ Gets the probability that two values randomly chosen have the same hash code.
+
+
+
+
+ Gets the probability of deviation from a uniform distribution.
+
+
+
+
+ Contract for verifying the efficiency of the hash code generation algorithm for a given type.
+
+
+
+ Built-in verifications:
+
+ -
+
CollisionProbabilityTest : The probability of hash code collision for the specified set of instances
+ is less than the specified limit.
+
+ -
+
UniformDistributionTest : The probability of deviation from uniform distribution is less than
+ the specified limit.
+
+
+
+
+
+ The following examples shows a simple class that overrides the method, and
+ the test which verifies that the algorithm is resistant to hash code collision against the specified set of
+ distinct values.
+
+ {
+ CollisionProbabilityLimit = CollisionProbability.VeryLow,
+ UniformDistributionQuality = UniformDistributionQuality.Excellent,
+ DistinctInstances = GetDistinctInstances();
+ };
+
+ private static IEnumerable GetDistinctInstances()
+ {
+ for(int i=0; i<1000; i++)
+ for(int j=0; j<1000; j++)
+ yield return new Foo(i, j);
+ }
+ }
+ ]]>
+
+ The type of the object for which the hash code generation must be evaluated.
+
+
+
+ Abstract base class for contracts.
+
+
+
+
+ Describes a contract that can be verified.
+
+
+
+ Contracts can be composed together into more complex forms by combining their
+ lists of verification tests to create test suites. This enables the implementation
+ of one contract to leverage that of another.
+
+
+
+
+
+
+ Gets an enumeration of test cases whose purpose is to verify the contract.
+
+ The context of execution.
+ An enumeration of tests.
+
+
+
+
+
+
+ Gets an enumeration of test cases whose purpose is to verify the contract.
+
+ An enumeration of tests.
+
+
+
+ Gets the interface of a particular type if it is implemented by another type,
+ otherwise returns null.
+
+ The implementation type.
+ The interface type.
+ The interface type or null if it is not implemented by the implementation type.
+
+
+
+ Verifies that the specified method info object is not null, indicating that the
+ method exists, otherwise raises an assertion failure and describes the expected method signature.
+
+ The method, or null if missing.
+ The expected method signature for diagnostic output.
+
+
+
+ Gets the execution context.
+
+
+
+
+ Constructs a contract verifier to evaluate the efficiency of the hash code generation algorithm for a given type.
+
+
+
+
+
+
+
+ Gets or sets the maximum collision probability tolerated.
+
+
+
+ If the actual probability calculated from the specified distinct instances is greater
+ than this limit, the test will fail.
+
+
+ The default is 0.01 (1%).
+
+
+
+
+
+ Gets or sets the required significance level to determine whether the distribution is uniform.
+
+
+
+ If the actual probability calculated from the specified distinct instances is greater than
+ the specified value, the test fails.
+
+
+ The default is 0.05 (5%).
+
+
+
+
+
+ Gets or sets an enumeration of distinct instances to extract the hash code from.
+
+
+
+
+ A list of common limits for the collision probability.
+
+
+
+
+
+ No collision allowed (0%)
+
+
+
+
+ Represents a very low probability of collision (less than 1%)
+
+
+
+
+ Represents a low probability of collision (less than 5%)
+
+
+
+
+ Represents a reasonable probability of collision (less than 10%)
+
+
+
+
+ Represents a mediocre probability of collision (less than 30%)
+
+
+
+
+ A list of common limits for the uniform distribution significance level.
+
+
+
+
+
+ Nearly uniform (less than 1% of deviation probability)
+
+
+
+
+ Characterizes a roughly uniform distribution (less than 5% of deviation probability)
+
+
+
+
+ Characterizes a reasonably uniform distribution (less than 10% of deviation probability)
+
+
+
+
+ Characterizes a poor uniform distribution (less than 30% of deviation probability)
+
+
+
+
+ Contains a collection of equivalent object instances.
+
+
+
+ All the elements of the collection should be equal together, in
+ the sense of the local implementation of an equality contract
+ ( ) or a comparison contract
+ ( ).
+
+
+ Equivalence classes are used by some contract verifiers such as
+ to check for
+ the correct implementation of object equality or comparison.
+
+
+ The type of equivalent object instances.
+
+
+
+ Constructs a class of equivalent instances.
+
+
+
+ All the elements of the collection should be equal together, in
+ the sense of the local implementation of an equality contract
+ ( ) or a comparison contract
+ ( ).
+
+
+ The type of equivalent object instances.
+
+
+
+ Returns a strongly-typed enumerator that iterates through the collection.
+
+ A strongly-typed enumerator.
+
+
+
+ Gets the collection of equivalent instances.
+
+
+
+
+ A collection of equivalence classes.
+
+
+
+ Equivalent classes are used by some contract verifiers such as
+ and
+ to check for the correct implementation of object equality or comparison.
+
+
+ Use the default constructor followed by a list initializer to create a
+ collection of equivalence classes which contains a variable number of object instances.
+
+ {
+ { new Foo(1), new Foo("One") },
+ { new Foo(2), new Foo("Two") },
+ { new Foo(3), new Foo("Three") }
+ };
+ ]]>
+
+
+ Use the single-parameter constructor to create a collection of equivalence classes
+ which contains one single object instance each.
+ (new Foo(1), new Foo(2), new Foo(3));
+ ]]>
+
+
+ The type of equivalent object instances.
+
+
+
+ Constructs an empty collection of equivalence classes.
+
+
+
+
+ Constructs a collection of equivalence classes from the specified distinct object instances.
+
+
+
+ The resulting collection contains as many equivalence class as provided instances. Each equivalence
+ class contains one single object. To construct a collection with equivalence classes containing
+ several equivalent instances, use preferably the default constructor followed by a list initializer.
+
+
+
+
+ {
+ { new Foo(1), new Foo("One") },
+ { new Foo(2), new Foo("Two") },
+ { new Foo(3), new Foo("Three") }
+ };
+ ]]>
+
+ An enumeration of distinct instances.
+
+
+
+ Adds to the collection a new equivalence class which contains the specified objects.
+
+ An array of equivalent instances.
+
+
+
+ Returns a strongly-typed enumerator that iterates through the collection.
+
+ A strongly-typed enumerator.
+
+
+
+ Gets the equivalence classes.
+
+
+
+
+ Helper methods to quickly combine and generate random or constrained values for data-driven tests.
+
+
+ Helper methods to quickly combine and generate random or constrained values for data-driven tests.
+
+
+ Helper methods to quickly combine and generate random or constrained values for data-driven tests.
+
+
+
+
+ Joins the two specified enumerations of values into a single enumeration of paired values
+ by applying the default combinatorial join strategy.
+
+ The type of the values in the first enumeration.
+ The type of the values in the first enumeration.
+ The first enumeration of values.
+ The second enumeration of values.
+ The resulting enumeration of paired values.
+ Thrown if or is null.
+
+
+
+
+
+ Joins the two specified enumerations of values into a single enumeration of paired values
+ by applying the specified join strategy.
+
+ The type of the values in the first enumeration.
+ The type of the values in the first enumeration.
+ The first enumeration of values.
+ The second enumeration of values.
+ The join strategy to use.
+ The resulting enumeration of paired values.
+ Thrown if or is null.
+
+
+
+
+
+
+
+ Joins the three specified enumerations of values into a single enumeration of triplet values
+ by applying the default combinatorial join strategy.
+
+ The type of the values in the first enumeration.
+ The type of the values in the second enumeration.
+ The type of the values in the third enumeration.
+ The first enumeration of values.
+ The second enumeration of values.
+ The third enumeration of values.
+ The resulting enumeration of triplet values.
+ Thrown if , , or is null.
+
+
+
+
+
+ Joins the two specified enumerations of values into a single enumeration of triplet values
+ by applying the specified join strategy.
+
+ The type of the values in the first enumeration.
+ The type of the values in the second enumeration.
+ The type of the values in the third enumeration.
+ The first enumeration of values.
+ The second enumeration of values.
+ The third enumeration of values.
+ The join strategy to use.
+ The resulting enumeration of triplet values.
+ Thrown if , , or is null.
+
+
+
+
+
+
+
+ Joins the two specified enumerations of values into a single enumeration of paired values
+ by applying the default combinatorial join strategy.
+
+ An array of enumerations of values.
+ The resulting enumeration of combined values in arrays.
+ Thrown if is null.
+
+
+
+
+
+ Joins the two specified enumerations of values into a single enumeration of paired values
+ by applying the specified join strategy.
+
+ The join strategy to use.
+ An array of enumerations of values.
+ The resulting enumeration of paired values.
+ Thrown if is null.
+
+
+
+
+
+
+
+ Generates random values.
+
+
+
+
+ Returns the an enumeration of random numbers.
+
+ The number of strings to generate.
+ The lower bound of the range.
+ The upper bound of the range.
+ An enumeration of random number values.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Returns the an enumeration of random numbers.
+
+ The number of strings to generate.
+ The lower bound of the range.
+ The upper bound of the range.
+ An enumeration of random number values.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Returns the an enumeration of random numbers.
+
+ The number of strings to generate.
+ The lower bound of the range.
+ The upper bound of the range.
+ An enumeration of random number values.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Returns an enumeration of random strings based on a regular expression filter.
+
+ The number of strings to generate.
+ The regular expression filter.
+ An enumeration of random string values.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Returns an enumeration of random strings from a pre-existing stock of values.
+
+ The number of strings to generate.
+ A stock of preset values.
+ An enumeration of random string values.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Generates sequential values.
+
+
+
+
+ Generates a linear sequence of numbers, with a step of 1.
+
+ The first value of the sequence.
+ The last value of the sequence.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Generates a linear sequence of numbers, with a step of 1.
+
+ The first value of the sequence.
+ The last value of the sequence.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Generates a linear sequence of numbers, with a step of 1.
+
+ The first value of the sequence.
+ The last value of the sequence.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Generates a linear sequence of numbers.
+
+ The first value of the sequence.
+ The last value of the sequence.
+ The step between each consecutive value.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Generates a linear sequence of numbers.
+
+ The first value of the sequence.
+ The last value of the sequence.
+ The step between each consecutive value.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Generates a linear sequence of numbers.
+
+ The first value of the sequence.
+ The last value of the sequence.
+ The step between each consecutive value.
+ Thrown if the specified parameters are inconsistent or invalid.
+
+
+
+ Provides data from Comma Separated Values (CSV) contents.
+
+
+
+ If the CSV document has a header,
+ then it is interpreted as the names of the columns. Columns with names in brackets, such as "[ExpectedException]",
+ are interpreted as containing metadata values associated with the named key.
+
+
+
+
+ This example reads data from an Embedded Resource called Data.csv within the
+ same namespace as the test fixture.
+
+
+ Data files:
+
+
+
+ A simple test.
+
+
+
+
+
+
+
+ An abstract base class for data source attributes that obtain contents from
+ a local file, manifest resource, or inline data.
+
+
+
+ At most one location type may be used.
+
+
+
+
+
+ Default constructor.
+
+
+
+
+ Gets the name of the location that is providing the data, or null if none.
+
+
+
+ The name will be the filename or resource path if specified, or a special
+ locale-aware string (such as "<inline>") if the contents were specified
+ inline via the property.
+
+
+
+
+
+ Opens the contents as a stream.
+
+
+
+ If you override this method to return data from a different stream, consider
+ also overriding in case the manner in which the
+ data source location is specified has also changed.
+
+
+ The code element to which the attribute was applied.
+ The stream.
+
+
+
+ Opens the contents as a text reader.
+
+
+
+ If you override this method to return data from a different stream, consider
+ also overriding in case the manner in which the
+ data source location is specified has also changed.
+
+
+ The code element to which the attribute was applied.
+ The text reader.
+
+
+
+
+
+
+ Validates the data source properties of the content attribute.
+
+
+
+ Throws a if none of the source
+ properties, such as , or
+ have been set.
+
+
+ The pattern scope.
+ The code element to which the attribute was applied.
+ Thrown if none of the source properties, such as ,
+ or have been set.
+
+
+
+ Gets or sets the inline data contents as a string.
+
+
+
+ It is an error to specify more than one content source property.
+
+
+
+
+
+ Gets or sets the path of a local file relative to the current working
+ directory from which the file contents should be read.
+
+
+
+ It is an error to specify more than one content source property.
+
+
+
+
+
+ Gets or sets a that is used to locate the assembly and
+ namespace within which to resolve a manifest resource in combination
+ with the property.
+
+
+
+ If no value is specified, the test fixture type is used as the resource scope.
+
+
+
+
+
+
+ Gets or sets the path of a manifest resource from which the contents should be read.
+
+
+
+ The path will be resolved within the assembly containing the
+ type or the test fixture type if none if provided.
+
+
+ During resolution, a resource name is constructed from the resource path by
+ translating backslashes to periods. If the named resource is found within
+ the scoped assembly manifest, it is used. Otherwise, the name is prepended
+ with the scoped type's namespace and second lookup is attempted. If this
+ final attempt fails, then an error is raised at runtime.
+
+
+ Examples:
+
+ - If the
is MyNamespace.MyType within
+ assembly MyAssembly.dll and if is "Resources\Image.gif" , then
+ resolution will first check whether Resources.Image.gif in
+ MyAssembly.dll is a valid resource. If not found, it will consider
+ MyNamespace.Resources.Image.gif . If still not found, then a runtime error will be raised.
+ - If no
is provided, then the containing test fixture type
+ will be used as the resource scope. The above resolution strategy still applies.
+
+
+
+ It is an error to specify more than one content source property.
+
+
+
+
+
+
+ Gets or sets the outcome of the test when an error occured
+ while opening or reading the data file or the resource.
+
+
+
+ The default outcome is .
+
+
+
+
+
+ Returns true if the contents are dynamic, or false if they are static.
+
+
+
+ Static contents can only change if the test assembly is recompiled.
+
+
+
+
+
+ Constructs a Comma Separated Values (CSV) contents attribute.
+
+
+
+
+
+
+
+ Gets or sets the field delimiter character.
+
+
+ The default value is ',' (comma).
+
+
+
+
+ Gets or sets a character that indicates that a line in the source represents a comment.
+
+
+
+ May be set to '\0' (null) to disable comment handling.
+
+
+ Comment lines are excluded from the record set.
+
+
+
+ The default value is '#' (pound).
+
+
+
+
+ Gets or sets whether the CSV document has a header that should be used to provide
+ aliases for indexed columns.
+
+
+ The default value is false which indicates that the file does not have a header.
+
+
+
+
+ Creates a dependency from this test assembly, test fixture or test method on some other test
+ fixture or test method.
+
+
+
+ If the other test fixture or test method fails then this test
+ will not run. Moreover, the dependency forces this test to run after those
+ it depends upon.
+
+
+ This attribute can be repeated multiple times if there are multiple dependencies.
+
+
+
+
+
+ Creates a dependency from this test on another test fixture.
+
+ The dependent test fixture type.
+ Thrown if is null.
+
+
+
+ Creates a dependency from this test on a particular test method within another test fixture.
+
+ The dependent test fixture type.
+ The dependent test method name.
+ Thrown if or is null.
+
+
+
+ Creates a dependency from this test on another test method within this test fixture.
+
+ The dependent test method name.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the dependent test fixture type, or null if the dependency is on another
+ test method of this test fixture.
+
+
+
+
+ Gets the dependent test method name, or null if the dependency
+ is on the whole test fixture.
+
+
+
+
+ Indicates that a test should only be run explicitly.
+
+
+
+ The test will still appear in the test tree but it will not run and it will not appear
+ in the test results unless it is explicitly selected for execution.
+
+
+ A test is considered to be explicitly selected when the filter used to run the tests
+ matches the test or its descendants but none of its ancestors. For example, if the filter
+ matches a test case but not its containing test fixture then the test case will be deemed
+ to be explicitly selected. Otherwise the test case will be implicitly selected by virtue
+ of the fact that the filter matched one of its ancestors.
+
+
+ This attribute can be used to exclude from normal execution any tests that are
+ particularly expensive or require manual supervision by an operator.
+
+
+
+
+
+ Indicates that this test should only run explicitly without providing a reason.
+
+
+
+
+ Indicates that this test should only run explicitly and provides a reason.
+
+ The reason for which the test should be run explicitly.
+ Thrown if
+ is null.
+
+
+
+
+
+
+ Gets the reason that the test should only run explicitly.
+
+
+
+
+ Determines the outcome of data-driven test when an error occured while
+ opening or reading the external data file or resource.
+
+
+
+
+ The test is skipped on file error.
+
+
+
+
+
+ The test is inconclusive on file error.
+
+
+
+
+
+ The test failed on file error.
+
+
+
+
+
+
+ Specifies a factory member that will provide values for a data-driven test.
+
+
+
+ The factory may be an instance or static member of the fixture class or a
+ static member of some other class.
+
+
+ Refer to and
+ for more information about how the factory data set works and the kinds of
+ factories that are supported.
+
+
+
+
+
+ Specifies the name of a method, property or field of the fixture
+ class that will provide values for a data-driven test.
+
+
+
+ The factory member must return an enumeration of values ( ).
+
+
+ The factory member may be non-static if it will be used within the
+ scope of an initialized fixture. Typically this is the case for factory
+ members referenced by non-static test methods.
+
+
+ The factory member name.
+ Thrown if is null.
+
+
+
+
+ Specifies the declaring type and name of a static method, property or field
+ that will provide values for a data-driven test.
+
+
+
+ The factory member must return an enumeration of values ( ).
+
+
+ The declaring type of the factory.
+ The factory member name.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+
+ Gets the declaring type of the factory, or null if it is assumed to be the fixture class.
+
+
+
+
+ Gets the factory member name, never null.
+
+
+
+
+ Gets or sets the kind of the factory.
+
+
+
+ Defaults to .
+
+
+ The kind of the factory.
+
+
+
+ Gets or sets the number of columns produced by the factory, or 0 if unknown.
+
+
+
+ Defaults to 0.
+
+
+ The number of columns
+ Thrown if is
+ less than zero.
+
+
+
+ Defines names as aliases for the columns in an indexed data source
+ such as those that have been populated by or .
+
+
+
+ The names may subsequently be used in data binding expressions in place
+ of their corresponding column indices.
+
+
+
+
+
+
+
+
+
+
+ Defines names as aliases for the columns in an indexed data source.
+
+ The names of the columns in the data source in order by index.
+ Thrown if or
+ if one of the values it contains is null.
+
+
+
+
+
+
+ Gets the array of column names.
+
+
+
+
+ Specifies a method that is to be invoked after a fixture instance has been
+ created to complete its initialization before test fixture setup runs.
+
+
+
+ This attribute provides a mechanism for completing the initialization
+ of a fixture if the work cannot be completed entirely within the
+ constructor. For example, data binding might be used to set fields
+ and property values of the fixture instance. Consequently post-construction
+ initialization may be required.
+
+
+ allows initialization to occur
+ earlier in the test lifecycle than .
+
+
+ The attribute may be applied to multiple methods within a fixture, however
+ the order in which they are processed is undefined.
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class and must not have any parameters. The method may be static.
+
+
+
+
+
+
+
+
+
+
+
+ Specifies options for the operation.
+
+
+
+
+
+ Specifies the maximum number of evaluation attempts, before the , or
+ operation fails.
+
+
+
+ If not specified, the condition will be evaluated an infinite number of times, or until some
+ other stop criterion is reached.
+
+
+ The maximum number of evaluation cycles, or zero or a negative value to specify an unlimited number of attempts.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+
+
+
+ Specifies a polling time expressed in milliseconds between each consecutive evaluation of the condition.
+
+
+
+ If not specified, the default polling time is zero; which causes the condition to be evaluated as fast as possible, with
+ only a brief suspension of the current thread ( ).
+
+
+ The polling time expressed in milliseconds.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+ Thrown if is negative.
+
+
+
+ Specifies a polling time between each consecutive evaluation of the condition.
+
+
+
+ If not specified, the default polling time is zero; which causes the condition to be evaluated as fast as possible, with
+ only a brief suspension of the current thread ( ).
+
+
+ The polling time.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+ Thrown if represents a negative duration.
+
+
+
+ Specifies a timeout value expressed in milliseconds.
+
+
+
+ The retry operation fails if the overall duration exceeds the specified timeout value.
+
+
+ If not specified, the default timeout value is set to 10 seconds.
+
+
+ The timeout value expressed in milliseconds, or a negative value to specify no timeout value.
+ A value of zero, will let the condition to be evaluated only once.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+
+
+
+ Specifies a timeout value.
+
+
+
+ The retry operation fails if the overall duration exceeds the specified timeout value.
+
+
+ If not specified, the default timeout value is set to 10 seconds.
+
+
+ The timeout value, or a negative value to specify no timeout value.
+ A value of zero, will let the condition to be evaluated only once.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+
+
+
+ Specifies a custom action to be executed between each consecutive attempt, but not before the first one.
+
+ A custom action to be executed.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+ Thrown if is null.
+
+
+
+ Specifies a custom formatted message to be added to the text of the assertion raised when
+ the retry operation has failed.
+
+ A user-supplied assertion failure message string, or null if none.
+ The format arguments, or null or empty if none.
+
+
+
+
+ Specifies the condition to evaluate repeatedly, and starts the entire operation.
+
+
+
+ The condition is considered fulfilled when it returns true.
+
+
+ The condition to evaluate.
+ Thrown when the condition is false, and a timeout occured, or the maximum
+ number of evaluation attempts was reached.
+
+
+
+ Specifies a instance to wait for being signaled, and starts the entire operation.
+
+ The wait handle to evaluate.
+ Thrown when the wait handle is unsignaled, and a timeout occured, or the maximum
+ number of evaluation attempts was reached.
+
+
+
+
+ Specifies a instance to wait for being terminated, and starts the entire operation.
+
+ The thread to evaluate.
+ Thrown when the thread is still alive, and a timeout occured, or the maximum
+ number of evaluation attempts was reached.
+
+
+
+
+ Defines a strategy for joining data.
+
+
+
+
+
+
+
+
+
+ Combinatorial join strategy.
+
+
+
+
+
+ Sequential join strategy.
+
+
+
+
+
+ Pairwise join strategy.
+
+
+
+
+
+ A mirror uses reflection to provide access to non-public members of an object
+ or type for testing purposes.
+
+
+
+ Writing tests that require access to non-public members is not recommended.
+ Non-public members should be considered internal implementation details of
+ the subject under test. Relying on their behavior can yield brittle tests.
+
+
+ These reflection helpers are not intended to assist with all possible reflection
+ scenarios. For everything else, use the standard .Net reflection library.
+
+
+ Another useful function related to is
+ which you can use to convert a delegate from one type to another. This is useful
+ for creating instances of non-public delegate types. In particular, the
+ method automatically coerces delegates
+ if needed.
+
+
+
+
+ In this example, we use a to access non-public members
+ of an object and static members of an internal class.
+
+
+ // A sample object with various members including a private nested class
+ // that has a public yet inaccessible static method.
+ public class SampleObject
+ {
+ private int privateField;
+ private int PrivateProperty { get; set;}
+ private event EventHandler PrivateEvent;
+ private int PrivateMethod(int a, int b) { ... }
+
+ private static class PrivateNestedClass
+ {
+ public int StaticMethod(object y) { ... }
+
+ public int OverloadedMethod(object y) { ... }
+
+ public int OverloadedMethod(string y) { ... }
+
+ public T GenericMethod<T>(T x) { ... }
+ }
+ }
+
+ internal class InternalObject { ... }
+
+ internal delegate int InternalDelegate(InternalObject x);
+
+ // A sample test fixture.
+ public class Fixture
+ {
+ [Test]
+ public void Test()
+ {
+ // Setup.
+ SampleObject obj = new SampleObject();
+ Mirror objMirror = Mirror.ForObject(obj);
+
+ // Reading from a private field.
+ int privateFieldValue = (int) objMirror["privateField"].Value;
+
+ // Writing to a private property.
+ objMirror["PrivateProperty"].Value = 42;
+
+ // Obtaining a mirror for a value at index 5 in a private indexed property.
+ Mirror valueMirror = objMirror["Item"][5].ValueAsMirror;
+
+ // Invoking a private method.
+ int result = (int) objMirror["PrivateMethod"].Invoke(1, 2);
+
+ // Accessing a private type.
+ Type privateNestedClass = objMirror["PrivateNestedClass"].Type;
+ Mirror privateNestedClassMirror = Mirror.ForType(privateNestedClass);
+
+ // Invoking a static method.
+ int result2 = privateNestedClassMirror["StaticMethod"].Invoke(42);
+
+ // Invoking an overloaded static method when we cannot determine the parameter
+ // type automatically from the arguments, such as when an argument is null.
+ int result2 = privateNestedClassMirror["OverloadedMethod"].WithSignature(typeof(object)).Invoke(null);
+ int result3 = privateNestedClassMirror["OverloadedMethod"].WithSignature(typeof(string)).Invoke(null);
+
+ // Invoking a generic method.
+ int result3 = privateNestedClassMirror["GenericMethod"].Invoke(42);
+
+ // Invoking a generic method using specific type arguments.
+ object result4 = privateNestedClassMirror["GenericMethod"].WithTypeArgs(typeof(object)).Invoke(42);
+
+ // Creating an instance of an internal object.
+ Mirror internalObjTypeMirror = Mirror.ForType("My.Namespace.InternalObject", "MyAssembly");
+ object internalObj = internalObjTypeMirror.CreateInstance();
+
+ // Creating an instance of an internal delegate.
+ // Notice that the Mirror automatically adapts the provided delegate signature
+ // to the actual delegate signature to make it easier to write tests when the delegate
+ // parameter or result types are themselves inaccessible.
+ Mirror internalDelegateTypeMirror = Mirror.ForType("My.Namespace.InternalDelegate", "MyAssembly");
+ Delegate internalDelegate = internalDelegateTypeMirror.CreateDelegate(
+ new Func<object, int>(x => { return 5; }));
+ }
+ }
+
+
+
+
+
+ Gets an instance of a mirror that represents a null object of unknown type.
+
+
+
+
+ Creates a mirror for the specified type.
+
+ The type.
+ The new mirror.
+
+
+
+ Creates a mirror for the specified type.
+
+ The type.
+ The new mirror.
+ Thrown if is null.
+
+
+
+ Creates a mirror for the specified type by assembly-qualified name.
+
+ The assembly-qualified type name. If the type is in the
+ currently executing assembly or in mscorlib.dll it is sufficient to provide
+ the namespace-qualified type name.
+ The new mirror.
+ Thrown if is null.
+ Thrown if the type is not found.
+
+
+
+ Creates a mirror for the specified type by namespace-qualified name and assembly.
+
+ The namespace-qualified type name.
+ The assembly.
+ The new mirror.
+ Thrown if or is null.
+ Thrown if the type is not found.
+
+
+
+ Creates a mirror for the specified type by namespace-qualified name and assembly name.
+
+ The namespace-qualified type name.
+ The assembly name.
+ The new mirror.
+ Thrown if or is null.
+ Thrown if the type is not found.
+
+
+
+ Creates a mirror for the specified object.
+
+ The object instance, or null.
+ The new mirror.
+ Thrown if is null.
+
+
+
+ Returns true if the mirror represents a null object.
+
+
+
+
+ Returns true if the mirror represents a null object of unknown type.
+
+
+
+
+ Gets the reflected type seen in the mirror, or null if the mirror represents a null
+ object of unknown type.
+
+
+
+
+ Gets the object instance seen in the mirror, or null if the mirror does not represent
+ a particular instance of a type.
+
+
+
+
+ Gets an object that can access the mirror type's members with the specified name.
+
+
+
+ If there are no members with the specified name, the member set will be
+ empty and all operations performed on it will fail. If there are multiple
+ members with the specified name (when the name is overloaded), the member set
+ will refer to multiple members. When an operation is performed on the
+ member set, a specific member will chosen from the set or an error will
+ be emitted.
+
+
+ The member name.
+ The member set that represents the mirror type's members with the specified name.
+ Thrown if is null.
+ Thrown if the mirror represents a null object of unknown type.
+
+
+
+ Gets an object that can access the mirror type's constructors.
+
+
+
+ If there are no constructors, the member set will be
+ empty and all operations performed on it will fail. If there are multiple
+ constructors (when the constructor is overloaded), the member set
+ will refer to multiple constructors. When an operation is performed on the
+ member set, a specific constructor will chosen from the set or an error will
+ be emitted.
+
+
+ The member set that represents the mirror type's constructors.
+ Thrown if the mirror represents a null object of unknown type.
+
+
+
+ Gets an object that can access the mirror type's static constructors.
+
+
+
+ If there are no static constructors, the member set will be
+ empty and all operations performed on it will fail.
+
+
+ The member set that represents the mirror type's static constructors.
+ Thrown if the mirror represents a null object of unknown type.
+
+
+
+ A member set provides reflection operations on members of an object or type.
+
+
+
+ The specific member that is chosen for a given operation depends on the operation arguments.
+ For example, if a member set represents an overloaded method then the arguments to
+ are used to select the specific overload to be invoked. If the
+ overload cannot be determined automatically from the arguments, the client should
+ use the method to obtain a restricted member set given the
+ method signature of the specific overload to be used then calling
+ on the resulting member set.
+
+
+
+
+
+ Invokes the method represented by the member set and returns its result.
+
+
+
+ When the method set contains multiple overloads attempts to choose an
+ overload that is compatible with the argument list or raises an exception
+ if none is found.
+
+
+ The method result.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Invokes the method represented by the member set and returns its result.
+
+
+
+ When the method set contains multiple overloads attempts to choose an
+ overload that is compatible with the argument list or raises an exception
+ if none is found.
+
+
+ The method argument.
+ The method result.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Invokes the method represented by the member set and returns its result.
+
+
+
+ When the method set contains multiple overloads attempts to choose an
+ overload that is compatible with the argument list or raises an exception
+ if none is found.
+
+
+ The method arguments.
+ The method result.
+ Thrown if is null.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Invokes the method represented by the member set and returns its result as a mirror.
+
+
+
+ When the method set contains multiple overloads attempts to choose an
+ overload that is compatible with the argument list or raises an exception
+ if none is found.
+
+
+ The method result as a mirror.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Invokes the method represented by the member set and returns its result as a mirror.
+
+
+
+ When the method set contains multiple overloads attempts to choose an
+ overload that is compatible with the argument list or raises an exception
+ if none is found.
+
+
+ The method argument.
+ The method result as a mirror.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Invokes the method represented by the member set and returns its result as a mirror.
+
+
+
+ When the method set contains multiple overloads attempts to choose an
+ overload that is compatible with the argument list or raises an exception
+ if none is found.
+
+
+ The method arguments.
+ The method result as a mirror.
+ Thrown if is null.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Adds an event handler to the event represented by the member set.
+
+ The event handler, or null if none.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Adds an event handler to the event represented by the member set.
+
+ The event handler, or null if none.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Adds an event handler to the event represented by the member set.
+
+ The event handler, or null if none.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Removes an event handler to the event represented by the member set.
+
+ The event handler, or null if none.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Removes an event handler to the event represented by the member set.
+
+ The event handler, or null if none.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Removes an event handler to the event represented by the member set.
+
+ The event handler, or null if none.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Returns a new member set that selects members with the specified signature.
+ This is particularly useful when the member is overloaded and cannot be resolved
+ automatically.
+
+ The expected argument types, which may contain null elements
+ as placeholders for unspecified types.
+ A member set that selects members with the specified signature.
+ Thrown if is null.
+
+
+
+ Returns a new member set that selects members with the specified generic arguments.
+ This is particularly useful when the member has multiple generic overloads
+ that cannot be resolved automatically.
+
+ The expected generic argument types, which may contain null elements
+ as placeholders for unspecified types.
+ A member set that selects members with the specified generic arguments.
+ Thrown if is null.
+
+
+
+ Returns a new member set that selects members that match the specified binding flags.
+
+ The expected binding flags.
+ A member set that selects members that match the specified binding flags.
+
+
+
+ Gets the member info that the member set represents.
+
+
+
+ This call will fail if the member set matches multiple members in which case
+ you should use the method to choose a particular overload.
+
+
+ The nested type.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Gets the nested type that the member set represents.
+
+ The nested type.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Gets the nested type that the member set represents as a mirror.
+
+ The nested type as a mirror.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Gets an object that represents a particular index of a property whose value can be manipulated.
+
+ The index argument.
+ The property index.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Gets an object that represents a particular index of a property whose value can be manipulated.
+
+ The index arguments.
+ The property index.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Gets or sets the value of the field or property represented by the member set.
+
+ The value.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Gets the value of the field or property represented by the member set as a mirror.
+
+ The value as a mirror.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ A property index provides a means of getting or setting the value of an indexed property
+ using particular index arguments.
+
+
+
+
+ Gets or sets the value of the indexed property.
+
+ The value.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Gets the value of the indexed property as a mirror.
+
+ The value as a mirror.
+ Thrown if the operation failed because
+ of a reflection problem such as when the member access is invalid or ambiguous.
+
+
+
+ Runs the test as if it were surrounded by so that
+ multiple assertion failures within the test are tolerated.
+
+
+
+ When an assertion failure occurs, it is reported but the test is allowed to proceed
+ until it completes or throws an unhandled exception. When the test finishes, it will
+ still be marked as failed, as usual.
+
+
+
+
+
+
+
+
+ Overrides the name of a test or test parameter.
+
+
+
+ Use this attribute to specify a more descriptive or readable name than
+ the one chosen by default by MbUnit which is usually derived from the method,
+ class, field, property, or parameters name. The test name specified by this
+ attribute can contain
+
+
+
+
+
+ Overrides the name of a test or test parameter.
+
+ The overridden name.
+ Thrown if is null.
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The scope.
+ The code element.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Gets the overridden name.
+
+
+
+
+ Defines methods used with the syntax for mapping
+ assertions over complex data structures.
+
+
+
+
+ Evaluates an assertion over pairs of values taken from two sequences.
+
+
+
+ This assertion fails if the collections have different sizes or if one is null but not the other.
+
+
+ The left value type.
+ The right value type.
+ The left sequence, or null.
+ The right sequence, or null.
+ The assertion to evaluate given a left value and a right value.
+
+
+
+ Evaluates an assertion over pairs of values taken from two sequence.
+
+
+
+ This assertion fails if the collections have different sizes or if one is null but not the other.
+
+
+ The left value type.
+ The right value type.
+ The left sequence, or null.
+ The right sequence, or null.
+ The assertion to evaluate given a left value and a right value.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+
+
+
+ Evaluates an assertion over key/value pairs with identical keys drawn from two dictionaries.
+
+
+
+ This assertion fails if the collections have different sizes or if one is null but not the other.
+
+
+ The key type.
+ The expected value type.
+ The expected value type.
+ The left dictionary, or null.
+ The right dictionary, or null.
+ The assertion to evaluate over all pairs, with the left value as first
+ argument, and right value as second.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Evaluates an assertion over key/value pairs with identical keys drawn from two dictionaries.
+
+
+
+ This assertion fails if the collections have different sizes or if one is null but not the other.
+
+
+ The key type.
+ The expected value type.
+ The expected value type.
+ The left dictionary, or null.
+ The right dictionary, or null.
+ The assertion to evaluate over all pairs, with the key as first
+ argument, left value as second, and right value as third.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Evaluates an assertion over key/value pairs with identical keys drawn from two dictionaries.
+
+
+
+ This assertion fails if the collections have different sizes or if one is null but not the other.
+
+
+ The key type.
+ The expected value type.
+ The expected value type.
+ The left dictionary, or null.
+ The right dictionary, or null.
+ The assertion to evaluate over all pairs, with the left value as first
+ argument, and right value as second.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Evaluates an assertion over key/value pairs with identical keys drawn from two dictionaries.
+
+
+
+ This assertion fails if the collections have different sizes or if one is null but not the other.
+
+
+ The key type.
+ The expected value type.
+ The expected value type.
+ The left dictionary, or null.
+ The right dictionary, or null.
+ The assertion to evaluate over all pairs, with the key as first
+ argument, left value as second, and right value as third.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Sets the join strategy of a test to be pairwise.
+
+
+
+ The test will be executed using values drawn from each data source and combined so
+ that all possible pairings of values from each data source are produced. This constraint vastly
+ reduces the number of combinations because we only consider all interactions among
+ pairs of variables rather than among all variables at once. This strategy still
+ provides a high degree of variability among combinations and has a high likelihood of
+ finding bugs while incurring much less cost than testing all possible combinations.
+
+
+ If there are three data sources, A, B and C with values A1, A2, B1, B2, C1 and C2 then
+ the test will be run four times with inputs: (A1, B1, C1), (A2, B2, C1), (A1, B2, C2), (A2, B1, C2).
+ Compare this with the eight times that a standard cross-product combinatorial join
+ strategy would have required.
+
+
+ The algorithm used to compute pairwise coverings is approximate and might not find
+ a minimal pairwise covering of values. However, the relative size of a full combinatorial
+ cross product will still be exponentially larger than that of the covering that is produced.
+
+
+
+
+
+
+
+
+
+
+
+ Indicates that a test has pending prerequisites so it will not be run.
+
+
+
+ The test will still appear in test reports along with an explanation of the
+ reason it it pending, if provided.
+
+
+ This attribute can be used to disable tests that cannot run because the
+ subject under test is missing certain prerequisite functionality. It may
+ also serve as a placeholder for test that have yet to be implemented.
+
+
+
+
+
+ Indicates that this test has pending prerequisites without providing a reason.
+
+
+
+
+ Indicates that this test has pending prerequisites and provides a reason.
+
+ The reason for which the test is pending.
+ Thrown if
+ is null.
+
+
+
+
+
+
+ Gets the reason that the test is pending.
+
+
+
+
+ Decorates a test method and causes it to be invoked repeatedly.
+
+
+
+ Each repetition of the test method will occur within its own individually labeled
+ test step so that it can be identified in the test report.
+
+
+ The initialize, setup, teardown and dispose methods will are invoked around each
+ repetition of the test.
+
+
+
+
+
+
+ Executes the test method repeatedly.
+
+
+
+
+ The number of times to repeat the test.
+ Thrown if
+ is less than 1.
+
+
+
+
+
+
+ Evaluates repeatedly the specified condition until it becomes fulfilled, or throws
+ a if a timeout occured, or if the
+ evaluation was done unsuccessfully too many times.
+
+
+ Here is an example that illustrates the usage of .
+ { /* DoSomethingBetweenEachCall */ })
+ .Until(() => { return EvaluateSomeCondition(); });
+ }
+ }
+ ]]>
+
+
+
+
+ Specifies the maximum number of evaluation attempts, before the , or
+ operation fails.
+
+
+
+ If not specified, the condition will be evaluated an infinite number of times, or until some
+ other stop criterion is reached.
+
+
+ The maximum number of evaluation cycles, or zero or a negative value to specify an unlimited number of attempts.
+ An instance to specify other options for the retry operation.
+ Thrown if the options was called more than once.
+
+
+
+ Specifies a polling time expressed in milliseconds between each consecutive evaluation of the condition.
+
+
+
+ If not specified, the default polling time is zero; which causes the condition to be evaluated as fast as possible, with
+ only a brief suspension of the current thread ( ).
+
+
+ The polling time expressed in milliseconds.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+ Thrown if is negative.
+
+
+
+ Specifies a polling time between each consecutive evaluation of the condition.
+
+
+
+ If not specified, the default polling time is zero; which causes the condition to be evaluated as fast as possible, with
+ only a brief suspension of the current thread ( ).
+
+
+ The polling time.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+ Thrown if represents a negative duration.
+
+
+
+ Specifies a timeout value expressed in milliseconds.
+
+
+
+ The retry operation fails if the overall duration exceeds the specified timeout value.
+
+
+ If not specified, the default timeout value is set to 10 seconds.
+
+
+ The timeout value expressed in milliseconds, or a negative value to specify no timeout value.
+ A value of zero, will let the condition to be evaluated only once.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+
+
+
+ Specifies a timeout value.
+
+
+
+ The retry operation fails if the overall duration exceeds the specified timeout value.
+
+
+ If not specified, the default timeout value is set to 10 seconds.
+
+
+ The timeout value, or a negative value to specify no timeout value.
+ A value of zero, will let the condition to be evaluated only once.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+
+
+
+ Specifies a custom action to be executed between each consecutive attempt, but not before the first one.
+
+ A custom action to be executed.
+ An instance to specify other options for the retry operation.
+ Thrown if the option was called more than once.
+ Thrown if is null.
+
+
+
+ Specifies a custom formatted message to be added to the text of the assertion raised when
+ the retry operation has failed.
+
+ A user-supplied assertion failure message string, or null if none.
+ The format arguments, or null or empty if none.
+
+
+
+
+ Specifies the condition to evaluate repeatedly, and starts the entire operation.
+
+
+
+ The condition is considered fulfilled when it returns true.
+
+
+ The condition to evaluate.
+ Thrown when the condition is still false, and a timeout occured, or the maximum
+ number of evaluation attempts was reached.
+
+
+
+ Specifies a instance to wait for being signaled, and starts the entire operation.
+
+ The wait handle to evaluate.
+ Thrown when the wait handle is still unsignaled, and a timeout occured, or the maximum
+ number of evaluation attempts was reached.
+
+
+
+
+ Specifies a instance to wait for being terminated, and starts the entire operation.
+
+ The thread to evaluate.
+ Thrown when the thread is still alive, and a timeout occured, or the maximum
+ number of evaluation attempts was reached.
+
+
+
+
+ Provides a row of literal values as a data source.
+
+
+
+ The values specified in the row are used for data-driven testing purposes.
+ A row may specify zero or more values that are manipulated as a unit. Typically
+ each row generates a single instance instance of a data-driven test.
+
+
+ By default, the columns provided by the row data source are unnamed.
+ Use to provide an explicit name for each column.
+
+
+
+
+
+
+
+
+
+
+ Adds a row of literal values.
+
+
+
+ There exist two ambiguities in the use of this attribute that
+ result from how the C# compiler handles functions that accept
+ a variable number of arguments.
+
+
+ Case 1: If there is only 1 argument and its value is null , the
+ compiler will pass a null array reference to the attribute constructor.
+ Since the value array cannot be null, the attribute will assume that
+ you meant to create an array consiting of a single null .
+
+
+
+ Case 2: If there is only 1 argument and its value is an object array, the
+ compiler will pass the array itself as the argument values. Unfortunately,
+ the attribute constructor cannot distinguish this case from the usual case
+ when multiple arguments are present. So you need to disambiguate this case
+ explicitly.
+
+
+
+ To fix this case, you must provide explicit disambiguation.
+ (We cannot do it automatically based on the number of method parameters provided
+ because the row attribute can be applied to other elements besides methods and
+ its contents might be consumed in other ways.)
+
+
+
+ The array of values in the row.
+
+
+
+
+
+
+ Gets the array of values in the row.
+
+
+
+
+ Registers a custom assembly resolver.
+
+
+
+ A custom assembly resolver allows a test assembly to augment the default
+ assembly loading policy with custom rules.
+
+
+ To create a custom assembly resolver, define a resolver class that implement
+ the interface then apply the
+ to the test assembly at the assembly level.
+
+
+
+
+
+ Registers a custom assembly resolver.
+
+ The assembly resolver type, must
+ implement .
+
+
+
+
+
+
+ Gets the assembly resolver type.
+
+
+
+
+ Associates the author's name and email address with a test fixture, test method,
+ test parameter or other test component.
+
+
+
+
+ Associates the author's name with the test component annotated
+ by this attribute.
+
+ The author's name.
+ Thrown if is null.
+
+
+
+ Associates the author's name and email address with the test component annotated
+ by this attribute.
+
+ The author's name.
+ The author's email address.
+ Thrown if or is null.
+
+
+
+ Associates the author's name, email address and homepage with the test component annotated
+ by this attribute.
+
+ The author's name.
+ The author's email address.
+ The author's home page.
+ Thrown if ,
+ or is null.
+
+
+
+
+
+
+ Gets or sets the author's name.
+
+
+
+
+ Gets or sets the author's email address or an empty string if none.
+
+
+
+
+ Gets or sets the author's homepage or an empty string if none.
+
+
+
+
+ Associates a category name with a test fixture, test method, test parameter
+ or other test component.
+
+
+
+ The category name can be used to classify tests and build test suites of related tests.
+
+
+
+
+
+ Associates a category with the test component annotated by this attribute.
+
+ The name of the category to associate.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the name of the category.
+
+
+
+
+ Associates a description with a test fixture, test method, test parameter
+ or other test component.
+
+
+
+ The description provides documentation to users when browsing the tests.
+ However, it is not the only way. If the test has associated XML documentation
+ comments and the compiler is generating an XML documentation file for the
+ test assembly, then MbUnit will automatically import the documentation and
+ make it available to the user as metadata.
+
+
+
+
+
+ Associates a description with the test component annotated by this attribute.
+
+ The description to associate.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets or sets the description.
+
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+ The expected contents of the exception message may optionally be specified.
+
+
+
+
+
+ Declares that the associated test is expected to throw an exception of
+ a particular type.
+
+
+
+ The expected contents of the exception message may optionally be specified.
+
+
+
+
+
+ Declares that the associated test is expected to throw an exception of
+ a particular type.
+
+ The expected exception type.
+ Thrown if is null.
+
+
+
+ Declares that the associated test is expected to throw an exception of
+ a particular type.
+
+
+
+ The expected contents of the exception message may also optionally be specified.
+
+
+ The expected exception type.
+ The expected exception message, or null if not specified.
+ May be a substring of the actual exception message.
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the expected exception type.
+
+
+
+
+ Gets or sets the expected exception message, or null if none specified.
+ May be a substring of the actual exception message.
+
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+ The expected contents of the exception message may also optionally be specified.
+
+
+ The expected exception message, or null if not specified.
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+ The expected contents of the exception message may optionally be specified.
+
+
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+ The expected contents of the exception message may also optionally be specified.
+
+
+ The expected exception message, or null if not specified.
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+ The expected contents of the exception message may optionally be specified.
+
+
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+
+ Declares that the associated test is expected to throw an .
+
+
+
+ The expected contents of the exception message may also optionally be specified.
+
+
+ The expected exception message, or null if not specified.
+
+
+
+ Indicates that a test is to be ignored by the framework and will not be run.
+
+
+
+ The test will still appear in test reports along with the reason that it
+ was ignored, if provided.
+
+
+ This attribute can be used to disable tests that are broken or expensive
+ without commenting them out or removing them from the source code.
+
+
+
+
+
+ Indicates that this test is to be ignored without providing a reason.
+
+
+
+
+ Indicates that this test is to be ignored and provides a reason.
+
+ The reason for which the test is to be ignored.
+ Thrown if
+ is null.
+
+
+
+
+
+
+ Gets the reason that the test has been ignored, or an empty string if none.
+
+
+
+
+ Associates a with a test fixture, test method,
+ test parameter or other test component.
+
+
+
+
+ Associates a with the test component annotated by this attribute.
+
+ The importance to associate.
+
+
+
+
+
+
+ Gets or sets the importance.
+
+
+
+
+ Associates custom metadata with a test fixture, test method, test parameter
+ or other test component. The metadata can be used for documentation, classification
+ or dynamic customization of tests.
+
+
+
+ Metadata appears in the test reports and can be used for filtering. It is also
+ accessible at runtime by inspecting the properties of the current test in the
+ .
+
+
+
+
+
+ Associates custom metadata with a test component.
+
+ The metadata key.
+ The metadata value.
+ Thrown if
+ or is null.
+
+
+
+
+
+
+ Gets the metadata key.
+
+
+
+
+ Gets the metadata value.
+
+
+
+
+ Declares that a property, field, method parameter, constructor parameter,
+ generic type parameter or generic method parameter represents a test parameter.
+
+
+
+ This attribute is optional for a method parameter, constructor parameter,
+ generic type parameter or generic method parameter. For a property or field,
+ this attribute is required unless the property or field has at least one associated data
+ source, in which case the attribute can be omitted.
+
+
+ In other words, this attribute only needs to be specified on a property
+ or field that does not have an associated explicit data binding attribute.
+ This is typically the case when the parameter obtains its values from a
+ data source defined by the test fixture.
+
+
+
+
+
+
+
+
+ The type of exception thrown when a is unable to find a member.
+
+
+
+
+ Creates an exception.
+
+
+
+
+ Creates an exception.
+
+ The message.
+
+
+
+ Creates an exception.
+
+ The message.
+ The inner exception.
+
+
+
+ Creates an exception from serialization info.
+
+ The serialization info.
+ The streaming context.
+
+
+
+ Sets the join strategy of a test to be sequential.
+
+
+
+ The test will be executed using values drawn from each data source and combined sequentially
+ with elements from each data source chosen in order.
+
+
+ If there are two data sources, A and B with values A1, A2, B1 and B2, then the test will be
+ run twice with inputs: (A1, B1) and (A2, B2).
+
+
+
+
+
+
+
+
+
+
+
+ Specifies a method that is to be invoked before each test in a fixture executes
+ to set up the state of the test.
+
+
+
+ The method will run once for each test.
+
+
+ The attribute may be applied to multiple methods within a fixture, however
+ the order in which they are processed is undefined.
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class and must not have any parameters. The method may be static.
+
+
+
+
+
+
+
+
+ Specifies a method that is to be invoked after each test in a fixture executes
+ to tear down the state of the test.
+
+
+
+ The method will run once for each test.
+
+
+ The attribute may be applied to multiple methods within a fixture, however
+ the order in which they are processed is undefined.
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class and must not have any parameters. The method may be static.
+
+
+
+
+
+
+
+
+ Specifies that a method represents a single test case within a fixture.
+
+
+
+ By default, if the method throws an unexpected exception,
+ the test will be deemed to have failed. Otherwise, the test will pass.
+
+
+ The default behavior may be modified by test decorator attributes that
+ may alter the execution environment of the test, catch and reinterpret
+ any exceptions it throws, or impose additional constraints upon its execution.
+
+
+ Output from the test, such as text written to the console, is captured
+ by the framework and will be included in the test report. Additional
+ information can also be logged during test execution using the
+ class.
+
+
+ A test method has a timeout of 10 minutes by default. This may be changed
+ using the .
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class. The method may be static. If it has parameters, then the
+ test is considered to be data-driven.
+
+
+
+
+
+
+
+
+ An abstract base class for implementing new test decorator behaviors.
+
+
+
+ A test decorator applies actions to be performed around the initialization, setup,
+ execution, teardown and disposal lifecycle of a test (in that order).
+
+
+ This abstract class provides a convenient way to implement new test decorators
+ of your own. To add new behavior to the decorator, override the appropriate
+ lifecycle methods, such as .
+
+
+ If you need more control over how the test is decorated, you may
+ prefer subclassing directly instead.
+
+
+ When multiple test decorators are applied to a test, they are installed
+ in order according to the property.
+
+
+
+
+
+ Initializes the test.
+
+
+
+ Override this method to add your own behavior around the default actions.
+
+
+ The test instance state, not null.
+
+
+
+
+ Sets up the test.
+
+
+
+ Override this method to add your own behavior around the default actions.
+
+
+ The test instance state, not null.
+
+
+
+
+ Executes the test.
+
+
+
+ Override this method to add your own behavior around the default actions.
+
+
+ The test instance state, not null.
+
+
+
+
+ Tears down the test.
+
+
+
+ Override this method to add your own behavior around the default actions.
+
+
+ The test instance state, not null.
+
+
+
+
+ Disposes the test.
+
+
+
+ Override this method to add your own behavior around the default actions.
+
+
+ The test instance state, not null.
+
+
+
+
+
+
+
+ Specifies that a class represents a test fixture. This attribute is optional.
+
+
+
+ The test fixture attribute is applied to a class that contains a suite
+ of related test cases. If an error occurs while initializing the fixture
+ or if at least one of the test cases within the fixture fails,
+ then the fixture itself will be deemed to have failed. Otherwise the
+ fixture will pass.
+ Output from the fixture, such as text written to the console, is captured
+ by the framework and will be included in the test report.
+
+
+ A test fixture has no timeout by default. This may be changed
+ using the .
+
+
+ This attribute may be omitted whenever a test fixture class contains at least
+ one test method or test parameter or when other MbUnit attributes are applied
+ to the test fixture class. This is almost always the case unless for some reason
+ you have an empty fixture.
+
+
+ The class must have a public default constructor. The class may not be static.
+
+
+
+
+
+ Specifies a method that is to be invoked to set up the state of a fixture
+ before any of its tests are executed.
+
+
+
+ The attribute may be applied to multiple methods within a fixture, however
+ the order in which they are processed is undefined.
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class and must not have any parameters. The method may be static.
+
+
+
+
+
+
+
+
+
+
+
+ Specifies a method that is to be invoked to tear down the state of a fixture
+ after all of its tests have been executed.
+
+
+
+ The attribute may be applied to multiple methods within a fixture, however
+ the order in which they are processed is undefined.
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class and must not have any parameters. The method may be static.
+
+
+
+
+
+
+
+
+
+
+
+ Specifies the test's relative importance which can be used for classifying tests
+ to be executed.
+
+
+
+ In MbUnit v2 this enum had the attribute which was
+ pointless because the values were not binary so they could not actually be OR'ed together
+ without loss of information.
+
+
+ In MbUnit v3, to indicate that a test belongs to multiple importance classes, decorate it with
+ multiple occurrences of the .
+
+
+
+
+
+ Critical importance.
+
+
+
+
+ Severe importance. Less important than .
+
+
+
+
+ Serious importance. Less important than .
+
+
+
+
+ Default importance.
+
+
+
+
+ Not important.
+
+
+
+
+ Associates the name of the type under test with a test fixture, test method,
+ test parameter or other test component.
+
+
+
+ Specifying the type under test helps to describe which type is primarily being exercised
+ by the test. This way we can quickly identify which tests to run after making
+ changes to a given type. We can also use the TestsOn metadata as a filter so
+ that we can tell the test runner to only run tests about a particular type.
+
+
+ This attribute can be repeated multiple times if there are multiple types.
+
+
+
+
+
+ Associates the type under test with the test component annotated by this attribute.
+
+ The type under test.
+ Thrown if is null.
+
+
+
+ Associates the full name or assembly qualified name of the type under test
+ with the test component annotated by this attribute.
+
+ The name of the type under test as obtained by
+ or .
+ Thrown if is null.
+
+
+
+
+
+
+ Gets the full name or assembly qualified name of the type under test.
+
+
+ The name of the type under test as obtained by
+ or .
+
+
+
+
+ Decorates a test method and causes it to be invoked repeatedly
+ on multiple concurrent threads.
+
+
+
+ Each repetition of the test method will occur within its own individually labeled
+ test step so that it can be identified in the test report.
+
+
+ The initialize, setup, teardown and dispose methods will are invoked around each
+ repetition of the test. Be aware that this means that these invocations may
+ occur concurrently!
+
+
+
+
+
+
+ Executes the test method on the specified number of concurrent threads.
+
+
+
+
+ The number of threads to execute the test on.
+ Thrown if
+ is less than 1.
+
+
+
+
+
+
+ Sets the maximum amount of time in seconds that a test or fixture is permitted to run.
+
+
+
+ The default timeout is unlimited for test fixtures and 10 minutes for test methods.
+
+
+
+
+
+ Sets the test timeout in seconds, or zero if none.
+
+ The timeout in seconds, or zero if none.
+ Thrown if is less than 0.
+
+
+
+
+
+
+ Gets the test timeout in seconds, or zero if none.
+
+
+
+
+ Gets the timeout, or null if none.
+
+
+
+
+ A strongly-typed resource class, for looking up localized strings, etc.
+
+
+
+
+ Returns the cached ResourceManager instance used by this class.
+
+
+
+
+ Overrides the current thread's CurrentUICulture property for all
+ resource lookups using this strongly typed resource class.
+
+
+
+
+ Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?>
+ <Database xmlns="Gallio.Framework.Data.Generation">
+ <!-- Reference: Countries or areas, codes and abbreviations (04/15/2009)
+ [http://unstats.un.org/unsd/methods/m49/m49alpha.htm] -->
+ <Item>James</Item>
+ <Item>Afghanistan</Item>
+ <Item>Åland Island</Item>
+ <Item>Albania</Item>
+ <Item>Algeria</Item>
+ <Item>American Samoa</Item>
+ <Item>Andorra</Item>
+ <Item>Angola</Item>
+ <Item>Anguilla</Item>
+ <Item>Antigua and Barbuda</Item>
+ <Item>Argentin [rest of string was truncated]";.
+
+
+
+
+ Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?>
+ <Database xmlns="Gallio.Framework.Data.Generation">
+ <Item>James</Item>
+ <Item>John</Item>
+ <Item>Robert</Item>
+ <Item>Michael</Item>
+ <Item>William</Item>
+ <Item>David</Item>
+ <Item>Richard</Item>
+ <Item>Charles</Item>
+ <Item>Joseph</Item>
+ <Item>Thomas</Item>
+ <Item>Christopher</Item>
+ <Item>Daniel</Item>
+ <Item>Paul</Item>
+ <Item>Mark</Item>
+ <Item>Donald</Item>
+ <Item>George</Item>
+ <Item>Kenneth</Item>
+ <Item>Steven</Item>
+ < [rest of string was truncated]";.
+
+
+
+
+ Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?>
+ <xs:schema
+ elementFormDefault="qualified"
+ targetNamespace="Gallio.Framework.Data.Generation"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="Database">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" name="Item" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>.
+
+
+
+
+ Looks up a localized string similar to MbUnit v{0}.
+
+
+
+
+ Looks up a localized string similar to MbUnit v3.
+
+
+
+
+ The MbUnit test framework.
+
+
+
+
+
+
+
+ Gets the MbUnit version label.
+
+ A string similar to "MbUnit v3.1 build 200".
+
+
+
+ The MbUnit.Core namespace contains types used internally by MbUnit.
+
+
+
+
+ Contract for verifying the implementation of public type accessors, usually the getter and the setter of a particular property.
+
+
+
+ Built-in verifications:
+
+ -
+
SetValidValues : The setter accepts the values specified in the
+ contract property as valid assignment values,
+ and the getter returns equal values (object equality) when called afterwards.
+
+ -
+
SetInvalidValues : The setter rejects the values specified in the
+ contract property by throwing the appropriate exception. The test is not run when the
+ contract property is left empty.
+
+ -
+
SetNullValue : The setter rejects or accepts a null reference value according to the state of the
+ contract property. If set to true, the setter is expected to accept a null reference
+ as a valid value, and the getter to return a null reference as well. If set to false, the setter is expected to reject
+ a null reference assignment by throwing a exception. If the type handled by
+ the tested accessors is not nullable (a value type by example), the test is not run.
+
+
+
+
+
+ The following examples shows a simple class that contains a property, and a test fixture which declares an accessor
+ contract to verify the expected behavior of the subject property.
+
+ {
+ PropertyName = "Name",
+ AcceptNullValue = false,
+ ValidValues = { "Value1", "Value2" },
+ InvalidValues =
+ {
+ { typeof(ArgumentException), String.Empty }
+ }
+ };
+ }
+ ]]>
+
+ The type of the tested object which contain the accessors.
+ The type of the value handled by the accessors.
+
+
+
+
+ Default constructor.
+
+
+
+ Use the named parameters , ,
+ , , ,
+ and to specify some options.
+
+
+
+
+
+
+
+
+ Provides a default instance of the tested type.
+
+
+
+ By default, the contract verifier attempts to invoke the default constructor to get an valid instance.
+ Overwrite the default provider if the type has no default constructor, or if you want to use a particular instance.
+
+
+
+
+ {
+ DefaultInstance = () => new Foo("Hello")
+ // Other initialization stuff...
+ };
+ ]]>
+
+
+
+
+ Specifies an explicit way to set a value to the tested accessors.
+
+
+
+ Identify the tested accessors by using one of the following methods:
+
+ -
+
Explicitly invoke the getter and the setter. : Specify how to invoke to getter and
+ the setter by providing appropriate delegates to the and
+ contract properties. The contract property must be left unitialized (null).
+
+ -
+
Specify the name of a property. : Set the name of the tested property by feeding the
+ contract property with a valid name. The explicit and
+ contract properties must then be left uninitialized (null).
+
+
+
+
+
+ The following example shows how to specify explicitely a getter and a setter.
+
+ {
+ Setter = (target, value) => target.Name = value,
+ Getter = (target) => target.Name,
+ ValidValues = { "Value1", "Value2" },
+ };
+ }
+ ]]>
+
+
+
+
+
+
+ Specifies an explicit way to get a value from the tested accessors.
+
+
+
+
+
+
+ Specifies the name of tested property.
+
+
+
+ Identify the tested accessors with one of the following methods:
+
+ -
+
Explicitly invoke the getter and the setter. : Specify how to invoke to getter and
+ the setter by providing appropriate delegates to the and
+ contract properties. The contract property must be left unitialized (null).
+
+ -
+
Specify the name of a property. : Set the name of the tested property by feeding the
+ contract property with a valid name. The explicit and
+ contract properties must then be left uninitialized (null).
+
+
+
+
+
+ The following example shows how to specify the name of the property.
+
+ {
+ PropertyName = "Name",
+ ValidValues = { "Value1", "Value2" },
+ };
+ }
+ ]]>
+
+
+
+
+
+
+ Determines whether the tested accessors are expected to accept a null reference as a valid input.
+
+
+
+ If set to true , the setter is expected to accept a null reference as a valid value, and the getter
+ to return a null reference as well. If set to false , the setter is expected to reject a null reference assignment by
+ throwing a exception. If the type handled by the tested accessors is not nullable
+ (a value type by example), the contract property is ignored.
+
+
+ The use of that contract property is optional, and its default state is true .
+
+
+
+
+
+ Defines a collection of distinct object instances that are expected to be inconditionally accepted as
+ valid input by the tested setter. Feeding that contract property with at least one value is mandatory.
+
+
+ The following example shows how to specify some valid values for the contract verifier:
+
+ {
+ PropertyName = "MyProperty",
+ ValidValues = { 123, 456, 789 },
+ };
+ }
+ ]]>
+
+
+
+
+
+ Defines a collection of incompetence classes which identify object instances that are expected to be not accepted
+ by the tested setter. Each incompetence class contains a collection of distinct object instance associated
+ with an expected exception type.
+
+
+
+ Specifying incompetent values is entirely optional. By default, the entire collection is empty; which causes the
+ test 'SetInvalidValues' to not be run.
+
+
+
+ The following example shows how to specify some incompetent values for the contract verifier. The example
+ assumes that the hypothetical 'Foo.MyProperty' property accepts any integer between 0 and 999, except 666
+ which is expected to throw a exception.
+
+ {
+ PropertyName = "MyProperty",
+ ValidValues = { 123, 456, 789 },
+ IncompetentValues =
+ {
+ { typeof(ArgumentOutOfRangeException), -100, -999, 1000, 99999 },
+ { typeof(ArgumentException), 666 }
+ }
+ };
+ }
+ ]]>
+
+
+
+
+
+
+ The MbUnit.Framework.ContractVerifiers.Core namespace contains types that are used
+ as part of the internal implementation of contract verifiers.
+
+
+
+
+ A collection of distinct object instances associated with a particular exception type.
+
+
+
+ Every element represents an instance which is different from all the other
+ elements in the collection (object equality), and which is expected to be
+ the primary cause of an exception thrown when it is set or passed to
+ the tested method or property.
+
+
+ Distinct invalid instances are used by some contract verifiers such as
+ to check for the correct
+ detection of invalid or unexpected value assignment.
+
+
+
+ -
+ Use the single-parameter constructor to create an empty collection, which can be then
+ populated by calling explicitely the
+ method inherited from .
+ (typeof(ArgumentException));
+ collection.Add(new Foo(1));
+ collection.Add(new Foo(2));
+ collection.Add(new Foo(3));
+ ]]>
+
+ -
+ Use the list initializer syntax, to create a collection initialized with some content.
+
(typeof(ArgumentException))
+ {
+ new Foo(1)
+ new Foo(2),
+ new Foo(3),
+ };
+ ]]>
+
+ -
+ Use the two-parameters constructor to create a collection from an pre-existing enumeration..
+
(typeof(ArgumentException), Foo.GetThemAll());
+ ]]>
+
+
+
+
+ The type of the object instances in the collection.
+
+
+
+ A collection of distinct object instances. Every element represents a valid instance
+ which is different from all the other elements in the collection (object equality).
+
+
+
+ Distinct instances are used by some contract verifiers such as
+ to check for the correct
+ implementation of the collection interface.
+
+
+ Use the default constructor followed by a list initializer.
+
+ {
+ new Foo(1)
+ new Foo(2),
+ new Foo(3),
+ };
+ ]]>
+
+
+ Or, use the single-parameter constructor to create a collection from an pre-existing enumeration.
+ (Foo.GetThemAll());
+ ]]>
+
+
+ The type of the object instances in the collection.
+
+
+
+ Constructs an empty collection of distinct object instances.
+
+
+
+ All the elements of the collection should be different (object equality).
+
+
+
+
+
+ Constructs acollection of distinct object instances from the specified
+ enumeration of elements.
+
+ An enumeration of distinct object instances.
+
+
+
+ Adds the specified instance to the collection.
+
+ A valid and non-null object instance.
+
+
+
+ Returns a strongly-typed enumerator that iterates through the collection.
+
+ A strongly-typed enumerator.
+
+
+
+ Gets all the instances.
+
+
+
+
+ Constructs an empty collection of distinct object instances associated with an exception type.
+
+
+
+ Use this constructor in conjunction with the
+ method inherited from to initialize the collection;
+ either explicitely.
+ (typeof(ArgumentException));
+ collection.Add(new Foo(1));
+ collection.Add(new Foo(2));
+ collection.Add(new Foo(3));
+ ]]>
+ Or by using the list initializer syntax.
+ (typeof(ArgumentException))
+ {
+ new Foo(1)
+ new Foo(2),
+ new Foo(3),
+ };
+ ]]>
+
+
+ The type of the expected exception.
+
+
+
+ Constructs a collection of distinct object instances associated with an exception type.
+
+
+
+ Every element represents an instance which is different from all the other
+ elements in the collection (object equality), and which is expected to be
+ the primary cause of an exception thrown when it is set or passed to
+ the tested method or property.
+
+
+ The type of the exception associated with the object instances in the collection.
+ An array of distinct object instances.
+
+
+
+ The type of the exception associated with the object instances in the collection.
+
+
+
+
+ A collection of classes of distinct object instances gathered by the type
+ of the exception which is expected to be raised when the subject instances are passed
+ to a tested method or property.
+
+
+
+ Distinct invalid instances are used by some contract verifiers such as
+ to check for the correct
+ detection of invalid or unexpected value assignment.
+
+
+ Use the default constructor to create an empty collection, then use the
+ method, either explicitely.
+ ();
+ collection.Add(typeof(ArgumentException), new Foo(1), new Foo(2));
+ collection.Add(typeof(ArgumentOutOfRangeException), new Foo(3));
+ ]]>
+ Or by using the list initializer syntax, to feed the collection with classes of objects:
+
+ {
+ { typeof(ArgumentException), new Foo(1), new Foo(2) },
+ { typeof(ArgumentOutOfRangeException), new Foo(3) }
+ };
+ ]]>
+
+
+ The type of the object instances in the inner class collections.
+
+
+
+ Constructs an empty collection of classes of distinct object instances.
+
+
+
+ Each class identifies a collection of distinct object instances and the type
+ of the exception which is expected to be raised when the subject instances are passed
+ to the tested method or property.
+
+
+ Once the collection is created, populate it by using the
+ method; Either explicitely, or by using the list initializer syntax:
+ ();
+ collection.Add(typeof(ArgumentException), new Foo(1), new Foo(2));
+ collection.Add(typeof(ArgumentOutOfRangeException), new Foo(3));
+ ]]>
+
+ {
+ { typeof(ArgumentException), new Foo(1), new Foo(2) },
+ { typeof(ArgumentOutOfRangeException), new Foo(3) }
+ };
+ ]]>
+
+
+
+
+
+ Adds the specified class of distinct object instance to the collection.
+
+ The class to add to the collection.
+
+
+
+ Adds a new class of distinct object instances to the collection.
+
+
+
+ The new class is created with the specified arguments.
+
+
+ The exception type to associate with the new class.
+ an array of distinct object instances to populate the new class.
+
+
+
+ Returns a strongly-typed enumerator that iterates through the collection.
+
+ A strongly-typed enumerator.
+
+
+
+ Gets the number of invalid classes in the collection.
+
+
+
+
+ Execution context of a contract verification test.
+
+
+
+
+ Constructs an execution context for the verification tests of a contract verifier.
+
+ The code element for the contract read-only field.
+ Thrown if is null.
+
+
+
+ Gets an artificial stack trace data that points to
+ the contract read-only field.
+
+ An artificial stack trace data that points to the contract read-only field.
+
+
+
+ Gets the code element for the contract read-only field.
+
+
+
+
+ Contract for verifying the implementation of the generic .
+
+
+
+ Built-in verifications:
+
+ -
+
VerifyReadOnlyProperty : The property returns a value
+ in accordance to the expected result determined in the declaration of the contract verifier, by setting the property
+ . By default, the collection is
+ expected to be not read-only (items can be added and removed, and the collection to be cleared).
+
+ -
+
AddShouldThrowException : The read-only collection throws an exception when the method
+ is called. The test is not run when the contract property
+ is set to false .
+
+ -
+
RemoveShouldThrowException : The read-only collection throws an exception when the method
+ is called. The test is not run when the contract property
+ is set to false .
+
+ -
+
ClearShouldThrowException : The read-only collection throws an exception when the method
+ is called. The test is not run when the contract property
+ is set to false .
+
+ -
+
AddNullArgument : The collection throwns a when the method
+ is called with a null reference item. The test is not run when the contract property
+ is set to true .
+
+ -
+
RemoveNullArgument : The collection throwns a when the method
+ is called with a null reference item. The test is not run when the contract
+ property is set to true .
+
+ -
+
ContainsNullArgument : The collection throws a when the method
+ is called with a null reference item. The test is not run when the contract property
+ is set to true .
+
+ -
+
AddItems : The collection handles correctly with the addition of new items. The method
+ and the property are expected
+ to return suited results as well. The case of duplicate items (object equality) is tested too; according
+ to the value of contract property .
+ The test is not run when the contract property
+ is set to true .
+
+ -
+
RemoveItems : The collection handles correctly with the removal of items. The method
+ and the property are expected
+ to return suited results as well. The test is not run when the contract property
+ is set to true .
+
+ -
+
ClearItems : The collection is cleared as expected when the method is called.
+ The test is not run when the contract property is set to true .
+
+ -
+
CopyTo : The collection performs a copy of the items in an output array. The implementation is expected to
+ handle properly with null arguments, and a valid or an invalid index argument.
+
+
+
+
+ The type of the collection implementing .
+ The type of items contained in the collection.
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Asserts that the collection of distinct instances specified by the user is not empty.
+
+
+
+
+ Creates a test that invokes an action over the collection, which
+ is supposed to not be supported. The test expects that an exception be thrown.
+
+ The name of the tested method.
+ The action to evaluate.
+
+
+
+
+ Creates a test which runs an action over the collection with
+ a null argument. The test expects that an exception be thrown.
+
+ The name of the tested method.
+ The action to evaluate.
+
+
+
+
+ Returns safely a default instance of the tested type.
+
+
+
+ An assertion failure is generated if the instance cannot be created.
+
+
+ A new instance of the tested type as specified in the contract.
+ Thrown if the instance cannot be generated.
+
+
+
+ Provides a default instance of the collection to test.
+
+
+
+ By default, the contract verifier attempts to invoke the default constructor to get an valid instance.
+ Overwrite the default provider if the collection has no default constructor, or if you want
+ the contract verifier to use a particular instance.
+
+
+
+
+ {
+ DefaultInstance = () => new MyCollection(1, 2, 3)
+ };
+ ]]>
+
+
+
+
+ Determines whether the tested collection is expected to be read-only.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Determines whether the collection is expected to accept null references as valid items.
+
+
+
+ The default value is false .
+
+
+
+
+
+ Determines whether the collection is expected to accept several identical items (object equality).
+ The default value is true.
+
+
+
+ The default value is true .
+
+
+
+
+
+ Gets a collection of distinct object instances that feeds the different tests.
+
+
+
+ In order to optimize the tests, consider to provide:
+
+ -
+ items which are not in the default collection instance yet.
+
+ -
+ items which are in the default collection instance already (if not empty).
+
+
+
+
+
+
+
+ Contract for verifying the implementation of the generic interface.
+
+
+
+ Since the generic interface is a descendant of the generic interface,
+ the contract verifier has the same tests as the contract verifier,
+ plus the following built-in verifications:
+
+ -
+
InsertShouldThrowException : The read-only collection throws an exception when the method
+ is called. The test is not run when the contract property
+ inherited from
+ , is set to false .
+
+ -
+
RemoveAtShouldThrowException : The read-only collection throws an exception when the
+ method is called. The test is not run when the contract property
+
+ inherited from , is set to false .
+
+ -
+
IndexerSetShouldThrowException : The read-only collection throws an exception when the
+ setter of the indexer is called.
+ The test is not run when the contract property
+ inherited from , is set to false .
+
+ -
+
InsertNullArgument : The collection throwns a
+ when the method is called with a null reference item.
+ The test is not run when the contract property
+ inherited from , is set to true .
+
+ -
+
IndexOfNullArgument : The collection throwns a
+ when the method is called with a null reference item.
+ The test is not run when the contract property
+ inherited from , is set to true .
+
+ -
+
IndexerSetNullArgument : The collection throwns a
+ when the setter of the indexer is called with a null reference item.
+ The test is not run when the contract property
+ inherited from , is set to true .
+
+ -
+
InsertItems : The collection handles correctly with the insertion of new items. The method
+ and the property are expected
+ to return suitable results as well. The case of duplicate items (object equality) is tested too; according
+ to the value of contract property ,
+ inherited from . The test is not run when the contract
+ property
+ inherited from , is set to true .
+
+ -
+
InsertItemsAtInvalidIndex : The collection handles correctly with the insertion of new
+ items at an invalid index. The method should throw an when
+ called with a negative index or with an index greater than the number of items in the list.
+ The test is not run when the contract property
+ inherited from , is set to true .
+
+ -
+
RemoveItemsAt : The collection handles correctly with the removal of items at specific indexes.
+ The method and the property are expected
+ to return suitable results as well.
+ The test is not run when the contract property
+ inherited from , is set to true .
+
+ -
+
RemoveItemsAtInvalidIndex : The collection handles correctly with the removal of items at an
+ invalid index. The method should throw an when called with a
+ negative index or with an index greater than the number of items in the list.
+ The test is not run when the contract property
+ inherited from , is set to true .
+
+ -
+
GetItemsAtInvalidIndex : The collection handles correctly with the retrieval of items at
+ an invalid index. The indexer should throw an when called with
+ a negative index or with an index greater than the number of items in the list.
+
+ -
+
GetSetItemsWithIndexer : Setting and getting items by using the indexer property works as expected.
+ The test is not run when the contract property
+ inherited from , is set to true .
+
+ -
+
IndexOfItem : The retrieval of the index of an item in the collection works as expected,
+ and the index can be used effectively to get the item with the getter of the indexer property.
+
+
+
+
+ The type of the collection implementing .
+ The type of items contained by the list.
+
+
+
+
+
+
+ The MbUnit.Framework.ContractVerifiers namespace contains contracts ( )
+ that are used together with the to verify
+ common invariants that appear in contracts.
+
+
+
+ For example the ensures that the
+ and methods and the equality operators produce consistent and
+ correct results for the provided values. Likewise the ensures
+ that custom exception types are correctly implemented.
+
+
+
+
+
+ Verifies that a contract has been satisfied.
+
+
+
+ This attribute is applied to a field of type to that describes
+ a contract to be verified. Each contract object is like a reusable test suite that
+ can be customized by providing constructor parameters or by setting properties.
+ MbUnit includes several out-of-the-box contract verifier implementations that
+ capture common testing patterns for verifying the implementation of equivalence relations, exceptions,
+ collections, accessors and other code.
+
+
+ Contract verifiers can be incorporated into test fixtures in two ways.
+
+ - Contract stored in a readonly instance field. The contract verifier tests
+ will be generated dynamically at test execution time similarly to a
+
. This mechanism is compatible with data-driven
+ test fixtures (such as generic test fixtures or fixtures with constructor parameters)
+ but the user will be unable to individually view and select each test in the test runner
+ before running them.
+ - Contract stored in a readonly
static instance field. The
+ contract verifier tests will be generated statically at test exploration time similarly to a
+ . This mechanism can only be used in non-generic
+ test fixtures but the user will be able to individually view and select each
+ test in the test runner before running them.
+
+
+
+
+ ();
+
+ // "static" contract verifier (similar to a StaticTestFactory)
+ [VerifyContract]
+ public readonly static IContract Contract2 = new ListContract, int>();
+ }
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Verifies that the attribute is being used correctly.
+
+ The containing scope.
+ The field.
+ Thrown if the attribute is being used incorrectly.
+
+
+
+ Initializes a test for a contract verifier field after it has been added to the test model.
+
+ The field scope.
+ The field.
+
+
+
+ Generates static or dynamic tests from the contract.
+
+ The field scope.
+ The field.
+ The containing scope.
+
+
+
+
+
+
+ Decorates a test method and causes a screenshot to be automatically embeded when a trigger event occurs.
+
+
+
+ If screenshots cannot be captured, the attribute will embed a warning message to that effect.
+
+
+
+
+
+
+
+
+ Automatically embeds a screenshot when a trigger event occurs.
+
+
+
+ If screenshots cannot be captured, the method will embed a warning message to that effect.
+
+
+
+
+
+ The trigger event.
+
+
+
+
+
+
+ Gets the trigger event.
+
+
+
+
+ Gets the capture parameters.
+
+
+
+
+ Gets or sets the name to give to the image attachment.
+ (default is null)
+
+
+
+ The property is null by default, which causes the name of the attachment to be assigned automatically.
+
+
+
+
+
+ Gets or sets the zoom factor.
+
+
+
+ The zoom factor specifies the degree of magnification or reduction desired.
+ For example, a zoom factor of 1.0 (the default) is normal size, 0.25 reduces to one quarter the
+ original size and 2.0 magnifies to twice the original size.
+
+
+ Thrown if is less than 1/16 or more than 16.
+
+
+
+ Decorates a test method and causes a video of the test run to be automatically embeded when a trigger event occurs.
+
+
+
+ If screenshots cannot be captured, the attribute will embed a warning message to that effect.
+
+
+
+
+
+
+
+
+ Automatically embeds a video of the test run from this point forward when a trigger event occurs.
+
+
+
+ Recording a screen capture video can be very CPU and space intensive particularly
+ when running tests on a single-core CPU. We recommend specifying a zoom with of 0.25 or
+ less and a frame rate of no more than 5 to 10 frames per second.
+
+
+ If screenshots cannot be captured, the method will embed a warning message to that effect.
+
+
+
+
+
+ The trigger event.
+
+
+
+
+
+
+ Gets or sets the number of frames per second to capture (default is 5).
+
+
+
+
+ An abstract base class for custom comparer attributes.
+
+
+
+ The custom comparer attributes expose an extension point of
+ for defining custom object comparison and equality for types that do not implement built-in
+ comparison mechanisms such as or .
+
+
+
+
+
+
+
+ Constructor.
+
+
+
+
+
+
+
+ Registers a custom comparison operation for the specified type.
+
+ The type on which the comparer operates.
+ The comparison operation.
+
+
+
+ Registers the custom comparison operation for the specified type.
+
+ The searched type.
+
+
+
+ Gets the entry point for the registration of
+ custom actions that extend the framework.
+
+
+
+
+ Declares a custom type converter.
+
+
+
+ That attribute must be used on a static method taking one single parameter of the source type, and returning a value of the target type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides binary data from resource contents.
+
+
+
+ This example reads data from an Embedded Resource called Data.bin within the
+ same namespace as the test fixture.
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides text data from resource contents.
+
+
+
+ This example reads data from an Embedded Resource called Data.txt within the
+ same namespace as the test fixture.
+
+
+
+
+
+
+
+
+
+
+
+
+ Declares a custom type formatter.
+
+
+
+ That attribute must be used on a static method taking one single parameter of the source type, and returning a string describing the object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Declares a custom type equality comparer.
+
+
+
+ That attribute must be used on a static method which takes 2 parameters of the same type, and return a value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Declares a custom type comparer.
+
+
+
+ That attribute must be used on a static method which takes 2 parameters of the same type, and return a value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Optional settings for the XML equality assertions.
+
+
+
+
+
+
+
+
+
+
+
+ The default settings for the XML equality assertions.
+
+
+
+ Those settings specify to ignore the order of the elements and the attributes located
+ in the same parent element, and to ignore the comment tags as well.
+
+
+
+ Peary Caribou"
+ string actual = "Peary Caribou "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Default); // Pass!
+ }
+ ]]>
+
+
+
+
+ The strictest settings for the XML equality assertions.
+
+
+
+ The strictest settings expect the elements and the attributes to be in the same order as
+ in the expected XML data, and makes case sensitive string comparisons for the name and the
+ value of the elements and the attributes. Comment tags are included in the comparison
+ process as well.
+
+
+
+ " +
+ "
+ " " +
+ " " +
+ " " +
+ ""
+ string actual = "" +
+ "
+ " "
+ " " +
+ " " +
+ " "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Strict); // Pass!
+ }
+ ]]>
+
+
+
+
+ The loosest settings for the XML equality assertions.
+
+
+
+ The settings ignored the order of the elements and the attributes located in the
+ same parent element. It makes case insensitive string comparisons for the name and
+ the value of the attributes and the elements. It ignored the comment tags as well.
+
+
+
+ " +
+ "
+ " " +
+ " " +
+ " " +
+ ""
+ string actual = "" +
+ " " +
+ " "
+ " " +
+ " "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Loose); // Pass!
+ }
+ ]]>
+
+
+
+
+ Custom settings for the XML equality assertions.
+
+
+
+ Lets you define your own equality settings. Combine the different available options together
+ to specify how the equality between 2 provided XML fragments must be done.
+
+
+
+ Peary Caribou"
+ string actual = "Peary Caribou "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreComments.IgnoreElementsCaseName.IgnoreAttributesOrder); // Pass!
+ }
+ ]]>
+
+
+
+
+ Gets the inner value.
+
+
+
+
+ Customizable optional settings for the XML equality assertions.
+
+
+
+
+
+ Indicates that the name of the XML elements must be compared with case insensitivity.
+
+
+ Peary Caribou"
+ string actual = "Peary Caribou "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreElementsNameCase); // Pass!
+ }
+ ]]>
+
+
+
+
+ Indicates that the value of the XML elements must be compared with case insensitivity.
+
+
+ Peary Caribou"
+ string actual = "PEaRY CaRiboU "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreElementsValueCase); // Pass!
+ }
+ ]]>
+
+
+
+
+ Indicates that the name of the XML attributes must be compared with case insensitivity.
+
+
+ "
+ string actual = " "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreAttributesNameCase); // Pass!
+ }
+ ]]>
+
+
+
+
+ Indicates that the value of the XML attributes must be compared with case insensitivity.
+
+
+ "
+ string actual = " "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreAttributesValueCase); // Pass!
+ }
+ ]]>
+
+
+
+
+ Indicates that the order of the child elements within a given parent element must be ignored.
+
+
+ " +
+ " " + // 1st
+ " " + // 2nd
+ " " + // 3rd
+ ""
+ string actual = "" +
+ " " + // 2nd -> 1st!
+ " " + // 3rd -> 2nd!
+ " " + // 1st -> 3rd!
+ " "
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreElementsOrder); // Pass!
+ }
+ ]]>
+
+
+
+
+ Indicates that the order of the attributes within the same element must be ignored.
+
+
+ " + // 3rd
+ string actual = " 1st!
+ " species='tarandus'" + // 3rd -> 2nd!
+ " name='Peary Caribou' />" + // 1st -> 3rd!
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreAttributesOrder); // Pass!
+ }
+ ]]>
+
+
+
+
+ Indicates that the comment tags should be ignored during the comparison.
+
+
+ " +;
+ string actual = " " +;
+ Assert.Xml.AreEqual(expected, actual, XmlOptions.Custom.IgnoreComments); // Pass!
+ }
+ ]]>
+
+
+
+
+ Combines the options and
+
+
+
+
+ Combines the options and
+
+
+
+
+ Combines the options and
+
+
+
+
+ Combines the options and
+
+
+
+
+ Run a test or a test fixture under another user account.
+
+
+
+ PrincipalAttribute is an abstract class. You must derive your own attribute from this class,
+ and implement to return a principal object.
+
+
+
+
+
+
+
+
+ Creates a principal object which represents the security context
+ of the user on whose behalf the test is running.
+
+ A principal object.
+
+
+
+
+
+
+ Run a test or a test fixture under different cultures.
+
+
+ The following example demonstrates a simple test run under multiple cultures.
+ It will pass under en-US culture but fail under en-GB.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+ An array of culture names to run the test under.
+ Thrown if is a null reference.
+
+
+
+
+
+
+ Run a test or a test fixture under another user account.
+
+
+
+
+
+
+
+
+
+
+ Gets or sets the user name.
+
+
+
+
+ Gets or sets the password.
+
+
+
+
+ Gets or sets the domain where the user is defined.
+
+
+
+ If not specified, the domain is supposed to be the local machine.
+
+
+
+
+
+ The MbUnit.Framework namespace provides the MbUnit Test Framework, an extensible
+ attribute-based test framework for .Net.
+
+
+
+
+ Identifies a stock of predefined string values for the random strings generator.
+
+
+
+
+
+ A predefined collection of random US male names.
+
+
+
+
+ A predefined collection of random country names.
+
+
+
+ Reference: Countries or areas, codes and abbreviations .
+
+
+
+
+
+ Provides a column of random values as a data source.
+
+
+
+ Initialize the random string generator by setting the named parameter , which specifies
+ how many random values to generate; and one of the two named parameters or .
+
+
+ The property accepts a simplified regular expression syntax.
+ The following syntactic features are supported:
+
+ -
+
Logical Grouping : Group a part of the expression ((...) ).
+
+ -
+
Explicit Set : Define a set of possible characters ([...] ).
+ Ranges defined with a tiret are accepted.
+
+ -
+
Explicit Quantifier : Specify the number of times the previous expression must be repeated.
+ 'Constant' ({N} ) or 'Range' ({N,M} ) syntax are both accepted.
+
+ -
+
Zero Or One Quantifier Metacharacter : 0 or 1 of the previous expression (? ).
+ Same effect as {0,1} .
+
+ -
+
Escape Character : Makes the next character literal instead of a special character (\ ).
+
+
+
+
+ The property selects a stock of predefined strings from which to draw random values.
+
+
+
+
+
+
+
+
+
+ Provides a column of sequential values as a data source.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Returns a generator of random values.
+
+ The containing scope.
+ A generator.
+
+
+
+ Adds a column of random values.
+
+
+
+
+
+
+
+ Gets or sets a regular expression pattern to generate random string from.
+
+
+
+
+ Gets or sets the stock of predefined strings from which to draw random values.
+
+
+
+
+ Gets or sets the number of random values that are going to be generated.
+
+
+
+
+ Gets or sets the name of a method present in the test fixture
+ whose purpose is to prevent some specific values to be generated.
+
+
+
+ The method must accepts one argument of the type , and
+ returns a value indicating whether the specified value
+ must be accepted or rejected.
+
+
+
+
+
+
+
+
+
+
+ Provides a column of sequential values as a data source.
+
+
+
+ The sequence is initialized by setting 3 of the 4 available named properties.
+ The following combinations are possible:
+
+ , , and
+ , , and
+ , , and
+ and (with a default step of 1)
+ and (with a default step of 1)
+
+
+
+
+
+
+
+
+
+
+ Adds a column of sequential values.
+
+
+
+
+
+
+
+ Gets or sets the starting value of the sequence.
+
+
+
+ That property is used to define the sequence, when used with other properties:
+
+ and .
+ and .
+ and .
+ (default step of 1)
+ (default step of 1)
+
+
+
+
+
+
+ Gets or sets the ending value of the sequence.
+
+
+
+ That property is used to define the sequence, when used with 2 other properties:
+
+ and
+ and
+ (default step of 1)
+
+
+
+
+
+
+ Gets or sets the increment between each value of the sequence.
+
+
+
+ That property is used to define the sequence, when used with 2 other properties:
+
+ and
+ and
+
+
+
+
+
+
+ Gets or sets the length of the sequence.
+
+
+
+ That property is used to define the sequence, when used with 2 other properties:
+
+ and
+ and
+ (default step of 1)
+
+
+
+
+
+
+ Gets or sets the name of a method present in the test fixture
+ whose purpose is to prevent some specific values to be generated.
+
+
+
+ The method must accepts one argument of a type that represents a number, such as ,
+ , or , and returns a value indicating
+ whether the specified value must be accepted or rejected.
+
+
+
+
+
+
+
+
+ Provides a column of random values as a data source.
+
+
+
+ Initialize the random number generator by setting the 3 named parameters ,
+ , and according to the desired number of values, and to
+ the expected range of numbers.
+
+
+
+
+
+
+
+
+
+ Adds a column of random values.
+
+
+
+
+
+
+
+ Gets or sets the lower bound of the numeric range where random values are going to be generated.
+
+
+
+
+ Gets or sets the upper bound of the numeric range where random values are going to be generated.
+
+
+
+
+ Gets or sets the number of random values that are going to be generated.
+
+
+
+
+ Gets or sets the name of a method present in the test fixture
+ whose purpose is to prevent some specific values to be generated.
+
+
+
+ The method must accepts one argument of a type that represents a number, such as ,
+ , or , and returns a value indicating
+ whether the specified value must be accepted or rejected.
+
+
+
+
+
+
+
+
+ Specifies the scope to which certain attributes apply.
+
+
+
+
+
+ Applies to this test only.
+
+
+
+
+ Applies to the descendants of this test only.
+
+
+
+
+ Applies to this test and its descendants.
+
+
+
+
+ Provides a column of enumeration values as a data source.
+
+
+
+ Each value from the specified enumeration type is used as input for the
+ data-driven test method.
+
+
+ It is possible to exclude some specific values of the enumeration from the column.
+ Use or
+ for that purpose.
+
+
+
+
+
+
+
+
+
+ Adds a column of enumeration values.
+
+ The type of the enumeration.
+ The specified type is null.
+ The specified type is not an enumeration type.
+
+
+
+
+
+
+ Gets the type of the enumeration.
+
+
+
+
+ Sets or gets the single enumeration value that must be excluded from the column.
+
+
+
+ If you want to exclude several values at once, use instead.
+
+
+
+
+
+
+ Sets or gets an array of values that must be excluded from the column.
+
+
+
+ If you want to exclude one value only, use instead.
+
+
+
+
+
+
+ Specifies the default test case timeout for all tests in the test assembly.
+
+
+
+ Defaults to 10 minutes.
+
+
+
+
+
+
+ Sets the default timeout in seconds, or zero if none.
+
+ The timeout in seconds, or zero if none.
+ Thrown if is less than 0.
+
+
+
+
+
+
+ Gets the default timeout in seconds, or zero if none.
+
+
+
+
+ Gets the timeout, or null if none.
+
+
+
+
+ Specifies the maximum number of concurrent threads to use when tests are run in parallel
+ for all tests in the test assembly.
+
+
+
+ Defaults to or 2, whichever is greater.
+
+
+
+
+
+
+ Specifies the maximum number of concurrent threads to use when tests are run in parallel.
+
+ The degree of parallelism.
+ Thrown if is less than 1.
+
+
+
+
+
+
+ Gets the degree of parallelism.
+
+
+
+
+ Expected sorting order for the assertion.
+
+
+
+
+
+ Each value is expected to be greater than or equal to the previous value.
+
+
+
+
+ Each value is expected to be strictly greater than the previous value.
+
+
+
+
+ Each value is expected to be less than or equal to the previous value.
+
+
+
+
+ Each value is expected to be strictly less than the previous value.
+
+
+
+
+ A general-purpose structural equality comparer that defines a fully customizable equality operation without the
+ need to implement .
+
+
+
+ That equality comparer can be used in any MbUnit assertion that takes an
+ object as argument, such as .
+
+
+ The comparer must be initialized with a list of one or several matching criteria. Two instances are considered
+ equal by the comparer if and only if all the criteria are true for that pair of instances.
+
+
+
+ The following example shows a test fixture that checks for the equality between two Foo
+ objects by using the well known assertion. The custom equality comparer which
+ is provided to the assertion method, declares two Foo objects equal when the Value
+ fields have the same parity, and when the Text fields are equal (case insensitive):
+
+ {
+ { x => x.Value, (x, y) => x % 2 == y % 2 },
+ { x => x.Text, (x, y) => String.Compare(x, y, true) == 0 }
+ });
+ }
+ }
+ ]]>
+
+ The type of the objects. to compare.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The values returned by the accessor are compared by using a default comparison evaluator.
+
+
+
+
+ {
+ { x => x.Value },
+ });
+ }
+ }
+ ]]>
+
+ The type of the value returned by the accessor.
+ An accessor that gets a value from the tested object.
+ The specified accessor argument is a null reference.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The values returned by the accessor are compared by using the specified comparer object.
+
+
+
+
+ {
+ public bool Equals(int x, int y)
+ {
+ return x == y;
+ }
+
+ public int GetHashCode(int obj)
+ {
+ return obj;
+ }
+ }
+
+ [TestFixture]
+ public class FooTest
+ {
+ [Test]
+ public void MyTest()
+ {
+ var foo1 = new Foo() { Value = 123 };
+ var foo2 = new Foo() { Value = 123 };
+
+ Assert.AreEqual(foo1, foo2, new StructuralEqualityComparer
+ {
+ { x => x.Value, new MyComparer() },
+ });
+ }
+ }
+ ]]>
+
+ The type of the value returned by the accessor.
+ An accessor that gets a value from the tested object.
+ A comparer instance, or null to use the default one ( ).
+ The specified accessor argument is a null reference.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The values returned by the accessor are compared by using the specified comparison delegate.
+
+
+
+
+ {
+ { x => x.Value, (x, y) => x == y },
+ });
+ }
+ }
+ ]]>
+
+ The type of the value returned by the accessor.
+ An accessor that gets a value from the tested object.
+ A equality comparison delegate to compare the values returned by the accessor, or null to use the default one.
+ The specified accessor argument is a null reference.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The evaluation process is done through the specified comparison delegate.
+
+
+
+
+ {
+ { (x, y) => x.Value == y.Value },
+ });
+ }
+ }
+ ]]>
+
+ An equality comparison delegate to directly compare two instances, or null to use the default one.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The evaluation process is done through the specified comparer object.
+
+
+
+
+ {
+ public bool Equals(Foo x, Foo y)
+ {
+ return x.Value == y.Value;
+ }
+
+ public int GetHashCode(int obj)
+ {
+ return obj;
+ }
+ }
+
+ [TestFixture]
+ public class FooTest
+ {
+ [Test]
+ public void MyTest()
+ {
+ var foo1 = new Foo() { Value = 123 };
+ var foo2 = new Foo() { Value = 123 };
+
+ Assert.AreEqual(foo1, foo2, new StructuralEqualityComparer
+ {
+ { new MyComparer() },
+ });
+ }
+ }
+ ]]>
+
+ An comparer object to directly compare two instances, or null to use the default one.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The enumerations of values returned by the accessor are compared one by one,
+ by using the specified comparer.
+
+
+
+
+ {
+ { x => x.Values,
+ new StructuralEqualityComparer { { x => x } }
+ },
+ });
+ }
+ }
+ ]]>
+
+ The type of the value returned by the accessor.
+ An accessor that gets an enumeration of values from the tested object.
+ A comparer instance for the values returned by the accessor, or null to use the default one.
+ The specified accessor argument is a null reference.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The enumerations of values returned by the accessor are compared by using the specified comparer.
+
+
+
+
+ {
+ { x => x.Values,
+ new StructuralEqualityComparer { { x => x } },
+ StructuralEqualityComparerOptions.IgnoreEnumerableOrder
+ },
+ });
+ }
+ }
+ ]]>
+
+ The type of the value returned by the accessor.
+ An accessor that gets an enumeration of values from the tested object.
+ A comparer instance for the values returned by the accessor, or null to use the default one.
+ Some options indicating how to compare the enumeration of values returned by the accessor.
+ The specified accessor argument is a null reference.
+
+
+
+ Adds a matching criterion to the structural equality comparer.
+
+
+
+ The enumerations of values returned by the accessor are compared by using the specified comparer.
+
+
+
+
+ {
+ { x => x.Values,
+ new StructuralEqualityComparer { { x => x } },
+ StructuralEqualityComparerOptions.IgnoreEnumerableOrder
+ },
+ });
+ }
+ }
+ ]]>
+
+ The type of the value returned by the accessor.
+ An accessor that gets an enumeration of values from the tested object.
+ A comparer instance for the values returned by the accessor, or null to use the default one.
+ Some options indicating how to compare the enumeration of values returned by the accessor.
+ The specified accessor argument is a null reference.
+
+
+
+ Determines whether the specified objects are equal.
+
+ The first object of type T to compare.
+ The second object of type T to compare.
+ true if the specified objects are equal; otherwise, false.
+
+
+
+ Returns a hash code for the specified object.
+
+ The object for which a hash code is to be returned.
+ A hash code for the specified object.
+ The type of obj is a reference type and obj is null.
+
+
+
+ Returns a strongly-typed enumerator that iterates through the collection.
+
+ A strongly-typed enumerator that iterates through the collection.
+
+
+
+ Gets a default neutral structural equality comparer for the tested type.
+
+
+
+ The default comparer uses to determine whether
+ two objects are equal. Is is usually sufficient for primitive types, and
+ user types implementing .
+
+
+
+
+
+
+ Comparison options for the structural equality comparer.
+
+
+
+
+
+ Default options.
+
+
+
+
+ Compares the two child sequences by ignoring the order of the elements.
+
+
+
+
+ Provides data from XML contents.
+
+
+
+ An XML data set selects nodes from an XML document using XPath
+ expressions. The selected nodes are returned as objects
+ but MbUnit will automatically convert the values to the types requested by the test
+ such as strings or ints.
+
+
+ Two XPath expressions are used.
+
+ -
+
Item Path : An XPath expression that selects a set of nodes that are used to
+ uniquely identify records. For example, the item path might be used to select
+ the containing element of each Book element in an XML document of Books.
+ The item path is specified in the constructor.
+
+ -
+
Binding Path : An XPath expression that selects a node relative to the item path
+ that contains a particular data value of interest. For example, the binding path
+ might be used to select the Author attribute of a Book element in an XML document of Books.
+ The binding path is specified by the .
+
+
+
+
+
+
+ The XML may contain metadata at the row level by adding metadata elements in the
+ http://www.gallio.org/ namespace containing metadata entries. In the following example,
+ the row values would be selected using an Item Path of "//row" and a Binding Path of "@value".
+ Additionally, some rows would have metadata as specified.
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+ This example reads data from an Embedded Resource called Data.xml within the
+ same namespace as the test fixture. Notice that the binding xpath expressions
+ are specified for each parameter using the attribute.
+
+
+ Data files:
+
+ -
+
0.85
+ 3
+
+ -
+
0.10
+ 10
+
+ <-- Comment: mmm! -->
+ -
+
2.25
+ 1
+
+
+ ]]>
+
+
+ A simple test.
+
+
+
+
+
+
+
+ Specifies a XML-based data source.
+
+ The XPath expression used to select items within the document.
+ Thrown if is null.
+
+
+
+
+
+
+ Contract for verifying the implementation of the generic interface.
+
+
+
+ Built-in verifications:
+
+ -
+
ComparableCompareTo : The type implements the method .
+ The method behaves as expected agains the provided equivalence classes.
+
+ -
+
OperatorGreaterThan : The type has a static "Greater Than" operator overload which behaves
+ correctly against the provided equivalence classes. Disable that test by setting
+ the property to false .
+
+ -
+
OperatorGreaterThanOrEqual : The type has a static "Greater Than Or Equal" operator
+ overload which behaves correctly against the provided equivalence classes. Disable that test by setting
+ the property to false .
+
+ -
+
OperatorLessThan : The type has a static "Less Than" operator overload which behaves
+ correctly against the provided equivalence classes. Disable that test by setting
+ the property to false .
+
+ -
+
OperatorLessThanOrEqual : The type has a static "Less Than Or Equal" operator
+ overload which behaves correctly against the provided equivalence classes. Disable that test by setting
+ the property to false .
+
+
+
+
+
+ The following example shows a simple class implementing the
+ interface, and a test fixture which uses the
+ comparison contract to test it.
+
+ {
+ private int value;
+
+ public SampleComparable(int value)
+ {
+ this.value = value;
+ }
+
+ public int CompareTo(SampleComparable other)
+ {
+ return Object.ReferenceEquals(other, null)
+ ? Int32.MaxValue
+ : value.CompareTo(other.value);
+ }
+
+ public static bool operator >=(SampleComparable left, SampleComparable right)
+ {
+ return (Object.ReferenceEquals(left, null)
+ && Object.ReferenceEquals(right, null))
+ || (!Object.ReferenceEquals(left, null)
+ && (left.CompareTo(right) >= 0));
+ }
+
+ public static bool operator <=(SampleComparable left, SampleComparable right)
+ {
+ return Object.ReferenceEquals(left, null)
+ || (left.CompareTo(right) <= 0);
+ }
+
+ public static bool operator >(SampleComparable left, SampleComparable right)
+ {
+ return !Object.ReferenceEquals(left, null)
+ && (left.CompareTo(right) > 0);
+ }
+
+ public static bool operator <(SampleComparable left, SampleComparable right)
+ {
+ return (!Object.ReferenceEquals(left, null)
+ || !Object.ReferenceEquals(right, null))
+ && (Object.ReferenceEquals(left, null)
+ || (left.CompareTo(right) < 0));
+ }
+
+ public class SampleComparableTest
+ {
+ [VerifyContract]
+ public readonly IContract EqualityTests = new ComparisonContract
+ {
+ ImplementsOperatorOverloads = true, // Optional (default is true)
+ EquivalenceClasses =
+ {
+ { new SampleComparable(1) },
+ { new SampleComparable(2) },
+ { new SampleComparable(3) },
+ { new SampleComparable(4) },
+ { new SampleComparable(5) }
+ }
+ };
+ }
+ ]]>
+
+ The type of the object to evaluate.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Determines whether the verifier will evaluate the presence and the
+ behavior of the 4 operator overloads "Greater Than", "Greater Than
+ Or Equal", "Less Than", and "Less Than Or Equal".
+
+
+
+ The default value is true .
+
+
+
+
+
+ Gets or sets the collection of equivalence classes of instances
+ to feed the contract verifier.
+
+
+
+
+ Contract for verifying the implementation of the generic interface.
+
+
+
+ Built-in verifications:
+
+ -
+
ObjectEquals : The method was overriden and
+ behaves correctly against the provided equivalence classes.
+
+ -
+
ObjectGetHashCode : The method was overriden and behaves
+ correctly against the provided equivalence classes.
+
+ -
+
EquatableEquals : The method is implemented
+ and behaves as expected agains the provided equivalence classes.
+
+ -
+
OperatorEquals : The type has a static equality operator (==) overload which behaves
+ correctly against the provided equivalence classes. Disable that test by setting
+ the
+ property to false .
+
+ -
+
OperatorNotEquals : The type has a static inequality operator (!=) overload which
+ behaves correctly against the provided equivalence classes. Disable that test by
+ setting the
+ property to false .
+
+
+
+
+
+ The following example shows a simple class implementing the
+ interface, and a test fixture which uses the
+ equality contract to test it.
+
+ {
+ private int value;
+
+ public SampleEquatable(int value)
+ {
+ this.value = value;
+ }
+
+ public override int GetHashCode()
+ {
+ return value.GetHashCode();
+ }
+
+ public override bool Equals(object obj)
+ {
+ return Equals(obj as SampleEquatable);
+ }
+
+ public bool Equals(SampleEquatable other)
+ {
+ return !Object.ReferenceEquals(other, null)
+ && (value == other.value);
+ }
+
+ public static bool operator ==(SampleEquatable left, SampleEquatable right)
+ {
+ return (Object.ReferenceEquals(left, null)
+ && Object.ReferenceEquals(right, null))
+ || (!Object.ReferenceEquals(left, null)
+ && left.Equals(right));
+ }
+
+ public static bool operator !=(SampleEquatable left, SampleEquatable right)
+ {
+ return !(left == right);
+ }
+ }
+
+ public class SampleEquatableTest
+ {
+ [VerifyContract]
+ public readonly IContract EqualityTests = new EqualityContract
+ {
+ ImplementsOperatorOverloads = true, // Optional (default is true)
+ EquivalenceClasses =
+ {
+ { new SampleEquatable(1) },
+ { new SampleEquatable(2) },
+ { new SampleEquatable(3) },
+ { new SampleEquatable(4) },
+ { new SampleEquatable(5) }
+ }
+ };
+ }
+ ]]>
+
+ The target tested type which implements the generic interface.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Determines whether the verifier will evaluate the presence and the
+ behavior of the equality and the inequality operator overloads.
+
+
+
+ The default value is true .
+
+
+ Built-in verifications:
+
+ - The type has a static equality operator (==) overload which
+ behaves correctly against the provided equivalence classes.
+ - The type has a static inequality operator (!=) overload which
+ behaves correctly against the provided equivalence classes.
+
+
+
+
+
+
+
+ Gets or sets the collection of equivalence classes of instances
+ to feed the contract verifier.
+
+
+
+
+ Contract for verifying the implementation of a custom exception type.
+
+
+
+ Built-in verifications:
+
+ -
+
HasSerializableAttribute : The exception type has the
+ attribute. Disable that test by settings the
+ property to false .
+
+ -
+
HasSerializationConstructor : The exception type has a protected serialization
+ constructor similar to . Disable that test
+ by settings the
+ property to false .
+
+ -
+
IsDefaultConstructorWellDefined : The exception type has a default parameter-less
+ constructor. When the property
+ is set to true as well, the method verifies that the properties of
+ the exception are preserved during a roundtrip serialization. Disable the test
+ by settings the
+ property to false .
+
+ -
+
IsMessageConstructorWellDefined : The exception type has single argument constructor
+ for the message. When the property
+ is set to true as well, the method verifies that the properties of
+ the exception are preserved during a roundtrip serialization. Disable the test
+ by settings the
+ property to false .
+
+ -
+
IsMessageAndInnerExceptionConstructorWellDefined : The exception type has two
+ parameters constructor for the message and an inner exception.
+ When the property
+ is set to true as well, the method verifies that the properties of
+ the exception are preserved during a roundtrip serialization. Disable the test
+ by settings the
+ property to false .
+
+
+
+
+
+ The following example shows a simple custom exception class with some
+ basic serialization support, and a test fixture which uses the
+ exception contract to test it.
+ ()
+ {
+ ImplementsSerialization = true, // Optional (default is true)
+ ImplementsStandardConstructors = true // Optional (default is true)
+ };
+ }
+ ]]>
+
+ The target custom exception type.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Verifies that the and
+ properties are preserved by round-trip serialization.
+
+ The exception instance.
+
+
+
+ Performs round-trip serialization of the exception and returns the result.
+
+ The exception instance.
+ The instance produced after serialization and deserialization.
+
+
+
+ Determines whether the verifier will check for the serialization support.
+
+
+
+ The default value is true .
+
+
+ Built-in verifications:
+
+ - The exception implements the
interface.
+ - The exception has the
attribute.
+ - The exception type has a protected serialization constructor similar to
+
.
+
+
+
+
+
+
+ Determines whether the verifier will check for the presence of
+ the recommended standard constructors.
+
+
+
+ The default value is true .
+
+
+ Built-in verifications:
+
+ - The exception has a default parameter-less constructor.
+ - The exception has a single parameter constructor for the message.
+ - The exception two parameters constructor for the message and an inner exception.
+
+
+
+
+
+
+ Contract for verifying the implementation of an immutable type.
+
+
+
+ Built-in verifications:
+
+ -
+
AreReadOnlyFields : All the public and non-public instance fields are marked
+ as read only. The evaluation is made recursively on the field types too.
+
+ -
+
HasNoPublicPropertySetter : The type does not have any public property setter.
+ The evaluation is made recursively on the property types too.
+
+
+
+
+
+ The following example shows a simple immutable class with all the
+ instance fields marked as read only, and a test fixture which invokes the
+ immutability contract to test the class.
+ ();
+ }
+ ]]>
+
+ The target immutable type.
+
+
+
+
+ Default constructor.
+
+
+
+
+
+
+
+ Specifies that a test can be run in parallel with other parallelizable tests.
+
+
+
+ If this attribute is not specified, then the test will be run with Process-level
+ isolation. That is, it will not run concurrently with any other test within the
+ given process (notwithstanding any use of
+ or similar decorators).
+
+
+ Parallelizable tests are run in batches subject to the hierarchical structure of
+ the tests, any explicit ordering specifications, and test dependencies.
+
+
+ If two tests must be run exclusively of one another but are otherwise parallelizable,
+ then a simple expedient is to assign a different test order to each one. Later editions
+ of the framework may introduce additional controls over test isolation, mutual exclusion,
+ access to shared resources, and degree of paralleism.
+
+
+ To make all tests within a fixture parallelizable, apply this attribute to
+ the fixture class with a scope of to
+ only make the tests parallelizable or to also make
+ the fixture itself parallelizable. Likewise to make all tests in a test assembly
+ parallelizable, apply this attribute to the test assembly with the scope set similarly.
+
+
+
+
+ This C# example shows a fixture with a few tests, two of which are parallelizable.
+
+
+
+ This C# example shows a fixture all of whose tests are parallelizable.
+
+
+
+ This C# example shows a test assembly all of whose tests are parallelizable.
+
+
+
+
+
+
+ Specifies that this test is parallelizable.
+
+
+
+
+ Specifies that the tests in the specified scope are parallelizable.
+
+ The test scope.
+
+
+
+
+
+
+ Gets the scope to which the parallelizable attribute applies.
+
+
+
+
+ Specifies a method that is used to generate tests statically at
+ test exploration time.
+
+
+
+ The tests created by the static test factory are considered to be children
+ of the fixture that contains the factory method that generated them.
+ Because the tests are created statically, they will appear in the test
+ runner and they can be filtered as usual. However, this means that the
+ tests will be generated only when the fixture is being explored rather
+ than each time the fixture is executed. It also means that the factory
+ method must be static and cannot be parameterized.
+
+
+ Contrast with .
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class. It must be static and must not have any parameters.
+ It must return an enumeration of values of type .
+
+
+ Tests built by a will not be visible in ReSharper
+ and other test runners that rely only on source code and metadata exclusively.
+ This is because the test factory must be executed in order to populate the list of tests
+ but the code might not be available in a compiled form during test exploration. The
+ tests should still run as part of the containing fixture although the results may
+ only be visible in the full test report.
+
+
+
+
+ A simple static test factory that reads some data from a file and generates
+ a number of static tests. The file is read at test exploration time,
+ so if the file changes, the test package must be reloaded to obtain the new
+ contents.
+ CreateStaticTests()
+ {
+ foreach (string searchTerm in File.ReadAllLines("SearchTerms.txt"))
+ {
+ yield return new TestCase("Search Term: " + searchTerm, () => {
+ var searchEngine = new SearchEngine();
+ Assert.IsNotEmpty(searchEngine.GetSearchResults(searchTerm));
+ });
+ }
+ }
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Describes a test generated either at test exploration time or at test
+ execution time by a test factory.
+
+
+
+ Tests can be nested to form test suites and other aggregates.
+
+
+
+
+ Produces a suite of static tests as part of a containing test fixture.
+ The suite includes some custom set-up and tear-down behavior, metadata,
+ a timeout, an order relative to the other tests in the fixture, and a list
+ of children. There are two test cases defined in line, and one reference
+ to another statically defined test elsewhere.
+ TestSuite()
+ {
+ yield return new TestSuite("My Suite")
+ {
+ Description = "An example test suite.",
+ Metadata =
+ {
+ { MetadataKeys.AuthorName, "Me" },
+ { MetadataKeys.AuthorEmail, "me@mycompany.com" }
+ },
+ SuiteSetUp = () => DatabaseUtils.SetUpDatabase(),
+ SuiteTearDown = () => DatabaseUtils.TearDownDatabase(),
+ Timeout = TimeSpan.FromMinutes(2),
+ Children =
+ {
+ new TestCase("Test 1", () => {
+ // first test in suite
+ }),
+ new TestCase("Test 2", () => {
+ // second test in suite
+ }),
+ new TestFixtureReference(typeof(OtherFixtureToIncludeInSuite))
+ }
+ };
+ }
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Builds a collection of static tests during test exploration.
+
+ The enumeration of tests to build as children of the containing scope.
+ The containing pattern evaluation scope.
+ The code element that represents the scope in which the test was defined.
+ Thrown if ,
+ or is null or contains a null.
+
+
+
+
+ Runs a collection of dynamic tests during test execution.
+
+ The enumeration of tests to run.
+ The code element that represents the scope in which the test was defined.
+ Optional set-up code to run before the test, or null if none.
+ Optional tear-down code to run after the test, or null if none.
+ Thrown if or
+ is null or contains a null.
+
+
+
+
+ Builds a static test during test exploration.
+
+
+
+ Subclasses may override this behavior to change how the static test
+ gets added to the test model.
+
+
+ The containing pattern evaluation scope.
+ The code element that represents the scope in which the test was defined.
+
+
+
+
+ Runs a dynamic test during test execution.
+
+
+
+ Subclasses may override this behavior to change how the dynamic test
+ is executed as a test step.
+
+
+ The code element that represents the scope in which the test was defined.
+ Optional set-up code to run before the test, or null if none.
+ Optional tear-down code to run after the test, or null if none.
+
+
+
+
+ Describes a test case generated either at test exploration time or at test
+ execution time by a test factory.
+
+
+
+ A test case has a timeout of 10 minutes by default. This may be changed
+ setting the property.
+
+
+ Refer to the examples on the class for more information.
+
+
+
+
+
+
+ Abstract class for custom test definitions such as generated test cases
+ and test suites.
+
+
+
+
+ Creates a test.
+
+ The test name.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets the children of this test.
+
+
+
+ The default implementation returns an empty array. Subclasses may
+ override this behavior as appropriate.
+
+
+
+
+
+ Runs set-up code before execute and before all children.
+
+
+
+ The default implementation does nothing. Subclasses may override this
+ behavior.
+
+
+
+
+
+ Runs tear-down code after execute and after all children.
+
+
+
+ The default implementation does nothing. Subclasses may override this
+ behavior.
+
+
+
+
+
+ Executes the main body of the test, excluding its children (which will
+ run afterwards).
+
+
+
+ The default implementation does nothing. Subclasses may override this
+ behavior.
+
+
+
+
+
+ Runs set-up code before each child.
+
+
+
+ The default implementation does nothing. Subclasses may override this
+ behavior.
+
+
+
+
+
+ Runs tear-down code after each child.
+
+
+
+ The default implementation does nothing. Subclasses may override this
+ behavior.
+
+
+
+
+
+ Gets the test name.
+
+
+
+
+ Gets or sets the description metadata of the test, or null if none.
+
+
+
+ This is a convenience method that accesses the
+ element of the test case's .
+
+
+
+
+
+ Gets a mutable table of metadata entries associated with the test.
+
+
+
+ Add any extra metadata to this map.
+
+
+
+
+
+
+ Gets or sets the maximum amount of time the whole test including
+ its setup, teardown and body should be permitted to run.
+
+
+
+ If the test runs any longer than this, it will be aborted by the framework.
+ The timeout may be null to indicate the absence of a timeout.
+
+
+ Thrown if
+ represents a negative time span.
+ The timeout. Default value is null.
+
+
+
+ Gets or sets the code element associated with the test, or null if none.
+
+
+
+
+ Gets the test kind.
+
+
+
+ A test suite will return .
+ A test case will return .
+ Custom tests may return other kinds.
+
+
+ Subclasses must override this behavior.
+
+
+
+
+
+
+ Returns true if the test represents an individual test case.
+
+
+
+ A test suite will return true .
+ A test case will return false .
+ Custom tests may return an appropriate result.
+
+
+ Subclasses must override this behavior.
+
+
+
+
+
+
+ Creates a test case with a delegate to execute as its main body.
+
+ The test case name.
+ The main body of the test case.
+ Thrown if or
+ is null.
+
+
+
+
+
+
+ Gets or sets a set-up action to be executed before the test case.
+
+
+
+ If set to null (default), no action is performed.
+
+
+
+
+
+ Gets or sets a tear-down action to be executed after the test case.
+
+
+
+ If set to null (default), no action is performed.
+
+
+
+
+
+ Gets the delegate to run as the main body of the test case.
+
+
+
+
+
+
+
+
+
+
+ Specifies a method that is used to generate tests dynamically at runtime.
+
+
+
+ The tests created by the dynamic test factory are considered to be children
+ of the factory method that generated them. Because the tests are created
+ dynamically, they will not appear in the test tree (so most test runners will
+ not find them) and they are not directly affected by test filters. However,
+ the dynamic test factory is represented as a test so it will be visible in
+ the test tree.
+
+
+ Contrast with .
+
+
+ The method to which this attribute is applied must be declared by the
+ fixture class. It may have parameters and be data-driven just like an ordinary
+ test method! The method may be static. It must return an enumeration of
+ values of type .
+
+
+
+
+ A simple dynamic test factory that reads some data from a file and generates
+ a number of dynamic tests.
+ CreateDynamicTests()
+ {
+ foreach (string searchTerm in File.ReadAllLines("SearchTerms.txt"))
+ {
+ yield return new TestCase("Search Term: " + searchTerm, () => {
+ var searchEngine = new SearchEngine();
+ Assert.IsNotEmpty(searchEngine.GetSearchResults(searchTerm));
+ });
+ }
+ }
+ ]]>
+
+
+ A data-driven test factory that reads some data from a file and generates
+ a number of dynamic tests repeatedly in multiple configurations.
+ CreateDynamicTests(string searchProvider)
+ {
+ foreach (string searchTerm in File.ReadAllLines("SearchTerms.txt"))
+ {
+ yield return new TestCase("Search Term: " + searchTerm, () => {
+ var searchEngine = new SearchEngine(searchProvider);
+ Assert.IsNotEmpty(searchEngine.GetSearchResults(searchTerm));
+ });
+ }
+ }
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Decorates a test method whose database operation must be executed within a transaction and rolled
+ back when it has finished executing.
+
+
+
+ By default, the attribute does not rollback changes performed during SetUp and TearDown.
+ Set the to true to change this.
+
+
+ The attribute uses a to set an ambient transaction that will
+ be rolled back. Assuming the subject under test enlists itself with this transaction then
+ its transactions operations will be rolled back.
+
+
+ Unfortunately there are a few caveats from this approach, the subject under test might use
+ its own transaction manager and ignore the ambient transaction set up here. Likewise,
+ it is possible that the presence of an enclosing transaction scope can interfere with the
+ normal operation of the subject under test.
+
+
+ If this attribute does not work for a particular application, we recommend that you
+ create your own custom rollback decorator attribute with the appropriate application-specific
+ semantics. Just create a new subclass of and override the
+ method to wrap test execution as required.
+
+
+ Here are a few troubleshooting tips in case Rollback is not working properly for
+ your application:
+
+ - Ensure that the subject under test enlists its work in the current "ambient"
+ transaction managed by the
. Not all databases
+ support these transactions.
+ - Ensure that the Distributed Transaction Coordinator service is enabled and
+ running if you are using COM+ transactions.
+ - Ensure that the database is configured to enable distributed transactions.
+ This feature is sometimes disabled for performance reasons to prevent long-running
+ distributed transactions from locking database resources.
+
+
+
+
+
+ The following example shows the in use:
+
+
+
+
+
+
+ Tags a test method whose database operation must be executed within a transaction and rolled
+ back when it has finished executing.
+
+
+
+
+
+
+
+ When set to true, includes setup and teardown in the rollback. Otherwise
+ only transactions performed during the test itself are affected.
+
+
+
+ The fixture setup and teardown is not included regardless unless this
+ attribute is applied to the fixture class itself instead of the test method.
+
+
+
+
+
+ Describes a reference to another test fixture.
+
+
+
+ This is used to enable test suites to include tests that are defined using attributes.
+
+
+ Refer to the examples on the class for more information.
+
+
+ Running referenced test fixtures dynamically is not supported at this time. Run it
+ statically instead using .
+
+
+
+
+
+
+ Creates a reference to a test fixture.
+
+ The test fixture type.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+ Gets the referenced test fixture type, or null if the reference is on a
+ test method of the containing test fixture.
+
+
+
+
+ Describes a test suite generated either at test exploration time or at test
+ execution time by a test factory.
+
+
+
+ A test suite has no timeout by default. This may be changed
+ setting the property.
+
+
+ Refer to the examples on the class for more information.
+
+
+
+
+
+
+ Creates a test suite.
+
+ The test suite name.
+ Thrown if is null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gets a mutable list of the children of this test.
+
+
+
+ Add test cases to this collection to include them in the test suite.
+
+
+
+
+
+ Gets or sets a delegate to run before each test case in the suite, or null if none.
+
+
+
+
+ Gets or sets a delegate to run after each test case in the suite, or null if none.
+
+
+
+
+ Gets or sets a delegate to run before all test cases in the suite, or null if none.
+
+
+
+
+ Gets or sets a delegate to run after all test cases in the suite, or null if none.
+
+
+
+
+
+
+
+
+
+
+ Represents the path to an element or an attribute in a XML fragment.
+
+
+ Consider the following XML fragment:
+
+
+
+
+
+ ]]>
+ The path to the attribute value of the element Child is specified as follows:
+
+
+
+
+ Starts the construction of a path.
+
+ The name of the first element.
+ A path that can be further extended.
+
+
+
diff --git a/lib/Gallio_3.2.517.0/MbUnit35.dll b/lib/Gallio_3.2.517.0/MbUnit35.dll
new file mode 100644
index 00000000..f55850e9
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit35.dll differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit35.pdb b/lib/Gallio_3.2.517.0/MbUnit35.pdb
new file mode 100644
index 00000000..a4a2c53f
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit35.pdb differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit35.plugin b/lib/Gallio_3.2.517.0/MbUnit35.plugin
new file mode 100644
index 00000000..1fb954ec
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit35.plugin
@@ -0,0 +1,30 @@
+
+
+
+ MbUnit v3 Extensions for .Net 3.5
+ 3.2.0.0
+ Provides additional MbUnit v3 features for use with .Net 3.5.
+ plugin://MbUnit/Resources/MbUnit.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/MbUnit35.xml b/lib/Gallio_3.2.517.0/MbUnit35.xml
new file mode 100644
index 00000000..5e61a2d2
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit35.xml
@@ -0,0 +1,47 @@
+
+
+
+ MbUnit35
+
+
+
+
+ Provides extended assertions for .Net 3.5.
+
+
+
+
+ Verifies that a particular condition holds true.
+
+
+
+ If the condition evaluates to false, the assertion failure message will
+ describe in detail the intermediate value of relevant sub-expressions within
+ the condition. Consequently the assertion failure will include more diagnostic
+ information than if were used instead.
+
+
+ The conditional expression to evaluate.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
+ Verifies that a particular condition holds true.
+
+
+
+ If the condition evaluates to false, the assertion failure message will
+ describe in detail the intermediate value of relevant sub-expressions within
+ the condition. Consequently the assertion failure will include more diagnostic
+ information than if were used instead.
+
+
+ The conditional expression to evaluate.
+ The custom assertion message format, or null if none.
+ The custom assertion message arguments, or null if none.
+ Thrown if is null.
+ Thrown if the verification failed unless the current indicates otherwise.
+
+
+
diff --git a/lib/Gallio_3.2.517.0/MbUnit40.dll b/lib/Gallio_3.2.517.0/MbUnit40.dll
new file mode 100644
index 00000000..e76641a8
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit40.dll differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit40.pdb b/lib/Gallio_3.2.517.0/MbUnit40.pdb
new file mode 100644
index 00000000..106013b4
Binary files /dev/null and b/lib/Gallio_3.2.517.0/MbUnit40.pdb differ
diff --git a/lib/Gallio_3.2.517.0/MbUnit40.plugin b/lib/Gallio_3.2.517.0/MbUnit40.plugin
new file mode 100644
index 00000000..8b7e5d01
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit40.plugin
@@ -0,0 +1,30 @@
+
+
+
+ MbUnit v3 Extensions for .Net 4.0
+ 3.2.0.0
+ Provides additional MbUnit v3 features for use with .Net 4.0.
+ plugin://MbUnit/Resources/MbUnit.ico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/MbUnit40.xml b/lib/Gallio_3.2.517.0/MbUnit40.xml
new file mode 100644
index 00000000..dff68d4d
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/MbUnit40.xml
@@ -0,0 +1,8 @@
+
+
+
+ MbUnit40
+
+
+
+
diff --git a/lib/Gallio_3.2.517.0/Sources.txt b/lib/Gallio_3.2.517.0/Sources.txt
new file mode 100644
index 00000000..a478a1ca
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/Sources.txt
@@ -0,0 +1,10 @@
+Gallio v3.2.517.0 was generated from the following sources.
+
+Subversion Repository: http://mb-unit.googlecode.com/svn/trunk/v3
+ Revision: 2742
+
+Please visit the following Url for checkout instructions.
+ http://code.google.com/p/mb-unit/source/checkout
+
+Also refer to the wiki for information about how to debug with symbols and source code.
+ http://www.gallio.org/wiki/gallio:debugging_with_symbols_and_source_code
diff --git a/lib/Gallio_3.2.517.0/WeifenLuo.WinFormsUI.Docking.dll b/lib/Gallio_3.2.517.0/WeifenLuo.WinFormsUI.Docking.dll
new file mode 100644
index 00000000..96507f7f
Binary files /dev/null and b/lib/Gallio_3.2.517.0/WeifenLuo.WinFormsUI.Docking.dll differ
diff --git a/lib/Gallio_3.2.517.0/licenses/CciMetadata.License.txt b/lib/Gallio_3.2.517.0/licenses/CciMetadata.License.txt
new file mode 100644
index 00000000..da3dc935
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/licenses/CciMetadata.License.txt
@@ -0,0 +1,31 @@
+Microsoft Public License (Ms-PL)
+
+This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
+
+1. Definitions
+
+The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
+
+A "contribution" is the original software, or any additions or changes to the software.
+
+A "contributor" is any person that distributes its contribution under this license.
+
+"Licensed patents" are a contributor's patent claims that read directly on its contribution.
+
+2. Grant of Rights
+
+(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+
+(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+
+3. Conditions and Limitations
+
+(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+
+(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
+
+(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
+
+(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
+
+(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
\ No newline at end of file
diff --git a/lib/Gallio_3.2.517.0/licenses/Mono.Cecil.license.html b/lib/Gallio_3.2.517.0/licenses/Mono.Cecil.license.html
new file mode 100644
index 00000000..8025bbaf
--- /dev/null
+++ b/lib/Gallio_3.2.517.0/licenses/Mono.Cecil.license.html
@@ -0,0 +1,36 @@
+
+
+Mono.Cecil.license
+
+
+
+
+ (C) 2004-2006 Jb Evain
+
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal in the
+ Software without restriction, including without limitation the rights to use, copy,
+ modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+
+ The above copyright notice and this permission notice shall be included in all copies
+ or substantial portions of the Software.
+
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
\ No newline at end of file
diff --git a/src/MathNet.Numerics.5.1.ReSharper b/src/MathNet.Numerics.5.1.ReSharper
index bce082e6..af262d7c 100644
--- a/src/MathNet.Numerics.5.1.ReSharper
+++ b/src/MathNet.Numerics.5.1.ReSharper
@@ -3,6 +3,743 @@
SOLUTION
+
+
+
+
+
+ en-US
+ false
+ Wishart
+Wikipedia
+
+
+
+ en-US
+ en-US
+ en-US
+
+ en-US
+
+
+ Public Protected ProtectedInternal
+ Any
+ Maybe
+ Maybe
+ Any
+
+
+ false
+ 80
+
+
+
+
+ false
+
+
+ Any
+ Class
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Enum
+
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ EnumerationMember
+
+ Maybe
+ Maybe
+ Any
+
+
+
+ Classes, Enumerations, Enumeration values should be named in Pascal
+
+
+ _
+ m_
+
+ Pascal
+
+
+
+
+ false
+
+
+ Public Internal Protected ProtectedInternal
+ Property
+
+ Maybe
+ Maybe
+ Any
+
+
+ Public Internal Protected ProtectedInternal
+ Method
+
+ Maybe
+ Maybe
+ Any
+
+
+ Public Internal Protected ProtectedInternal
+ Event
+
+ Maybe
+ Maybe
+ Any
+
+
+
+ Non private properties, methods, events should be in pascal.
+
+
+ _
+ m_
+
+ Pascal
+
+
+
+
+ false
+
+
+ Private
+ Property
+
+ Maybe
+ Maybe
+ Any
+
+
+ Private
+ Method
+
+ Maybe
+ Maybe
+ Any
+
+
+ Private
+ Event
+
+ Maybe
+ Maybe
+ Any
+
+
+
+ Private properties, methods, events should be in camel.
+
+
+ _
+ m_
+
+ Camel
+
+
+
+
+ false
+
+
+ Any
+ Field
+
+ Maybe
+ Maybe
+ Any
+
+
+
+ Fields should be underscore camel.
+
+ _
+
+
+ m_
+
+ Camel
+
+
+
+
+ false
+
+
+ Any
+ Variable
+ Maybe
+ Maybe
+ Any
+
+
+ Variable should be declared in camel.
+
+
+ _
+ m_
+
+ Camel
+
+
+
+
+ false
+
+
+ Any
+ Parameter
+ Maybe
+ Maybe
+ Any
+
+
+ Function parameters should be in camel.
+
+
+ _
+ m_
+
+ Camel
+
+
+
+
+ false
+
+
+ Any
+ Namespace
+ Maybe
+ Maybe
+ Any
+
+
+ Namespaces should be in Pascal.
+
+
+ _
+ m_
+
+ Pascal
+
+
+
+
+ false
+
+
+ Any
+ Constant
+ Maybe
+ Maybe
+ Any
+
+
+ Constants should be in capital.
+
+
+ UpperCase
+
+
+
+
+ false
+
+
+ Any
+ Any
+ Maybe
+ Maybe
+ Any
+
+
+
+
+ Any
+ Constant
+ Maybe
+ Maybe
+ Any
+
+
+ Acronyms should not have more than 2 characters.
+
+
+ MatchesRegex
+
+
+ ^(?>(XML|SQL|[A-Z]{0,2})[A-Z]?([^A-Z]|$)|[^A-Z]+)*$
+
+
+ false
+
+
+ Any
+ Any
+ Maybe
+ Maybe
+ Any
+
+
+
+
+ Any
+ Constant
+
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Field
+
+ Maybe
+ Maybe
+ Any
+
+
+ Private
+ Method
+
+ Maybe
+ Maybe
+ Any
+
+
+ None
+ Namespace
+ Maybe
+ Maybe
+ Any
+
+
+ Names should not have underscore character
+
+
+ NotMatchesRegex
+
+
+ (?<remove>_)
+
+
+ false
+
+
+ Any
+ Class
+ NUnit.Framework.TestFixtureAttribute
+ Maybe
+ Maybe
+ Any
+
+
+ TestFixtures should end with Test.
+
+
+ Test
+
+ None
+
+ Test
+
+
+
+
+ false
+
+
+ Any
+ Method
+ NUnit.Framework.TestAttribute
+ Maybe
+ Maybe
+ Any
+
+
+ Test methods should start with Test.
+
+ Test
+
+
+ None
+
+
+ Test
+
+
+
+ false
+
+
+ Any
+ Enum
+ Maybe
+ Maybe
+ Any
+
+
+ Enumerations should not end with Enum.
+
+
+ None
+
+
+ Enum
+
+
+
+ false
+
+
+ Any
+ EnumerationMember
+ Maybe
+ Maybe
+ Any
+
+
+ Do not name enumerations reserved.
+
+
+ NotMatchesRegex
+
+
+ (?<remove>(reserved|Reserved))
+
+
+ false
+
+
+ Any
+ Event
+ Maybe
+ Maybe
+ Any
+
+
+ Event should not have Before or After prefix.
+
+
+ Before
+ After
+
+ None
+
+
+
+
+ false
+
+
+ Any
+ Enum
+ System.FlagsAttribute
+ Maybe
+ Maybe
+ Any
+
+
+ Flags enums should have plural names
+
+
+ None
+
+ s
+
+
+
+
+ true
+
+
+ Any
+ Enum
+ Maybe
+ Maybe
+ Any
+
+
+
+
+ Any
+ Enum
+ System.FlagsAttribute
+ Maybe
+ Maybe
+ Any
+
+
+ Enums that are not flags should not have plural names
+
+
+ None
+
+
+ s
+
+
+
+ false
+
+
+ Any
+ Class
+ System.Attribute
+ Maybe
+ Maybe
+ Any
+
+
+ Attribute should end with Attribute.
+
+
+ None
+
+ Attribute
+
+
+
+
+ false
+
+
+ Any
+ Class
+ System.EventArgs
+ Maybe
+ Maybe
+ Any
+
+
+ EventArgs should end with EventArgs.
+
+
+ None
+
+ EventArgs
+
+
+
+
+ false
+
+
+ Any
+ Class
+ System.Exception
+ Maybe
+ Maybe
+ Any
+
+
+ Exceptions should end with Exception.
+
+
+ None
+
+ Exception
+
+
+
+
+ false
+
+
+ Any
+ Class
+ System.Collections.Stack
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Class
+ System.Collections.Generic.Stack
+
+ Maybe
+ Maybe
+ Any
+
+
+
+ Stack should end with Collection or Stack.
+
+
+ None
+
+ Collection
+ Stack
+
+
+
+
+ false
+
+
+ Any
+ Class
+ System.Collections.ICollection
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Class
+ System.Collections.IEnumerable
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Class
+ System.Collections.Generic.ICollection
+ Maybe
+ Maybe
+ Any
+
+
+
+
+ Any
+ Class
+ System.Collections.Stack
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Class
+ System.Collections.Queue
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Class
+ System.Collections.Generic.Stack
+
+ Maybe
+ Maybe
+ Any
+
+
+ Collections should end with Collection.
+
+
+ None
+
+ Collection
+
+
+
+
+ false
+
+
+ Any
+ Class
+ System.Collections.IDictionary
+ Maybe
+ Maybe
+ Any
+
+
+ Any
+ Class
+ System.Collections.Generic.IDictionary
+ Maybe
+ Maybe
+ Any
+
+
+ Dictionary should end with Dictionary.
+
+
+ None
+
+ Dictionary
+
+
+
+
+ false
+
+
+ Any
+ Class
+ System.Collections.Queue
+ Maybe
+ Maybe
+ Any
+
+
+ Queue should end with Collection or Queue.
+
+
+ None
+
+ Collection
+ Queue
+
+
+
+
+ false
+
+
+ Any
+ Interface
+ Maybe
+ Maybe
+ Any
+
+
+ Interfaces should be in Pascal and start with I.
+
+ I
+
+
+ Pascal
+
+
+
+
+
+
+
+
+ Public Protected ProtectedInternal
+ Any
+ Maybe
+ Maybe
+ Any
+
+
+
+ (?#email)\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
+ (?#url)http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
+
+
+
NEXT_LINE
diff --git a/src/Numerics/Distributions/Continuous/Beta.cs b/src/Numerics/Distributions/Continuous/Beta.cs
index e6617e5b..b4374570 100644
--- a/src/Numerics/Distributions/Continuous/Beta.cs
+++ b/src/Numerics/Distributions/Continuous/Beta.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -49,7 +45,7 @@ namespace MathNet.Numerics.Distributions
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Beta : IContinuousDistribution
{
///
@@ -93,7 +89,7 @@ namespace MathNet.Numerics.Distributions
///
/// The a shape parameter of the Beta distribution.
/// The b shape parameter of the Beta distribution.
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double a, double b)
{
if (a < 0.0 || b < 0.0 || Double.IsNaN(a) || Double.IsNaN(b))
@@ -126,8 +122,15 @@ namespace MathNet.Numerics.Distributions
///
public double A
{
- get { return _shapeA; }
- set { SetParameters(value, _shapeB); }
+ get
+ {
+ return _shapeA;
+ }
+
+ set
+ {
+ SetParameters(value, _shapeB);
+ }
}
///
@@ -135,8 +138,15 @@ namespace MathNet.Numerics.Distributions
///
public double B
{
- get { return _shapeB; }
- set { SetParameters(_shapeA, value); }
+ get
+ {
+ return _shapeB;
+ }
+
+ set
+ {
+ SetParameters(_shapeA, value);
+ }
}
#region IDistribution implementation
@@ -169,34 +179,37 @@ namespace MathNet.Numerics.Distributions
{
get
{
- if(_shapeA == 0.0 && _shapeB == 0.0)
+ if (_shapeA == 0.0 && _shapeB == 0.0)
{
return 0.5;
}
- else if(_shapeA == 0.0)
+
+ if (_shapeA == 0.0)
{
return 0.0;
}
- else if(_shapeB == 0.0)
+
+ if (_shapeB == 0.0)
{
return 1.0;
}
- else if(Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
{
return 0.5;
}
- else if (Double.IsPositiveInfinity(_shapeA))
+
+ if (Double.IsPositiveInfinity(_shapeA))
{
return 1.0;
}
- else if (Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeB))
{
return 0.0;
}
- else
- {
- return _shapeA / (_shapeA + _shapeB);
- }
+
+ return _shapeA / (_shapeA + _shapeB);
}
}
@@ -216,7 +229,10 @@ namespace MathNet.Numerics.Distributions
///
public double StdDev
{
- get { return Math.Sqrt((_shapeA * _shapeB) / ((_shapeA + _shapeB) * (_shapeA + _shapeB) * (_shapeA + _shapeB + 1.0))); }
+ get
+ {
+ return Math.Sqrt((_shapeA * _shapeB) / ((_shapeA + _shapeB) * (_shapeA + _shapeB) * (_shapeA + _shapeB + 1.0)));
+ }
}
///
@@ -230,21 +246,21 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (_shapeA == 0.0 && _shapeB == 0.0)
+
+ if (_shapeA == 0.0 && _shapeB == 0.0)
{
return -Math.Log(0.5);
}
- else if (_shapeA == 0.0 || _shapeB == 0.0)
+
+ if (_shapeA == 0.0 || _shapeB == 0.0)
{
return 0.0;
}
- else
- {
- return SpecialFunctions.BetaLn(_shapeA, _shapeB)
- - ((_shapeA - 1.0) * SpecialFunctions.DiGamma(_shapeA))
- - ((_shapeB - 1.0) * SpecialFunctions.DiGamma(_shapeB))
- + ((_shapeA + _shapeB - 2.0) * SpecialFunctions.DiGamma(_shapeA + _shapeB));
- }
+
+ return SpecialFunctions.BetaLn(_shapeA, _shapeB)
+ - ((_shapeA - 1.0) * SpecialFunctions.DiGamma(_shapeA))
+ - ((_shapeB - 1.0) * SpecialFunctions.DiGamma(_shapeB))
+ + ((_shapeA + _shapeB - 2.0) * SpecialFunctions.DiGamma(_shapeA + _shapeB));
}
}
@@ -259,33 +275,37 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (Double.IsPositiveInfinity(_shapeA))
+
+ if (Double.IsPositiveInfinity(_shapeA))
{
return -2.0;
}
- else if (Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeB))
{
return 2.0;
}
- else if (_shapeA == 0.0 && _shapeB == 0.0)
+
+ if (_shapeA == 0.0 && _shapeB == 0.0)
{
return 0.0;
}
- else if (_shapeA == 0.0)
+
+ if (_shapeA == 0.0)
{
return 2.0;
}
- else if (_shapeB == 0.0)
+
+ if (_shapeB == 0.0)
{
return -2.0;
}
- else
- {
- return 2.0 * (_shapeB - _shapeA) * Math.Sqrt(_shapeA + _shapeB + 1.0)
+
+ return 2.0 * (_shapeB - _shapeA) * Math.Sqrt(_shapeA + _shapeB + 1.0)
/ ((_shapeA + _shapeB + 2.0) * Math.Sqrt(_shapeA * _shapeB));
- }
}
}
+
#endregion
#region IContinuousDistribution implementation
@@ -301,34 +321,38 @@ namespace MathNet.Numerics.Distributions
{
return 0.5;
}
- else if (_shapeA == 0.0)
+
+ if (_shapeA == 0.0)
{
return 0.0;
}
- else if (_shapeB == 0.0)
+
+ if (_shapeB == 0.0)
{
return 1.0;
}
- else if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
{
return 0.5;
}
- else if (Double.IsPositiveInfinity(_shapeA))
+
+ if (Double.IsPositiveInfinity(_shapeA))
{
return 1.0;
}
- else if (Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeB))
{
return 0.0;
}
- else if(_shapeA == 1.0 && _shapeB == 1.0)
+
+ if (_shapeA == 1.0 && _shapeB == 1.0)
{
return 0.5;
}
- else
- {
- return (_shapeA - 1) / (_shapeA + _shapeB - 2);
- }
+
+ return (_shapeA - 1) / (_shapeA + _shapeB - 2);
}
}
@@ -337,7 +361,10 @@ namespace MathNet.Numerics.Distributions
///
public double Median
{
- get { throw new NotImplementedException(); }
+ get
+ {
+ throw new NotImplementedException();
+ }
}
///
@@ -345,7 +372,10 @@ namespace MathNet.Numerics.Distributions
///
public double Minimum
{
- get { return 0.0; }
+ get
+ {
+ return 0.0;
+ }
}
///
@@ -353,7 +383,10 @@ namespace MathNet.Numerics.Distributions
///
public double Maximum
{
- get { return 1.0; }
+ get
+ {
+ return 1.0;
+ }
}
///
@@ -367,81 +400,49 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
{
- if (x == 0.5)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return 0.0;
- }
+ return x == 0.5 ? Double.PositiveInfinity : 0.0;
}
- else if (Double.IsPositiveInfinity(_shapeA))
+
+ if (Double.IsPositiveInfinity(_shapeA))
{
- if (x == 1.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return 0.0;
- }
+ return x == 1.0 ? Double.PositiveInfinity : 0.0;
}
- else if (Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeB))
{
- if (x == 0.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return 0.0;
- }
+ return x == 0.0 ? Double.PositiveInfinity : 0.0;
}
- else if (_shapeA == 0.0 && _shapeB == 0.0)
+
+ if (_shapeA == 0.0 && _shapeB == 0.0)
{
if (x == 0.0 || x == 1.0)
{
return Double.PositiveInfinity;
}
- else
- {
- return 0.0;
- }
+
+ return 0.0;
}
- else if (_shapeA == 0.0)
+
+ if (_shapeA == 0.0)
{
- if (x == 0.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return 0.0;
- }
+ return x == 0.0 ? Double.PositiveInfinity : 0.0;
}
- else if (_shapeB == 0.0)
+
+ if (_shapeB == 0.0)
{
- if (x == 1.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return 0.0;
- }
+ return x == 1.0 ? Double.PositiveInfinity : 0.0;
}
- else if (_shapeA == 1.0 && _shapeB == 1.0)
+
+ if (_shapeA == 1.0 && _shapeB == 1.0)
{
return 1.0;
}
- else
- {
- double b = SpecialFunctions.Gamma(_shapeA + _shapeB) / (SpecialFunctions.Gamma(_shapeA) * SpecialFunctions.Gamma(_shapeB));
- return b * Math.Pow(x, _shapeA - 1.0) * Math.Pow(1.0 - x, _shapeB - 1.0);
- }
+
+ var b = SpecialFunctions.Gamma(_shapeA + _shapeB) / (SpecialFunctions.Gamma(_shapeA) * SpecialFunctions.Gamma(_shapeB));
+ return b * Math.Pow(x, _shapeA - 1.0) * Math.Pow(1.0 - x, _shapeB - 1.0);
}
///
@@ -455,83 +456,52 @@ namespace MathNet.Numerics.Distributions
{
return Double.NegativeInfinity;
}
- else if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
{
- if (x == 0.5)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NegativeInfinity;
- }
+ return x == 0.5 ? Double.PositiveInfinity : Double.NegativeInfinity;
}
- else if (Double.IsPositiveInfinity(_shapeA))
+
+ if (Double.IsPositiveInfinity(_shapeA))
{
- if (x == 1.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NegativeInfinity;
- }
+ return x == 1.0 ? Double.PositiveInfinity : Double.NegativeInfinity;
}
- else if (Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeB))
{
- if (x == 0.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NegativeInfinity;
- }
+ return x == 0.0 ? Double.PositiveInfinity : Double.NegativeInfinity;
}
- else if (_shapeA == 0.0 && _shapeB == 0.0)
+
+ if (_shapeA == 0.0 && _shapeB == 0.0)
{
if (x == 0.0 || x == 1.0)
{
return Double.PositiveInfinity;
}
- else
- {
- return Double.NegativeInfinity;
- }
+
+ return Double.NegativeInfinity;
}
- else if (_shapeA == 0.0)
+
+ if (_shapeA == 0.0)
{
- if (x == 0.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NegativeInfinity;
- }
+ return x == 0.0 ? Double.PositiveInfinity : Double.NegativeInfinity;
}
- else if (_shapeB == 0.0)
+
+ if (_shapeB == 0.0)
{
- if (x == 1.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NegativeInfinity;
- }
+ return x == 1.0 ? Double.PositiveInfinity : Double.NegativeInfinity;
}
- else if (_shapeA == 1.0 && _shapeB == 1.0)
+
+ if (_shapeA == 1.0 && _shapeB == 1.0)
{
return 0.0;
}
- else
- {
- double a = SpecialFunctions.GammaLn(_shapeA + _shapeB) - SpecialFunctions.GammaLn(_shapeA) - SpecialFunctions.GammaLn(_shapeB);
- double b = x == 0.0 ? (_shapeA == 1.0 ? 0.0 : Double.NegativeInfinity) : (_shapeA - 1.0) * Math.Log(x);
- double c = x == 1.0 ? (_shapeB == 1.0 ? 0.0 : Double.NegativeInfinity) : (_shapeB - 1.0) * Math.Log(1.0 - x);
- return a + b + c;
- }
+
+ var a = SpecialFunctions.GammaLn(_shapeA + _shapeB) - SpecialFunctions.GammaLn(_shapeA) - SpecialFunctions.GammaLn(_shapeB);
+ var b = x == 0.0 ? (_shapeA == 1.0 ? 0.0 : Double.NegativeInfinity) : (_shapeA - 1.0) * Math.Log(x);
+ var c = x == 1.0 ? (_shapeB == 1.0 ? 0.0 : Double.NegativeInfinity) : (_shapeB - 1.0) * Math.Log(1.0 - x);
+
+ return a + b + c;
}
///
@@ -545,77 +515,53 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (x >= 1.0)
+
+ if (x >= 1.0)
{
return 1.0;
}
- else if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeA) && Double.IsPositiveInfinity(_shapeB))
{
- if (x < 0.5)
- {
- return 0.0;
- }
- else
- {
- return 1.0;
- }
+ return x < 0.5 ? 0.0 : 1.0;
}
- else if (Double.IsPositiveInfinity(_shapeA))
+
+ if (Double.IsPositiveInfinity(_shapeA))
{
- if (x < 1.0)
- {
- return 0.0;
- }
- else
- {
- return 1.0;
- }
+ return x < 1.0 ? 0.0 : 1.0;
}
- else if (Double.IsPositiveInfinity(_shapeB))
+
+ if (Double.IsPositiveInfinity(_shapeB))
{
- if (x >= 0.0)
- {
- return 1.0;
- }
- else
- {
- return 0.0;
- }
+ return x >= 0.0 ? 1.0 : 0.0;
}
- else if (_shapeA == 0.0 && _shapeB == 0.0)
+
+ if (_shapeA == 0.0 && _shapeB == 0.0)
{
if (x >= 0.0 && x < 1.0)
{
return 0.5;
}
- else
- {
- return 1.0;
- }
+
+ return 1.0;
}
- else if (_shapeA == 0.0)
+
+ if (_shapeA == 0.0)
{
return 1.0;
}
- else if (_shapeB == 0.0)
+
+ if (_shapeB == 0.0)
{
- if (x >= 1.0)
- {
- return 1.0;
- }
- else
- {
- return 0.0;
- }
+ return x >= 1.0 ? 1.0 : 0.0;
}
- else if (_shapeA == 1.0 && _shapeB == 1.0)
+
+ if (_shapeA == 1.0 && _shapeB == 1.0)
{
return x;
}
- else
- {
- return SpecialFunctions.BetaRegularized(_shapeA, _shapeB, x);
- }
+
+ return SpecialFunctions.BetaRegularized(_shapeA, _shapeB, x);
}
///
@@ -638,6 +584,7 @@ namespace MathNet.Numerics.Distributions
yield return SampleBeta(RandomSource, _shapeA, _shapeB);
}
}
+
#endregion
///
@@ -686,8 +633,8 @@ namespace MathNet.Numerics.Distributions
/// a random number from the Beta distribution.
internal static double SampleBeta(Random rnd, double a, double b)
{
- double x = Gamma.SampleGamma(rnd, a, 1.0);
- double y = Gamma.SampleGamma(rnd, b, 1.0);
+ var x = Gamma.SampleGamma(rnd, a, 1.0);
+ var y = Gamma.SampleGamma(rnd, b, 1.0);
return x / (x + y);
}
}
diff --git a/src/Numerics/Distributions/Continuous/Cauchy.cs b/src/Numerics/Distributions/Continuous/Cauchy.cs
new file mode 100644
index 00000000..531b6163
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Cauchy.cs
@@ -0,0 +1,348 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The Cauchy distribution is a symmetric continuous probability distribution. For details about this distribution, see
+ /// Wikipedia - Cauchy distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can get/set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Cauchy : IContinuousDistribution
+ {
+ ///
+ /// The scale of the Cauchy distribution.
+ ///
+ private double _scale;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class with the location parameter set to 0 and the scale parameter set to 1
+ ///
+ public Cauchy() : this(0, 1)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The location parameter for the distribution.
+ ///
+ ///
+ /// The scale parameter for the distribution.
+ ///
+ ///
+ /// If is negative.
+ ///
+ public Cauchy(double location, double scale)
+ {
+ SetParameters(location, scale);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// Location parameter.
+ /// Scale parameter. Must be greater than 0.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double location, double scale)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(location, scale))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ Median = location;
+ _scale = scale;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// Location parameter.
+ /// Scale parameter. Must be greater than 0.
+ /// True when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double location, double scale)
+ {
+ if (scale <= 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(location) || Double.IsNaN(scale))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the location parameter of the distribution.
+ ///
+ public double Location
+ {
+ get
+ {
+ return Median;
+ }
+
+ set
+ {
+ SetParameters(value, _scale);
+ }
+ }
+
+ ///
+ /// Gets or sets the scale parameter of the distribution.
+ ///
+ public double Scale
+ {
+ get
+ {
+ return _scale;
+ }
+
+ set
+ {
+ SetParameters(Median, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Cauchy(Location = " + Median + ", Scale = " + _scale + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return Math.Log(4.0 * Constants.Pi * _scale);
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return ((1.0 / Constants.Pi) * Math.Atan((x - Median) / _scale)) + 0.5;
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ return Median;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return Double.NegativeInfinity;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ return 1.0 / (Constants.Pi * _scale * (1.0 + (((x - Median) / _scale) * ((x - Median) / _scale))));
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return -Math.Log(Constants.Pi * _scale * (1.0 + (((x - Median) / _scale) * ((x - Median) / _scale))));
+ }
+
+ ///
+ /// Draws a random sample from the distribution.
+ ///
+ /// A random number from this distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource, Median, _scale);
+ }
+
+ ///
+ /// Generates a sequence of samples from the Cauchy distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, Median, _scale);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Samples the distribution.
+ ///
+ /// The random number generator to use.
+ /// The location shape parameter.
+ /// The scale parameter.
+ /// a random number from the distribution.
+ private static double DoSample(Random rnd, double location, double scale)
+ {
+ var u = rnd.NextDouble();
+ return location + (scale * Math.Tan(Constants.Pi * (u - 0.5)));
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/Chi.cs b/src/Numerics/Distributions/Continuous/Chi.cs
new file mode 100644
index 00000000..5bd6d011
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Chi.cs
@@ -0,0 +1,326 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// This class implements functionality for the Chi distribution. This distribution is
+ /// a continuous probability distribution. The distribution usually arises when a k-dimensional vector's orthogonal
+ /// components are independent and each follow a standard normal distribution. The length of the vector will
+ /// then have a chi distribution.
+ /// Wikipedia - Chi distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Chi : IContinuousDistribution
+ {
+ ///
+ /// Keeps track of the degrees of freedom for the Chi distribution.
+ ///
+ private double _dof;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The degrees of freedom for the Chi distribution.
+ ///
+ public Chi(double dof)
+ {
+ SetParameters(dof);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The degrees of freedom for the Chi distribution.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double dof)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(dof))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _dof = dof;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The degrees of freedom for the Chi distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double dof)
+ {
+ if (dof <= 0 || Double.IsNaN(dof))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the degrees of freedom of the Chi distribution.
+ ///
+ public double DegreesOfFreedom
+ {
+ get
+ {
+ return _dof;
+ }
+
+ set
+ {
+ SetParameters(value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Chi(DoF = " + _dof + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the distribution's random number generator.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ return Math.Sqrt(2) * (SpecialFunctions.Gamma((_dof + 1.0) / 2.0) / SpecialFunctions.Gamma(_dof / 2.0));
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return _dof - (Mean * Mean);
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(Variance);
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return SpecialFunctions.GammaLn(_dof / 2.0) + ((_dof - Math.Log(2) - ((_dof - 1.0) * SpecialFunctions.DiGamma(_dof / 2.0))) / 2.0);
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ var sigma = StdDev;
+ return (Mean * (1.0 - (2.0 * (sigma * sigma)))) / (sigma * sigma * sigma);
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return SpecialFunctions.GammaLowerIncomplete(_dof / 2.0, x * x / 2.0) / SpecialFunctions.Gamma(_dof / 2.0);
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ if (_dof < 1)
+ {
+ throw new NotSupportedException();
+ }
+
+ return Math.Sqrt(_dof - 1.0);
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ return (Math.Pow(2.0, 1.0 - (_dof / 2.0)) * Math.Pow(x, _dof - 1.0) * Math.Exp(-x * x / 2.0)) / SpecialFunctions.Gamma(_dof / 2.0);
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return ((1.0 - (_dof / 2.0)) * Math.Log(2.0)) + ((_dof - 1.0) * Math.Log(x)) - (x * x / 2.0) - SpecialFunctions.GammaLn(_dof / 2.0);
+ }
+
+ ///
+ /// Generates a sample from the Chi distribution.
+ ///
+ /// a sample from the distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource);
+ }
+
+ ///
+ /// Generates a sequence of samples from the Chi distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Samples the distribution.
+ ///
+ /// The random number generator to use.
+ /// a random number from the distribution.
+ private double DoSample(Random rnd)
+ {
+ double sum = 0;
+ var n = (int)_dof;
+ for (var i = 0; i < n; i++)
+ {
+ sum += Normal.Sample(rnd, 0.0, 1.0);
+ }
+
+ return Math.Sqrt(sum);
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/ChiSquare.cs b/src/Numerics/Distributions/Continuous/ChiSquare.cs
new file mode 100644
index 00000000..bdba56bf
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/ChiSquare.cs
@@ -0,0 +1,303 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// This class implements functionality for the ChiSquare distribution. This distribution is
+ /// a sum of the squares of k independent standard normal random variables.
+ /// Wikipedia - ChiSquare distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class ChiSquare : IContinuousDistribution
+ {
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The degrees of freedom for the ChiSquare distribution.
+ ///
+ public ChiSquare(double dof)
+ {
+ SetParameters(dof);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The degrees of freedom for the ChiSquare distribution.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double dof)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(dof))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ Mean = dof;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The degrees of freedom for the ChiSquare distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double dof)
+ {
+ return dof > 0 && !Double.IsNaN(dof);
+ }
+
+ ///
+ /// Gets or sets the degrees of freedom of the ChiSquare distribution.
+ ///
+ public double DegreesOfFreedom
+ {
+ get
+ {
+ return Mean;
+ }
+
+ set
+ {
+ SetParameters(value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "ChiSquare(DoF = " + Mean + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the distribution's random number generator.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get { return 2.0 * Mean; }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get { return Math.Sqrt(2.0 * Mean); }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get { return (Mean / 2.0) + Math.Log(2.0 * SpecialFunctions.Gamma(Mean / 2.0)) + ((1.0 - (Mean / 2.0)) * SpecialFunctions.DiGamma(Mean / 2.0)); }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get { return Math.Sqrt(8.0 / Mean); }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return SpecialFunctions.GammaUpperIncomplete(Mean / 2.0, x / 2.0) / SpecialFunctions.Gamma(Mean / 2.0);
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get { return Mean - 2.0; }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get { return Mean - (2.0 / 3.0); }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get { return 0.0; }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get { return double.PositiveInfinity; }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ return (Math.Pow(x, (Mean / 2.0) - 1.0) * Math.Exp(-x / 2.0)) / (Math.Pow(2.0, Mean / 2.0) * SpecialFunctions.Gamma(Mean / 2.0));
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return (-x / 2.0) + (((Mean / 2.0) - 1.0) * Math.Log(x)) - ((Mean / 2.0) * Math.Log(2)) - SpecialFunctions.GammaLn(Mean / 2.0);
+ }
+
+ ///
+ /// Generates a sample from the ChiSquare distribution.
+ ///
+ /// a sample from the distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource, Mean);
+ }
+
+ ///
+ /// Generates a sequence of samples from the ChiSquare distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, Mean);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Samples the distribution.
+ ///
+ /// The random number generator to use.
+ /// The degrees of freedom.
+ /// a random number from the distribution.
+ private static double DoSample(Random rnd, double dof)
+ {
+ double sum = 0;
+ var n = (int)dof;
+ for (var i = 0; i < n; i++)
+ {
+ sum += Normal.Sample(rnd, 0.0, 1.0);
+ }
+
+ return sum;
+ }
+
+ ///
+ /// Generates a sample from the ChiSquare distribution.
+ ///
+ /// The random number generator to use.
+ /// The degrees of freedom.
+ /// a sample from the distribution.
+ public static double Sample(Random rnd, double dof)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(dof))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ return DoSample(rnd, dof);
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/ContinuousUniform.cs b/src/Numerics/Distributions/Continuous/ContinuousUniform.cs
index e28011bd..25701c89 100644
--- a/src/Numerics/Distributions/Continuous/ContinuousUniform.cs
+++ b/src/Numerics/Distributions/Continuous/ContinuousUniform.cs
@@ -42,7 +42,7 @@ namespace MathNet.Numerics.Distributions
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class ContinuousUniform : IContinuousDistribution
{
///
@@ -93,7 +93,7 @@ namespace MathNet.Numerics.Distributions
///
/// Lower bound.
/// Upper bound; must be at least as large as .
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double lower, double upper)
{
if (upper < lower)
@@ -310,7 +310,7 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Generates a sample from the ContinuousUniform distribution.
+ /// Generates a sample from the ContinuousUniform distribution.
///
/// a sample from the distribution.
public double Sample()
@@ -319,7 +319,7 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Generates a sequence of samples from the ContinuousUniform distribution.
+ /// Generates a sequence of samples from the ContinuousUniform distribution.
///
/// a sequence of samples from the distribution.
public IEnumerable Samples()
@@ -333,7 +333,7 @@ namespace MathNet.Numerics.Distributions
#endregion
///
- /// Generates a sample from the ContinuousUniform distribution.
+ /// Generates a sample from the ContinuousUniform distribution.
///
/// The random number generator to use.
/// The lower bound of the uniform random variable.
@@ -350,7 +350,7 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Generates a sequence of samples from the ContinuousUniform distribution.
+ /// Generates a sequence of samples from the ContinuousUniform distribution.
///
/// The random number generator to use.
/// The lower bound of the uniform random variable.
@@ -370,7 +370,7 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Generates one sample from the ContinuousUniform distribution without parameter checking.
+ /// Generates one sample from the ContinuousUniform distribution without parameter checking.
///
/// The random number generator to use.
/// The lower bound of the uniform random variable.
diff --git a/src/Numerics/Distributions/Continuous/Erlang.cs b/src/Numerics/Distributions/Continuous/Erlang.cs
new file mode 100644
index 00000000..8e8057a4
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Erlang.cs
@@ -0,0 +1,534 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// This class implements functionality for the Erlang distribution. This distribution is
+ /// is a continuous probability distribution with wide applicability primarily due to its
+ /// relation to the exponential and Gamma distributions.
+ /// Wikipedia - Erlang distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Erlang : IContinuousDistribution
+ {
+ ///
+ /// Erlang shape parameter.
+ ///
+ private double _shape;
+
+ ///
+ /// Erlang inverse scale parameter.
+ ///
+ private double _invScale;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The shape of the Erlang distribution.
+ ///
+ ///
+ /// The inverse scale of the Erlang distribution.
+ ///
+ public Erlang(int shape, double invScale)
+ {
+ SetParameters(shape, invScale);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Constructs a Erlang distribution from a shape and scale parameter. The distribution will
+ /// be initialized with the default random number generator.
+ ///
+ /// The shape of the Erlang distribution.
+ /// The scale of the Erlang distribution.
+ /// a normal distribution.
+ public static Erlang WithShapeScale(int shape, double scale)
+ {
+ return new Erlang(shape, 1.0 / scale);
+ }
+
+ ///
+ /// Constructs a Erlang distribution from a shape and inverse scale parameter. The distribution will
+ /// be initialized with the default random number generator.
+ ///
+ /// The shape of the Erlang distribution.
+ /// The inverse scale of the Erlang distribution.
+ /// a normal distribution.
+ public static Erlang WithShapeInvScale(int shape, double invScale)
+ {
+ return new Erlang(shape, invScale);
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The shape of the Erlang distribution.
+ /// The inverse scale of the Erlang distribution.
+ private void SetParameters(double shape, double invScale)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(shape, invScale))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _shape = shape;
+ _invScale = invScale;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The shape of the Erlang distribution.
+ /// The inverse scale of the Erlang distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double shape, double invScale)
+ {
+ if (shape < 0.0 || invScale < 0.0 || Double.IsNaN(shape) || Double.IsNaN(invScale))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the shape of the Erlang distribution.
+ ///
+ public int Shape
+ {
+ get
+ {
+ return (int)_shape;
+ }
+
+ set
+ {
+ SetParameters(value, _invScale);
+ }
+ }
+
+ ///
+ /// Gets or sets the scale of the Erlang distribution.
+ ///
+ public double Scale
+ {
+ get
+ {
+ return 1.0 / _invScale;
+ }
+
+ set
+ {
+ var invScale = 1.0 / value;
+
+ if (Double.IsNegativeInfinity(invScale))
+ {
+ invScale = -invScale;
+ }
+
+ SetParameters(_shape, invScale);
+ }
+ }
+
+ ///
+ /// Gets or sets the inverse scale of the Erlang distribution.
+ ///
+ public double InvScale
+ {
+ get
+ {
+ return _invScale;
+ }
+
+ set
+ {
+ SetParameters(_shape, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Erlang(Shape = " + _shape + ", Inverse Scale = " + _invScale + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return _shape;
+ }
+
+ if (_invScale == 0.0 && _shape == 0.0)
+ {
+ return Double.NaN;
+ }
+
+ return _shape / _invScale;
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return 0.0;
+ }
+
+ if (_invScale == 0.0 && _shape == 0.0)
+ {
+ return Double.NaN;
+ }
+
+ return _shape / (_invScale * _invScale);
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return 0.0;
+ }
+
+ if (_invScale == 0.0 && _shape == 0.0)
+ {
+ return Double.NaN;
+ }
+
+ return Math.Sqrt(_shape) / _invScale;
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return 0.0;
+ }
+
+ if (_invScale == 0.0 && _shape == 0.0)
+ {
+ return Double.NaN;
+ }
+
+ return _shape - Math.Log(_invScale) + SpecialFunctions.GammaLn(_shape) + ((1.0 - _shape) * SpecialFunctions.DiGamma(_shape));
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return 0.0;
+ }
+
+ if (_invScale == 0.0 && _shape == 0.0)
+ {
+ return Double.NaN;
+ }
+
+ return 2.0 / Math.Sqrt(_shape);
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the Erlang distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return x >= _shape ? 1.0 : 0.0;
+ }
+
+ if (_shape == 0.0 && _invScale == 0.0)
+ {
+ return 0.0;
+ }
+
+ return SpecialFunctions.GammaLowerRegularized(_shape, x * _invScale);
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ if (_shape < 1)
+ {
+ throw new NotSupportedException();
+ }
+
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return _shape;
+ }
+
+ if (_invScale == 0.0 && _shape == 0.0)
+ {
+ return Double.NaN;
+ }
+
+ return (_shape - 1.0) / _invScale;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the minimum value.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Gets the Maximum value.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return x == _shape ? Double.PositiveInfinity : 0.0;
+ }
+
+ if (_shape == 0.0 && _invScale == 0.0)
+ {
+ return 0.0;
+ }
+
+ if (_shape == 1.0)
+ {
+ return _invScale * Math.Exp(-_invScale * x);
+ }
+
+ return Math.Pow(_invScale, _shape) * Math.Pow(x, _shape - 1.0) * Math.Exp(-_invScale * x) / SpecialFunctions.Gamma(_shape);
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double DensityLn(double x)
+ {
+ if (Double.IsPositiveInfinity(_invScale))
+ {
+ return x == _shape ? Double.PositiveInfinity : Double.NegativeInfinity;
+ }
+
+ if (_shape == 0.0 && _invScale == 0.0)
+ {
+ return Double.NegativeInfinity;
+ }
+
+ if (_shape == 1.0)
+ {
+ return Math.Log(_invScale) - (_invScale * x);
+ }
+
+ return (_shape * Math.Log(_invScale)) + ((_shape - 1.0) * Math.Log(x)) - (_invScale * x) - SpecialFunctions.GammaLn(_shape);
+ }
+
+ ///
+ /// Generates a sample from the Erlang distribution.
+ ///
+ /// a sample from the distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource, _shape, _invScale);
+ }
+
+ ///
+ /// Generates a sequence of samples from the Erlang distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _shape, _invScale);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Sampling implementation based on:
+ /// "A Simple Method for Generating Erlang Variables" - Marsaglia & Tsang
+ /// ACM Transactions on Mathematical Software, Vol. 26, No. 3, September 2000, Pages 363–372.
+ /// This method performs no parameter checks.
+ ///
+ /// The random number generator to use.
+ /// The shape of the Gamma distribution.
+ /// The inverse scale of the Gamma distribution.
+ /// A sample from a Erlang distributed random variable.
+ private static double DoSample(Random rnd, double shape, double invScale)
+ {
+ if (Double.IsPositiveInfinity(invScale))
+ {
+ return shape;
+ }
+
+ var a = shape;
+ var alphafix = 1.0;
+
+ // Fix when alpha is less than one.
+ if (shape < 1.0)
+ {
+ a = shape + 1.0;
+ alphafix = Math.Pow(rnd.NextDouble(), 1.0 / shape);
+ }
+
+ var d = a - (1.0 / 3.0);
+ var c = 1.0 / Math.Sqrt(9.0 * d);
+ while (true)
+ {
+ var x = Normal.Sample(rnd, 0.0, 1.0);
+ var v = 1.0 + (c * x);
+ while (v <= 0.0)
+ {
+ x = Normal.Sample(rnd, 0.0, 1.0);
+ v = 1.0 + (c * x);
+ }
+
+ v = v * v * v;
+ var u = rnd.NextDouble();
+ x = x * x;
+ if (u < 1.0 - (0.0331 * x * x))
+ {
+ return alphafix * d * v / invScale;
+ }
+
+ if (Math.Log(u) < (0.5 * x) + (d * (1.0 - v + Math.Log(v))))
+ {
+ return alphafix * d * v / invScale;
+ }
+ }
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/Exponential.cs b/src/Numerics/Distributions/Continuous/Exponential.cs
new file mode 100644
index 00000000..19267e2c
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Exponential.cs
@@ -0,0 +1,332 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The exponential distribution is a distribution over the real numbers parameterized by one non-negative parameter.
+ /// Wikipedia - exponential distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Exponential : IContinuousDistribution
+ {
+ ///
+ /// The lambda parameter of the Exponential distribution.
+ ///
+ private double _lambda;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The lambda parameter of the Exponential distribution.
+ ///
+ public Exponential(double lambda)
+ {
+ SetParameters(lambda);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// Lambda parameter.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double lambda)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(lambda))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _lambda = lambda;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// Lambda parameter.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double lambda)
+ {
+ if (lambda < 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(lambda))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the lambda parameter of the distribution.
+ ///
+ public double Lambda
+ {
+ get
+ {
+ return _lambda;
+ }
+
+ set
+ {
+ SetParameters(value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Exponential(Lambda = " + _lambda + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ return 1.0 / _lambda;
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return 1.0 / (_lambda * _lambda);
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return 1.0 / _lambda;
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return 1.0 - Math.Log(_lambda);
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ return 2.0;
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ if (x >= 0.0)
+ {
+ return 1.0 - Math.Exp(-_lambda * x);
+ }
+
+ return 0.0;
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get
+ {
+ return Math.Log(2.0) / _lambda;
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ if (x >= 0.0)
+ {
+ return _lambda * Math.Exp(-_lambda * x);
+ }
+
+ return 0.0;
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return Math.Log(_lambda) - (_lambda * x);
+ }
+
+ ///
+ /// Draws a random sample from the distribution.
+ ///
+ /// A random number from this distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource, _lambda);
+ }
+
+ ///
+ /// Generates a sequence of samples from the Exponential distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _lambda);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Samples the distribution.
+ ///
+ /// The random number generator to use.
+ /// The lambda parameter of the Exponential distribution.
+ /// a random number from the distribution.
+ private static double DoSample(Random rnd, double lambda)
+ {
+ var r = rnd.NextDouble();
+ while (r == 0.0)
+ {
+ r = rnd.NextDouble();
+ }
+
+ return -Math.Log(r) / lambda;
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/FisherSnedecor.cs b/src/Numerics/Distributions/Continuous/FisherSnedecor.cs
new file mode 100644
index 00000000..bd7090ea
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/FisherSnedecor.cs
@@ -0,0 +1,363 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// Implements the FisherSnedecor distribution. For details about this distribution, see
+ /// Wikipedia - FisherSnedecor distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class FisherSnedecor : IContinuousDistribution
+ {
+ ///
+ /// The first parameter - degree of freedom.
+ ///
+ private double _d1;
+
+ ///
+ /// The second parameter - degree of freedom.
+ ///
+ private double _d2;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The first parameter - degree of freedom.
+ ///
+ ///
+ /// The second parameter - degree of freedom.
+ ///
+ public FisherSnedecor(double d1, double d2)
+ {
+ SetParameters(d1, d2);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The first parameter - degree of freedom.
+ /// The second parameter - degree of freedom.
+ private void SetParameters(double d1, double d2)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(d1, d2))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _d1 = d1;
+ _d2 = d2;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The first parameter - degree of freedom.
+ /// The second parameter - degree of freedom.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double d1, double d2)
+ {
+ if (d1 <= 0 || d2 <= 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(d1) || Double.IsNaN(d2))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the first parameter - degree of freedom.
+ ///
+ public double DegreeOfFreedom1
+ {
+ get
+ {
+ return _d1;
+ }
+
+ set
+ {
+ SetParameters(value, _d2);
+ }
+ }
+
+ ///
+ /// Gets or sets the second parameter - degree of freedom.
+ ///
+ public double DegreeOfFreedom2
+ {
+ get
+ {
+ return _d2;
+ }
+
+ set
+ {
+ SetParameters(_d1, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "FisherSnedecor(DegreeOfFreedom1 = " + _d1 + ", DegreeOfFreedom2 = " + _d2 + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the distribution's random number generator.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException(Resources.InvalidDistributionParameters);
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ if (_d2 <= 2)
+ {
+ throw new NotSupportedException();
+ }
+
+ return _d2 / (_d2 - 2.0);
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ if (_d2 <= 4)
+ {
+ throw new NotSupportedException();
+ }
+
+ return (2.0 * _d2 * _d2 * (_d1 + _d2 - 2.0)) / (_d1 * (_d2 - 2.0) * (_d2 - 2.0) * (_d2 - 4.0));
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(Variance);
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ if (_d2 <= 6)
+ {
+ throw new NotSupportedException();
+ }
+
+ return (((2.0 * _d1) + _d2 - 2.0) * Math.Sqrt(8.0 * (_d2 - 4.0))) / ((_d2 - 6.0) * Math.Sqrt(_d1 * (_d1 + _d2 - 2.0)));
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return SpecialFunctions.BetaRegularized(_d1 / 2.0, _d2 / 2.0, _d1 * _d2 / (_d1 + (_d1 * _d2)));
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ if (_d1 <= 2)
+ {
+ throw new NotSupportedException();
+ }
+
+ return (_d2 * (_d1 - 2.0)) / (_d1 * (_d2 + 2.0));
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ return Math.Sqrt(Math.Pow(_d1 * x, _d1) * Math.Pow(_d2, _d2) / Math.Pow((_d1 * x) + _d2, _d1 + _d2)) / (x * SpecialFunctions.Beta(_d1 / 2.0, _d2 / 2.0));
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return Math.Log(Density(x));
+ }
+
+ ///
+ /// Generates a sample from the FisherSnedecor distribution.
+ ///
+ /// a sample from the distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource, _d1, _d2);
+ }
+
+ ///
+ /// Generates a sequence of samples from the FisherSnedecor distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _d1, _d2);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Generates one sample from the FisherSnedecor distribution without parameter checking.
+ ///
+ /// The random number generator to use.
+ /// The first parameter - degree of freedom.
+ /// The second parameter - degree of freedom.
+ /// a FisherSnedecor distributed random number.
+ private static double DoSample(Random rnd, double d1, double d2)
+ {
+ return (ChiSquare.Sample(rnd, d1) / d1) / (ChiSquare.Sample(rnd, d2) / d2);
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/Gamma.cs b/src/Numerics/Distributions/Continuous/Gamma.cs
index 0c87d39e..39a11a86 100644
--- a/src/Numerics/Distributions/Continuous/Gamma.cs
+++ b/src/Numerics/Distributions/Continuous/Gamma.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -50,7 +46,7 @@ namespace MathNet.Numerics.Distributions
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Gamma : IContinuousDistribution
{
///
@@ -88,7 +84,7 @@ namespace MathNet.Numerics.Distributions
/// a normal distribution.
public static Gamma WithShapeScale(double shape, double scale)
{
- return new Gamma(shape, 1.0/scale);
+ return new Gamma(shape, 1.0 / scale);
}
///
@@ -117,7 +113,7 @@ namespace MathNet.Numerics.Distributions
///
/// The shape of the Gamma distribution.
/// The inverse scale of the Gamma distribution.
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double shape, double invScale)
{
if (shape < 0.0 || invScale < 0.0 || Double.IsNaN(shape) || Double.IsNaN(invScale))
@@ -173,11 +169,11 @@ namespace MathNet.Numerics.Distributions
set
{
- double invScale = 1.0/value;
+ var invScale = 1.0 / value;
- if(Double.IsNegativeInfinity(invScale))
+ if (Double.IsNegativeInfinity(invScale))
{
- invScale = - invScale;
+ invScale = -invScale;
}
SetParameters(_shape, invScale);
@@ -234,14 +230,13 @@ namespace MathNet.Numerics.Distributions
{
return _shape;
}
- else if(_invScale == 0.0 && _shape == 0.0)
+
+ if (_invScale == 0.0 && _shape == 0.0)
{
return Double.NaN;
}
- else
- {
- return _shape / _invScale;
- }
+
+ return _shape / _invScale;
}
}
@@ -256,14 +251,13 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (_invScale == 0.0 && _shape == 0.0)
+
+ if (_invScale == 0.0 && _shape == 0.0)
{
return Double.NaN;
}
- else
- {
- return _shape / (_invScale * _invScale);
- }
+
+ return _shape / (_invScale * _invScale);
}
}
@@ -278,14 +272,13 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (_invScale == 0.0 && _shape == 0.0)
+
+ if (_invScale == 0.0 && _shape == 0.0)
{
return Double.NaN;
}
- else
- {
- return Math.Sqrt(_shape / (_invScale * _invScale));
- }
+
+ return Math.Sqrt(_shape / (_invScale * _invScale));
}
}
@@ -300,14 +293,13 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (_invScale == 0.0 && _shape == 0.0)
+
+ if (_invScale == 0.0 && _shape == 0.0)
{
return Double.NaN;
}
- else
- {
- return _shape - Math.Log(_invScale) + SpecialFunctions.GammaLn(_shape) + ((1.0 - _shape) * SpecialFunctions.DiGamma(_shape));
- }
+
+ return _shape - Math.Log(_invScale) + SpecialFunctions.GammaLn(_shape) + ((1.0 - _shape) * SpecialFunctions.DiGamma(_shape));
}
}
@@ -322,16 +314,16 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (_invScale == 0.0 && _shape == 0.0)
+
+ if (_invScale == 0.0 && _shape == 0.0)
{
return Double.NaN;
}
- else
- {
- return 2.0 / Math.Sqrt(_shape);
- }
+
+ return 2.0 / Math.Sqrt(_shape);
}
}
+
#endregion
#region IContinuousDistribution implementation
@@ -347,14 +339,13 @@ namespace MathNet.Numerics.Distributions
{
return _shape;
}
- else if (_invScale == 0.0 && _shape == 0.0)
+
+ if (_invScale == 0.0 && _shape == 0.0)
{
return Double.NaN;
}
- else
- {
- return (_shape - 1.0) / _invScale;
- }
+
+ return (_shape - 1.0) / _invScale;
}
}
@@ -363,7 +354,10 @@ namespace MathNet.Numerics.Distributions
///
public double Median
{
- get { throw new NotSupportedException(); }
+ get
+ {
+ throw new NotSupportedException();
+ }
}
///
@@ -371,7 +365,10 @@ namespace MathNet.Numerics.Distributions
///
public double Minimum
{
- get { return 0.0; }
+ get
+ {
+ return 0.0;
+ }
}
///
@@ -379,7 +376,10 @@ namespace MathNet.Numerics.Distributions
///
public double Maximum
{
- get { return Double.PositiveInfinity; }
+ get
+ {
+ return Double.PositiveInfinity;
+ }
}
///
@@ -391,27 +391,20 @@ namespace MathNet.Numerics.Distributions
{
if (Double.IsPositiveInfinity(_invScale))
{
- if (x == _shape)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return 0.0;
- }
+ return x == _shape ? Double.PositiveInfinity : 0.0;
}
- else if (_shape == 0.0 && _invScale == 0.0)
+
+ if (_shape == 0.0 && _invScale == 0.0)
{
return 0.0;
}
- else if (_shape == 1.0)
+
+ if (_shape == 1.0)
{
- return _invScale * Math.Exp(- _invScale * x);
+ return _invScale * Math.Exp(-_invScale * x);
}
- else
- {
- return Math.Pow(_invScale, _shape) * Math.Pow(x, _shape - 1.0) * Math.Exp(-_invScale * x) / SpecialFunctions.Gamma(_shape);
- }
+
+ return Math.Pow(_invScale, _shape) * Math.Pow(x, _shape - 1.0) * Math.Exp(-_invScale * x) / SpecialFunctions.Gamma(_shape);
}
///
@@ -423,27 +416,20 @@ namespace MathNet.Numerics.Distributions
{
if (Double.IsPositiveInfinity(_invScale))
{
- if (x == _shape)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NegativeInfinity;
- }
+ return x == _shape ? Double.PositiveInfinity : Double.NegativeInfinity;
}
- else if(_shape == 0.0 && _invScale == 0.0)
+
+ if (_shape == 0.0 && _invScale == 0.0)
{
return Double.NegativeInfinity;
}
- else if(_shape == 1.0)
+
+ if (_shape == 1.0)
{
return Math.Log(_invScale) - (_invScale * x);
}
- else
- {
- return (_shape * Math.Log(_invScale)) + ((_shape - 1.0) * Math.Log(x)) - (_invScale * x) - SpecialFunctions.GammaLn(_shape);
- }
+
+ return (_shape * Math.Log(_invScale)) + ((_shape - 1.0) * Math.Log(x)) - (_invScale * x) - SpecialFunctions.GammaLn(_shape);
}
///
@@ -455,23 +441,15 @@ namespace MathNet.Numerics.Distributions
{
if (Double.IsPositiveInfinity(_invScale))
{
- if (x >= _shape)
- {
- return 1.0;
- }
- else
- {
- return 0.0;
- }
+ return x >= _shape ? 1.0 : 0.0;
}
- else if (_shape == 0.0 && _invScale == 0.0)
+
+ if (_shape == 0.0 && _invScale == 0.0)
{
return 0.0;
}
- else
- {
- return SpecialFunctions.GammaLowerRegularized(_shape, x * _invScale);
- }
+
+ return SpecialFunctions.GammaLowerRegularized(_shape, x * _invScale);
}
///
@@ -494,6 +472,7 @@ namespace MathNet.Numerics.Distributions
yield return SampleGamma(RandomSource, _shape, _invScale);
}
}
+
#endregion
///
@@ -543,48 +522,46 @@ namespace MathNet.Numerics.Distributions
/// The shape of the Gamma distribution.
/// The inverse scale of the Gamma distribution.
/// A sample from a Gamma distributed random variable.
- internal static double SampleGamma(System.Random rnd, double shape, double invScale)
+ internal static double SampleGamma(Random rnd, double shape, double invScale)
{
if (Double.IsPositiveInfinity(invScale))
{
return shape;
}
- else
+
+ var a = shape;
+ var alphafix = 1.0;
+
+ // Fix when alpha is less than one.
+ if (shape < 1.0)
+ {
+ a = shape + 1.0;
+ alphafix = Math.Pow(rnd.NextDouble(), 1.0 / shape);
+ }
+
+ var d = a - (1.0 / 3.0);
+ var c = 1.0 / Math.Sqrt(9.0 * d);
+ while (true)
{
- double a = shape;
- double alphafix = 1.0;
+ var x = Normal.Sample(rnd, 0.0, 1.0);
+ var v = 1.0 + (c * x);
+ while (v <= 0.0)
+ {
+ x = Normal.Sample(rnd, 0.0, 1.0);
+ v = 1.0 + (c * x);
+ }
- // Fix when alpha is less than one.
- if (shape < 1.0)
+ v = v * v * v;
+ var u = rnd.NextDouble();
+ x = x * x;
+ if (u < 1.0 - (0.0331 * x * x))
{
- a = shape + 1.0;
- alphafix = System.Math.Pow(rnd.NextDouble(), 1.0 / shape);
+ return alphafix * d * v / invScale;
}
- double d = a - (1.0 / 3.0);
- double c = 1.0 / System.Math.Sqrt(9.0 * d);
- while (true)
+ if (Math.Log(u) < (0.5 * x) + (d * (1.0 - v + Math.Log(v))))
{
- double x = Normal.Sample(rnd, 0.0, 1.0);
- double v = 1.0 + (c * x);
- while (v <= 0.0)
- {
- x = Normal.Sample(rnd, 0.0, 1.0);
- v = 1.0 + (c * x);
- }
-
- v = v * v * v;
- double u = rnd.NextDouble();
- x = x * x;
- if (u < 1.0 - (0.0331 * x * x))
- {
- return alphafix * d * v / invScale;
- }
-
- if (System.Math.Log(u) < (0.5 * x) + (d * (1.0 - v + System.Math.Log(v))))
- {
- return alphafix * d * v / invScale;
- }
+ return alphafix * d * v / invScale;
}
}
}
diff --git a/src/Numerics/Distributions/Continuous/InverseGamma.cs b/src/Numerics/Distributions/Continuous/InverseGamma.cs
new file mode 100644
index 00000000..c4963772
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/InverseGamma.cs
@@ -0,0 +1,378 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The inverse Gamma distribution is a distribution over the positive real numbers parameterized by
+ /// two positive parameters.
+ /// Wikipedia - InverseGamma distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class InverseGamma : IContinuousDistribution
+ {
+ ///
+ /// Inverse Gamma shape parameter.
+ ///
+ private double _shape;
+
+ ///
+ /// Inverse Gamma scale parameter scale.
+ ///
+ private double _scale;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The shape (alpha) parameter of the inverse Gamma distribution.
+ ///
+ ///
+ /// The scale (beta) parameter of the inverse Gamma distribution.
+ ///
+ public InverseGamma(double shape, double scale)
+ {
+ SetParameters(shape, scale);
+ _random = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ ///
+ /// The shape (alpha) parameter of the inverse Gamma distribution.
+ ///
+ ///
+ /// The scale (beta) parameter of the inverse Gamma distribution.
+ ///
+ /// When the parameters don't pass the function.
+ private void SetParameters(double shape, double scale)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(shape, scale))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _shape = shape;
+ _scale = scale;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ ///
+ /// The shape (alpha) parameter of the inverse Gamma distribution.
+ ///
+ ///
+ /// The scale (beta) parameter of the inverse Gamma distribution.
+ ///
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double shape, double scale)
+ {
+ if (shape <= 0 || scale <= 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(shape) || Double.IsNaN(scale))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the shape (alpha) parameter.
+ ///
+ public double Shape
+ {
+ get
+ {
+ return _shape;
+ }
+
+ set
+ {
+ SetParameters(value, _scale);
+ }
+ }
+
+ ///
+ /// Gets or sets The scale (beta) parameter.
+ ///
+ public double Scale
+ {
+ get
+ {
+ return _scale;
+ }
+
+ set
+ {
+ SetParameters(_shape, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "InverseGamma(Shape = " + _shape + ", Inverse Scale = " + _scale + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ if (_shape <= 1)
+ {
+ throw new NotSupportedException();
+ }
+
+ return _scale / (_shape - 1.0);
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ if (_shape <= 2)
+ {
+ throw new NotSupportedException();
+ }
+
+ return _scale * _scale / ((_shape - 1.0) * (_shape - 1.0) * (_shape - 2.0));
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return _scale / (Math.Abs(_shape - 1.0) * Math.Sqrt(_shape - 2.0));
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return _shape + Math.Log(_scale) + SpecialFunctions.GammaLn(_shape) - ((1 + _shape) * SpecialFunctions.DiGamma(_shape));
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ if (_shape <= 3)
+ {
+ throw new NotSupportedException();
+ }
+
+ return (4 * Math.Sqrt(_shape - 2)) / (_shape - 3);
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return SpecialFunctions.GammaLowerIncomplete(_shape, _scale / x);
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ return _scale / (_shape + 1.0);
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ /// Throws .
+ public double Median
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ if (x >= 0.0)
+ {
+ return Math.Pow(_scale, _shape) * Math.Pow(x, -_shape - 1.0) * Math.Exp(-_scale / x) / SpecialFunctions.Gamma(_shape);
+ }
+
+ return 0.0;
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return Math.Log(Density(x));
+ }
+
+ ///
+ /// Draws a random sample from the distribution.
+ ///
+ /// A random number from this distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource, _shape, _scale);
+ }
+
+ ///
+ /// Generates a sequence of samples from the Cauchy distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _shape, _scale);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Samples the distribution.
+ ///
+ /// The random number generator to use.
+ ///
+ /// The shape (alpha) parameter of the inverse Gamma distribution.
+ ///
+ ///
+ /// The scale (beta) parameter of the inverse Gamma distribution.
+ ///
+ /// a random number from the distribution.
+ private static double DoSample(Random rnd, double shape, double scale)
+ {
+ return 1.0 / Gamma.Sample(rnd, shape, scale);
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/Laplace.cs b/src/Numerics/Distributions/Continuous/Laplace.cs
new file mode 100644
index 00000000..f822fbfe
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Laplace.cs
@@ -0,0 +1,350 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The Laplace distribution is a distribution over the real numbers parameterized by a mean and
+ /// scale parameter. The PDF is:
+ /// p(x) = \frac{1}{2 * scale} \exp{- |x - mean| / scale}.
+ /// Wikipedia - Laplace distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Laplace : IContinuousDistribution
+ {
+ ///
+ /// The scale of the Laplace distribution.
+ ///
+ private double _scale;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Gets or sets the location of the Laplace distribution.
+ ///
+ public double Location
+ {
+ get
+ {
+ return Mean;
+ }
+
+ set
+ {
+ SetParameters(value, _scale);
+ }
+ }
+
+ ///
+ /// Gets or sets the scale of the Laplace distribution.
+ ///
+ public double Scale
+ {
+ get
+ {
+ return _scale;
+ }
+
+ set
+ {
+ SetParameters(Mean, value);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class (location = 0, scale = 1).
+ ///
+ public Laplace() : this(0.0, 1.0)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The location for the Laplace distribution.
+ ///
+ ///
+ /// The scale for the Laplace distribution.
+ ///
+ ///
+ /// If is negative.
+ ///
+ public Laplace(double location, double scale)
+ {
+ SetParameters(location, scale);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The location for the Laplace distribution.
+ /// The scale for the Laplace distribution.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double location, double scale)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(location, scale))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ Mean = location;
+ _scale = scale;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The location for the Laplace distribution.
+ /// The scale for the Laplace distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double location, double scale)
+ {
+ if (scale <= 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(location) || Double.IsNaN(scale))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Laplace(Location = " + Mean + ", Scale = " + _scale + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get;
+ private set;
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return 2.0 * _scale * _scale;
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(2.0) * _scale;
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return Math.Log(2.0 * Constants.E * _scale);
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return 0.5 * (1.0 + (Math.Sign(x - Mean) * (1.0 - Math.Exp(-Math.Abs(x - Mean) / _scale))));
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ return Mean;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get
+ {
+ return Mean;
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return Double.NegativeInfinity;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ return Math.Exp(-Math.Abs(x - Mean) / _scale) / (2.0 * _scale);
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return Math.Log(Density(x));
+ }
+
+ ///
+ /// Samples a Laplace distributed random variable.
+ ///
+ /// a sample from the distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource, Mean, _scale);
+ }
+
+ ///
+ /// Generates a sample from the Laplace distribution.
+ ///
+ /// a sample from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, Mean, _scale);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Samples the distribution.
+ ///
+ /// The random number generator to use.
+ /// The location shape parameter.
+ /// The scale parameter.
+ /// a random number from the distribution.
+ private static double DoSample(Random rnd, double location, double scale)
+ {
+ var u = rnd.NextDouble() - 0.5;
+ return location - (scale * Math.Sign(u) * Math.Log(1.0 - (2.0 * Math.Abs(u))));
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/LogNormal.cs b/src/Numerics/Distributions/Continuous/LogNormal.cs
index 7566a9a9..1c723281 100644
--- a/src/Numerics/Distributions/Continuous/LogNormal.cs
+++ b/src/Numerics/Distributions/Continuous/LogNormal.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -42,7 +38,7 @@ namespace MathNet.Numerics.Distributions
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class LogNormal : IContinuousDistribution
{
///
@@ -61,11 +57,16 @@ namespace MathNet.Numerics.Distributions
private Random _random;
///
- /// Initializes a new instance of the Log-Normal class. The distribution will
- /// be initialized with the default random number generator.
+ /// Initializes a new instance of the class.
+ /// The distribution will be initialized with the default
+ /// random number generator.
///
- /// The mu of the logarithm of the distribution.
- /// The standard deviation of the logarithm of the distribution.
+ ///
+ /// The mu of the logarithm of the distribution.
+ ///
+ ///
+ /// The standard deviation of the logarithm of the distribution.
+ ///
public LogNormal(double mu, double sigma)
{
SetParameters(mu, sigma);
@@ -86,7 +87,7 @@ namespace MathNet.Numerics.Distributions
///
/// The mu of the logarithm of the distribution.
/// The standard deviation of the logarithm of the distribution.
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double mu, double sigma)
{
if (sigma < 0.0 || Double.IsNaN(mu) || Double.IsNaN(mu) || Double.IsNaN(sigma))
@@ -119,9 +120,15 @@ namespace MathNet.Numerics.Distributions
///
public double Mu
{
- get { return _mu; }
+ get
+ {
+ return _mu;
+ }
- set { SetParameters(value, _sigma); }
+ set
+ {
+ SetParameters(value, _sigma);
+ }
}
///
@@ -129,9 +136,15 @@ namespace MathNet.Numerics.Distributions
///
public double Sigma
{
- get { return _sigma; }
+ get
+ {
+ return _sigma;
+ }
- set { SetParameters(_mu, value); }
+ set
+ {
+ SetParameters(_mu, value);
+ }
}
#region IDistribution implementation
@@ -162,7 +175,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mean
{
- get { return Math.Exp(_mu + _sigma * _sigma / 2.0); }
+ get
+ {
+ return Math.Exp(_mu + (_sigma * _sigma / 2.0));
+ }
}
///
@@ -172,7 +188,7 @@ namespace MathNet.Numerics.Distributions
{
get
{
- double sigma2 = _sigma * _sigma;
+ var sigma2 = _sigma * _sigma;
return (Math.Exp(sigma2) - 1.0) * Math.Exp(_mu + _mu + sigma2);
}
}
@@ -184,7 +200,7 @@ namespace MathNet.Numerics.Distributions
{
get
{
- double sigma2 = _sigma * _sigma;
+ var sigma2 = _sigma * _sigma;
return Math.Sqrt((Math.Exp(sigma2) - 1.0) * Math.Exp(_mu + _mu + sigma2));
}
}
@@ -194,7 +210,10 @@ namespace MathNet.Numerics.Distributions
///
public double Entropy
{
- get { return 0.5 + Math.Log(_sigma) + _mu + Constants.LogSqrt2Pi; }
+ get
+ {
+ return 0.5 + Math.Log(_sigma) + _mu + Constants.LogSqrt2Pi;
+ }
}
///
@@ -204,10 +223,11 @@ namespace MathNet.Numerics.Distributions
{
get
{
- double expsigma2 = Math.Exp(_sigma * _sigma);
+ var expsigma2 = Math.Exp(_sigma * _sigma);
return (expsigma2 + 2.0) * Math.Sqrt(expsigma2 - 1);
}
}
+
#endregion
#region IContinuousDistribution implementation
@@ -217,7 +237,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mode
{
- get { return Math.Exp(_mu - _sigma * _sigma); }
+ get
+ {
+ return Math.Exp(_mu - (_sigma * _sigma));
+ }
}
///
@@ -225,7 +248,10 @@ namespace MathNet.Numerics.Distributions
///
public double Median
{
- get { return Math.Exp(_mu); }
+ get
+ {
+ return Math.Exp(_mu);
+ }
}
///
@@ -233,7 +259,10 @@ namespace MathNet.Numerics.Distributions
///
public double Minimum
{
- get { return 0.0; }
+ get
+ {
+ return 0.0;
+ }
}
///
@@ -241,7 +270,10 @@ namespace MathNet.Numerics.Distributions
///
public double Maximum
{
- get { return Double.PositiveInfinity; }
+ get
+ {
+ return Double.PositiveInfinity;
+ }
}
///
@@ -256,7 +288,7 @@ namespace MathNet.Numerics.Distributions
return 0.0;
}
- double a = (Math.Log(x) - _mu) / _sigma;
+ var a = (Math.Log(x) - _mu) / _sigma;
return Math.Exp(-0.5 * a * a) / (x * _sigma * Constants.Sqrt2Pi);
}
@@ -272,8 +304,8 @@ namespace MathNet.Numerics.Distributions
return Double.NegativeInfinity;
}
- double a = (Math.Log(x) - _mu) / _sigma;
- return -0.5 * a * a - Math.Log(x * _sigma) - Constants.LogSqrt2Pi;
+ var a = (Math.Log(x) - _mu) / _sigma;
+ return (-0.5 * a * a) - Math.Log(x * _sigma) - Constants.LogSqrt2Pi;
}
///
@@ -297,8 +329,7 @@ namespace MathNet.Numerics.Distributions
/// a sample from the distribution.
public double Sample()
{
- double r2;
- return Math.Exp(_mu + (_sigma * Normal.SampleBoxMuller(RandomSource, out r2)));
+ return Math.Exp(_mu + (_sigma * Normal.SampleBoxMuller(RandomSource).Item1));
}
///
@@ -307,15 +338,14 @@ namespace MathNet.Numerics.Distributions
/// a sequence of samples from the distribution.
public IEnumerable Samples()
{
- double r2;
-
while (true)
{
- double r1 = Normal.SampleBoxMuller(RandomSource, out r2);
- yield return Math.Exp(_mu + (_sigma * r1));
- yield return Math.Exp(_mu + (_sigma * r2));
+ var sample = Normal.SampleBoxMuller(RandomSource);
+ yield return Math.Exp(_mu + (_sigma * sample.Item1));
+ yield return Math.Exp(_mu + (_sigma * sample.Item2));
}
}
+
#endregion
///
@@ -332,8 +362,7 @@ namespace MathNet.Numerics.Distributions
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
- double r2;
- return Math.Exp(mu + (sigma * Normal.SampleBoxMuller(rng, out r2)));
+ return Math.Exp(mu + (sigma * Normal.SampleBoxMuller(rng).Item1));
}
///
@@ -349,14 +378,12 @@ namespace MathNet.Numerics.Distributions
{
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
-
- double r2;
while (true)
{
- double r1 = Normal.SampleBoxMuller(rng, out r2);
- yield return Math.Exp(mu + (sigma * r1));
- yield return Math.Exp(mu + (sigma * r2));
+ var sample = Normal.SampleBoxMuller(rng);
+ yield return Math.Exp(mu + (sigma * sample.Item1));
+ yield return Math.Exp(mu + (sigma * sample.Item2));
}
}
}
diff --git a/src/Numerics/Distributions/Continuous/Normal.cs b/src/Numerics/Distributions/Continuous/Normal.cs
index 58dc569c..73e58ca2 100644
--- a/src/Numerics/Distributions/Continuous/Normal.cs
+++ b/src/Numerics/Distributions/Continuous/Normal.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -42,7 +38,7 @@ namespace MathNet.Numerics.Distributions
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Normal : IContinuousDistribution
{
///
@@ -110,11 +106,11 @@ namespace MathNet.Numerics.Distributions
/// be initialized with the default random number generator.
///
/// The mean of the normal distribution.
- /// The precision of the normal distribution.
+ /// The precision of the normal distribution.
/// a normal distribution.
- public static Normal WithMeanPrecision(double mean, double prec)
+ public static Normal WithMeanPrecision(double mean, double precision)
{
- return new Normal(mean, 1.0 / Math.Sqrt(prec));
+ return new Normal(mean, 1.0 / Math.Sqrt(precision));
}
///
@@ -131,7 +127,7 @@ namespace MathNet.Numerics.Distributions
///
/// The mean of the normal distribution.
/// The standard deviation of the normal distribution.
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double mean, double stddev)
{
if (stddev < 0.0 || Double.IsNaN(mean) || Double.IsNaN(stddev))
@@ -171,7 +167,7 @@ namespace MathNet.Numerics.Distributions
set
{
- double sdev = 1.0 / Math.Sqrt(value);
+ var sdev = 1.0 / Math.Sqrt(value);
// Handle the case when the precision is -0.
if (Double.IsInfinity(sdev))
@@ -211,8 +207,15 @@ namespace MathNet.Numerics.Distributions
///
public double Mean
{
- get { return _mean; }
- set { SetParameters(value, _stdDev); }
+ get
+ {
+ return _mean;
+ }
+
+ set
+ {
+ SetParameters(value, _stdDev);
+ }
}
///
@@ -220,8 +223,15 @@ namespace MathNet.Numerics.Distributions
///
public double Variance
{
- get { return _stdDev * _stdDev; }
- set { SetParameters(_mean, value); }
+ get
+ {
+ return _stdDev * _stdDev;
+ }
+
+ set
+ {
+ SetParameters(_mean, value);
+ }
}
///
@@ -229,8 +239,15 @@ namespace MathNet.Numerics.Distributions
///
public double StdDev
{
- get { return _stdDev; }
- set { SetParameters(_mean, value); }
+ get
+ {
+ return _stdDev;
+ }
+
+ set
+ {
+ SetParameters(_mean, value);
+ }
}
///
@@ -238,7 +255,10 @@ namespace MathNet.Numerics.Distributions
///
public double Entropy
{
- get { return Math.Log(_stdDev) + Constants.LogSqrt2PiE; }
+ get
+ {
+ return Math.Log(_stdDev) + Constants.LogSqrt2PiE;
+ }
}
///
@@ -246,8 +266,12 @@ namespace MathNet.Numerics.Distributions
///
public double Skewness
{
- get { return 0.0; }
+ get
+ {
+ return 0.0;
+ }
}
+
#endregion
#region IContinuousDistribution implementation
@@ -257,7 +281,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mode
{
- get { return _mean; }
+ get
+ {
+ return _mean;
+ }
}
///
@@ -265,7 +292,10 @@ namespace MathNet.Numerics.Distributions
///
public double Median
{
- get { return _mean; }
+ get
+ {
+ return _mean;
+ }
}
///
@@ -273,7 +303,10 @@ namespace MathNet.Numerics.Distributions
///
public double Minimum
{
- get { return Double.NegativeInfinity; }
+ get
+ {
+ return Double.NegativeInfinity;
+ }
}
///
@@ -281,7 +314,10 @@ namespace MathNet.Numerics.Distributions
///
public double Maximum
{
- get { return Double.PositiveInfinity; }
+ get
+ {
+ return Double.PositiveInfinity;
+ }
}
///
@@ -293,7 +329,7 @@ namespace MathNet.Numerics.Distributions
/// the density at .
internal static double Density(double mean, double sdev, double x)
{
- double d = (x - mean) / sdev;
+ var d = (x - mean) / sdev;
return Math.Exp(-0.5 * d * d) / (Constants.Sqrt2Pi * sdev);
}
@@ -306,7 +342,7 @@ namespace MathNet.Numerics.Distributions
/// the log density at .
internal static double DensityLn(double mean, double sdev, double x)
{
- double d = (x - mean) / sdev;
+ var d = (x - mean) / sdev;
return (-0.5 * d * d) - Math.Log(sdev) - Constants.LogSqrt2Pi;
}
@@ -358,8 +394,7 @@ namespace MathNet.Numerics.Distributions
/// a sample from the distribution.
public double Sample()
{
- double r2;
- return _mean + (_stdDev * SampleBoxMuller(RandomSource, out r2));
+ return _mean + (_stdDev * SampleBoxMuller(RandomSource).Item1);
}
///
@@ -368,15 +403,14 @@ namespace MathNet.Numerics.Distributions
/// a sequence of samples from the distribution.
public IEnumerable Samples()
{
- double r2;
-
while (true)
{
- double r1 = SampleBoxMuller(RandomSource, out r2);
- yield return _mean + (_stdDev * r1);
- yield return _mean + (_stdDev * r2);
+ var sample = SampleBoxMuller(RandomSource);
+ yield return _mean + (_stdDev * sample.Item1);
+ yield return _mean + (_stdDev * sample.Item2);
}
}
+
#endregion
///
@@ -403,8 +437,7 @@ namespace MathNet.Numerics.Distributions
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
- double r2;
- return mean + (stddev * SampleBoxMuller(rng, out r2));
+ return mean + (stddev * SampleBoxMuller(rng).Item1);
}
///
@@ -420,14 +453,12 @@ namespace MathNet.Numerics.Distributions
{
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
-
- double r2;
while (true)
{
- double r1 = SampleBoxMuller(rng, out r2);
- yield return mean + (stddev * r1);
- yield return mean + (stddev * r2);
+ var sample = SampleBoxMuller(rng);
+ yield return mean + (stddev * sample.Item1);
+ yield return mean + (stddev * sample.Item2);
}
}
@@ -435,13 +466,12 @@ namespace MathNet.Numerics.Distributions
/// Samples a pair of standard normal distributed random variables using the Box-Muller algorithm.
///
/// The random number generator to use.
- /// A second random number from the standard normal distribution computed as a side product.
- /// a random number from the standard normal distribution.
- internal static double SampleBoxMuller(Random rnd, out double r2)
+ /// a pair of random numbers from the standard normal distribution.
+ internal static Tuple SampleBoxMuller(Random rnd)
{
- double v1 = (2.0 * rnd.NextDouble()) - 1.0;
- double v2 = (2.0 * rnd.NextDouble()) - 1.0;
- double r = (v1 * v1) + (v2 * v2);
+ var v1 = (2.0 * rnd.NextDouble()) - 1.0;
+ var v2 = (2.0 * rnd.NextDouble()) - 1.0;
+ var r = (v1 * v1) + (v2 * v2);
while (r >= 1.0 || r == 0.0)
{
v1 = (2.0 * rnd.NextDouble()) - 1.0;
@@ -449,9 +479,8 @@ namespace MathNet.Numerics.Distributions
r = (v1 * v1) + (v2 * v2);
}
- double fac = Math.Sqrt(-2.0 * Math.Log(r) / r);
- r2 = v2 * fac;
- return v1 * fac;
+ var fac = Math.Sqrt(-2.0 * Math.Log(r) / r);
+ return new Tuple(v1 * fac, v2 * fac);
}
}
}
diff --git a/src/Numerics/Distributions/Continuous/Pareto.cs b/src/Numerics/Distributions/Continuous/Pareto.cs
new file mode 100644
index 00000000..4d8a69b6
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Pareto.cs
@@ -0,0 +1,352 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The Pareto distribution is a power law probability distribution that coincides with social,
+ /// scientific, geophysical, actuarial, and many other types of observable phenomena.
+ /// For details about this distribution, see
+ /// Wikipedia - Pareto distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can get/set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Pareto : IContinuousDistribution
+ {
+ ///
+ /// The scale parameter of the distribution.
+ ///
+ private double _scale;
+
+ ///
+ /// The shape parameter of the distribution.
+ ///
+ private double _shape;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The scale parameter of the distribution.
+ ///
+ ///
+ /// The shape parameter of the distribution.
+ ///
+ ///
+ /// If or are negative.
+ ///
+ public Pareto(double scale, double shape)
+ {
+ SetParameters(scale, shape);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The scale parameter of the distribution.
+ /// The shape parameter of the distribution.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double scale, double shape)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(scale, shape))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _scale = scale;
+ _shape = shape;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The scale parameter of the distribution.
+ /// The shape parameter of the distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double scale, double shape)
+ {
+ if (scale <= 0 || shape <= 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(scale) || Double.IsNaN(shape))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the scale parameter of the distribution.
+ ///
+ public double Scale
+ {
+ get
+ {
+ return _scale;
+ }
+
+ set
+ {
+ SetParameters(value, _shape);
+ }
+ }
+
+ ///
+ /// Gets or sets the shape parameter of the distribution.
+ ///
+ public double Shape
+ {
+ get
+ {
+ return _shape;
+ }
+
+ set
+ {
+ SetParameters(_scale, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Pareto(Scale = " + _scale + ", Shape = " + _shape + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ if (_shape <= 1)
+ {
+ throw new NotSupportedException();
+ }
+
+ return _shape * _scale / (_shape - 1.0);
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return _scale * _scale * _shape / ((_shape - 1.0) * (_shape - 1.0) * (_scale - 2.0));
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return (_scale * Math.Sqrt(_shape)) / (Math.Abs(_shape - 1.0) * Math.Sqrt(_shape - 2.0));
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return Math.Log(_shape / _scale) - (1.0 / _shape) - 1.0;
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ return (2.0 * (_shape + 1.0) / (_shape - 3.0)) * Math.Sqrt((_shape - 2.0) / _shape);
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return 1.0 - Math.Pow(_scale / x, _shape);
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ return _scale;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get
+ {
+ return _scale * Math.Pow(2.0, 1.0 / _shape);
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return _scale;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ return _shape * Math.Pow(_scale, _shape) / Math.Pow(x, _shape + 1.0);
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return Math.Log(Density(x));
+ }
+
+ ///
+ /// Draws a random sample from the distribution.
+ ///
+ /// A random number from this distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource);
+ }
+
+ ///
+ /// Generates a sequence of samples from the Pareto distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Generates a sample from the Pareto distribution without doing parameter checking.
+ ///
+ /// The random number generator to use.
+ /// a random number from the Pareto distribution.
+ private double DoSample(Random rnd)
+ {
+ return _scale * Math.Pow(rnd.NextDouble(), -1.0 / _shape);
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/Rayleigh.cs b/src/Numerics/Distributions/Continuous/Rayleigh.cs
new file mode 100644
index 00000000..6713305a
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Rayleigh.cs
@@ -0,0 +1,321 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The Rayleigh distribution (pronounced /ˈreɪli/) is a continuous probability distribution. As an
+ /// example of how it arises, the wind speed will have a Rayleigh distribution if the components of
+ /// the two-dimensional wind velocity vector are uncorrelated and normally distributed with equal variance.
+ /// For details about this distribution, see
+ /// Wikipedia - Rayleigh distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can get/set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Rayleigh : IContinuousDistribution
+ {
+ ///
+ /// The scale parameter of the distribution.
+ ///
+ private double _scale;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The scale parameter of the distribution.
+ ///
+ ///
+ /// If is negative.
+ ///
+ public Rayleigh(double scale)
+ {
+ SetParameters(scale);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The scale parameter of the distribution.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double scale)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(scale))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _scale = scale;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The scale parameter of the distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double scale)
+ {
+ if (scale <= 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(scale))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the scale parameter of the distribution.
+ ///
+ public double Scale
+ {
+ get
+ {
+ return _scale;
+ }
+
+ set
+ {
+ SetParameters(value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Rayleigh(Scale = " + _scale + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ return _scale * Math.Sqrt(Constants.PiOver2);
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return (2.0 - Constants.PiOver2) * _scale * _scale;
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(2.0 - Constants.PiOver2) * _scale;
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return 1.0 + Math.Log(_scale / Math.Sqrt(2)) + (Constants.EulerMascheroni / 2.0);
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ return (2.0 * Math.Sqrt(Constants.Pi) * (Constants.Pi - 3.0)) / Math.Pow(4.0 - Constants.Pi, 1.5);
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return 1.0 - Math.Exp(-x * x / (2.0 * _scale * _scale));
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public double Mode
+ {
+ get
+ {
+ return _scale;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public double Median
+ {
+ get
+ {
+ return _scale * Math.Sqrt(Math.Log(4.0));
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ return (x / (_scale * _scale)) * Math.Exp(-x * x / (2.0 * _scale * _scale));
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return Math.Log(x / (_scale * _scale)) - (x * x / (2.0 * _scale * _scale));
+ }
+
+ ///
+ /// Draws a random sample from the distribution.
+ ///
+ /// A random number from this distribution.
+ public double Sample()
+ {
+ return DoSample(RandomSource);
+ }
+
+ ///
+ /// Generates a sequence of samples from the Rayleigh distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Generates a sample from the Rayleigh distribution without doing parameter checking.
+ ///
+ /// The random number generator to use.
+ /// a random number from the Rayleigh distribution.
+ private double DoSample(Random rnd)
+ {
+ return _scale * Math.Sqrt(-2.0 * Math.Log(rnd.NextDouble()));
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/Stable.cs b/src/Numerics/Distributions/Continuous/Stable.cs
new file mode 100644
index 00000000..7721b11e
--- /dev/null
+++ b/src/Numerics/Distributions/Continuous/Stable.cs
@@ -0,0 +1,498 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// A random variable is said to be stable (or to have a stable distribution) if it has
+ /// the property that a linear combination of two independent copies of the variable has
+ /// the same distribution, up to location and scale parameters.
+ /// For details about this distribution, see
+ /// Wikipedia - Stable distribution .
+ ///
+ /// The distribution will use the by default.`
+ /// Users can get/set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Stable : IContinuousDistribution
+ {
+ ///
+ /// The stability parameter of the distribution.
+ ///
+ private double _alpha;
+
+ ///
+ /// The skewness parameter of the distribution.
+ ///
+ private double _beta;
+
+ ///
+ /// The scale parameter of the distribution.
+ ///
+ private double _scale;
+
+ ///
+ /// The location parameter of the distribution.
+ ///
+ private double _location;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The stability parameter of the distribution.
+ ///
+ ///
+ /// The skewness parameter of the distribution.
+ ///
+ ///
+ /// The scale parameter of the distribution.
+ ///
+ ///
+ /// The location parameter of the distribution.
+ ///
+ public Stable(double alpha, double beta, double scale, double location)
+ {
+ SetParameters(alpha, beta, scale, location);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The stability parameter of the distribution.
+ /// The skewness parameter of the distribution.
+ /// The scale parameter of the distribution.
+ /// The location parameter of the distribution.
+ private void SetParameters(double alpha, double beta, double scale, double location)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(alpha, beta, scale, location))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _alpha = alpha;
+ _beta = beta;
+ _scale = scale;
+ _location = location;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The stability parameter of the distribution.
+ /// The skewness parameter of the distribution.
+ /// The scale parameter of the distribution.
+ /// The location parameter of the distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double alpha, double beta, double scale, double location)
+ {
+ if (alpha <= 0 || alpha > 2)
+ {
+ return false;
+ }
+
+ if (beta < -1 || beta > 1)
+ {
+ return false;
+ }
+
+ if (scale <= 0)
+ {
+ return false;
+ }
+
+ if (Double.IsNaN(alpha) || Double.IsNaN(beta) || Double.IsNaN(scale) || Double.IsNaN(location))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the stability parameter of the distribution.
+ ///
+ public double Alpha
+ {
+ get
+ {
+ return _alpha;
+ }
+
+ set
+ {
+ SetParameters(value, _beta, _scale, _location);
+ }
+ }
+
+ ///
+ /// Gets or sets The skewness parameter of the distribution.
+ ///
+ public double Beta
+ {
+ get
+ {
+ return _beta;
+ }
+
+ set
+ {
+ SetParameters(_alpha, value, _scale, _location);
+ }
+ }
+
+ ///
+ /// Gets or sets the scale parameter of the distribution.
+ ///
+ public double Scale
+ {
+ get
+ {
+ return _scale;
+ }
+
+ set
+ {
+ SetParameters(_alpha, _beta, value, _location);
+ }
+ }
+
+ ///
+ /// Gets or sets the location parameter of the distribution.
+ ///
+ public double Location
+ {
+ get
+ {
+ return _location;
+ }
+
+ set
+ {
+ SetParameters(_alpha, _beta, _scale, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Stable(" + "Stability = " + _alpha + ", Skewness = " + _beta + ", Scale = " + _scale + ", Location = " + _location + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ if (_alpha <= 1)
+ {
+ throw new NotSupportedException();
+ }
+
+ return _location;
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ if (_alpha == 2)
+ {
+ return 2.0 * _scale * _scale;
+ }
+
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ if (_alpha == 2)
+ {
+ return Math.Sqrt(2.0) * _scale;
+ }
+
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Gets he entropy of the distribution.
+ ///
+ /// Always throws a not supported exception.
+ public double Entropy
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ /// Throws a not supported exception of Alpha != 2.
+ public double Skewness
+ {
+ get
+ {
+ if (_alpha != 2)
+ {
+ throw new NotSupportedException();
+ }
+
+ return 0.0;
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ /// Throws a not supported exception if Alpha != 2 , (Alpha != 1 and Beta !=0) , or (Alpha != 0.5 and Beta != 1)
+ public double CumulativeDistribution(double x)
+ {
+ if (_alpha == 2)
+ {
+ return (new Normal(_location, StdDev)).CumulativeDistribution(x);
+ }
+
+ if (_alpha == 1 && _beta == 0)
+ {
+ return (new Cauchy(_location, _scale)).CumulativeDistribution(x);
+ }
+
+ if (_alpha == 0.5 && _beta == 1)
+ {
+ return LevyCumulativeDistribution(_scale, _location, x);
+ }
+
+ throw new NotSupportedException();
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the Levy distribution.
+ ///
+ /// The scale parameter.
+ /// The location parameter.
+ /// The location at which to compute the cumulative density.
+ ///
+ /// the cumulative density at .
+ ///
+ private static double LevyCumulativeDistribution(double scale, double location, double x)
+ {
+ // The parameters scale and location must be correct
+ return SpecialFunctions.Erfc(Math.Sqrt(scale / (2 * (x - location))));
+ }
+
+ #endregion
+
+ #region IContinuousDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ /// Throws a not supported exception if Beta != 0 .
+ public double Mode
+ {
+ get
+ {
+ if (_beta != 0)
+ {
+ throw new NotSupportedException();
+ }
+
+ return _location;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ /// Throws a not supported exception if Beta != 0 .
+ public double Median
+ {
+ get
+ {
+ if (_beta != 0)
+ {
+ throw new NotSupportedException();
+ }
+
+ return _location;
+ }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public double Minimum
+ {
+ get
+ {
+ if (Math.Abs(_beta) == 1)
+ {
+ return 0.0;
+ }
+
+ return Double.NegativeInfinity;
+ }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public double Maximum
+ {
+ get
+ {
+ return Double.PositiveInfinity;
+ }
+ }
+
+ ///
+ /// Computes the density of the distribution.
+ ///
+ /// The location at which to compute the density.
+ /// the density at .
+ public double Density(double x)
+ {
+ if (_alpha == 2)
+ {
+ return (new Normal(_location, StdDev)).Density(x);
+ }
+
+ if (_alpha == 1 && _beta == 0)
+ {
+ return (new Cauchy(_location, _scale)).Density(x);
+ }
+
+ if (_alpha == 0.5 && _beta == 1)
+ {
+ return LevyDensity(_scale, _location, x);
+ }
+
+ throw new NotSupportedException();
+ }
+
+ ///
+ /// Computes the density of the Levy distribution.
+ ///
+ /// The scale parameter of the distribution.
+ /// The location parameter of the distribution.
+ /// The location at which to compute the density.
+ /// the density at .
+ private static double LevyDensity(double scale, double location, double x)
+ {
+ // The parameters scale and location must be correct
+ if (x < location)
+ {
+ throw new NotSupportedException();
+ }
+
+ return (Math.Sqrt(scale / Constants.Pi2) * Math.Exp(-scale / (2 * (x - location)))) / Math.Pow(x - location, 1.5);
+ }
+
+ ///
+ /// Computes the log density of the distribution.
+ ///
+ /// The location at which to compute the log density.
+ /// the log density at .
+ public double DensityLn(double x)
+ {
+ return Math.Log(Density(x));
+ }
+
+ ///
+ /// Draws a random sample from the distribution.
+ ///
+ /// A random number from this distribution.
+ public double Sample()
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Generates a sequence of samples from the Stable distribution.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+ }
+}
diff --git a/src/Numerics/Distributions/Continuous/StudentT.cs b/src/Numerics/Distributions/Continuous/StudentT.cs
index e9f53f7d..072050a1 100644
--- a/src/Numerics/Distributions/Continuous/StudentT.cs
+++ b/src/Numerics/Distributions/Continuous/StudentT.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -35,19 +31,25 @@ namespace MathNet.Numerics.Distributions
using Properties;
///
- /// Implements the univariate Student t-distribution. For details about this distribution, see
- /// Wikipedia - Student's t-distribution .
+ /// Implements the univariate Student t-distribution. For details about this
+ /// distribution, see
+ ///
+ /// Wikipedia - Student's t-distribution .
///
- /// We use a slightly generalized version (compared to Wikipedia) of the Student t-distribution.
- /// Namely, one which also parameterizes the location and scale. See the book "Bayesian Data Analysis" by Gelman
- /// et al. for more details.
- /// The density of the Student t-distribution
- /// p(x|mu,scale,dof) = Gamma((dof+1)/2) (1 + (x - mu)^2 / (scale * scale * dof))^(-(dof+1)/2) / (Gamma(dof/2)*Sqrt(dof*pi*scale)).
- /// The distribution will use the by default.
- /// Users can get/set the random number generator by using the property.
- /// The statistics classes will check all the incoming parameters whether they are in the allowed
- /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// We use a slightly generalized version (compared to
+ /// Wikipedia) of the Student t-distribution. Namely, one which also
+ /// parameterizes the location and scale. See the book "Bayesian Data
+ /// Analysis" by Gelman et al. for more details.
+ /// The density of the Student t-distribution p(x|mu,scale,dof) =
+ /// Gamma((dof+1)/2) (1 + (x - mu)^2 / (scale * scale * dof))^(-(dof+1)/2) /
+ /// (Gamma(dof/2)*Sqrt(dof*pi*scale)).
+ /// The distribution will use the by
+ /// default. Users can get/set the random number generator by using the
+ /// property.
+ /// The statistics classes will check all the incoming parameters
+ /// whether they are in the allowed range. This might involve heavy
+ /// computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
public class StudentT : IContinuousDistribution
{
///
@@ -108,7 +110,7 @@ namespace MathNet.Numerics.Distributions
/// The location of the Student t-distribution.
/// The scale of the Student t-distribution.
/// The degrees of freedom for the Student t-distribution.
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double location, double scale, double dof)
{
if (scale <= 0.0 || dof <= 0.0 || Double.IsNaN(scale) || Double.IsNaN(location) || Double.IsNaN(dof))
@@ -210,25 +212,18 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Gets or sets the mean of the Student t-distribution.
+ /// Gets the mean of the Student t-distribution.
///
public double Mean
{
get
{
- if (_dof > 1.0)
- {
- return _location;
- }
- else
- {
- return Double.NaN;
- }
+ return _dof > 1.0 ? _location : Double.NaN;
}
}
///
- /// Gets or sets the variance of the Student t-distribution.
+ /// Gets the variance of the Student t-distribution.
///
public double Variance
{
@@ -238,23 +233,18 @@ namespace MathNet.Numerics.Distributions
{
return _scale * _scale;
}
- else if (_dof > 2.0)
+
+ if (_dof > 2.0)
{
return _dof * _scale * _scale / (_dof - 2.0);
}
- else if (_dof > 1.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NaN;
- }
+
+ return _dof > 1.0 ? Double.PositiveInfinity : Double.NaN;
}
}
///
- /// Gets or sets the standard deviation of the Student t-distribution.
+ /// Gets the standard deviation of the Student t-distribution.
///
public double StdDev
{
@@ -264,18 +254,13 @@ namespace MathNet.Numerics.Distributions
{
return Math.Sqrt(_scale * _scale);
}
- else if (_dof > 2.0)
+
+ if (_dof > 2.0)
{
return Math.Sqrt(_dof * _scale * _scale / (_dof - 2.0));
}
- else if (_dof > 1.0)
- {
- return Double.PositiveInfinity;
- }
- else
- {
- return Double.NaN;
- }
+
+ return _dof > 1.0 ? Double.PositiveInfinity : Double.NaN;
}
}
@@ -284,7 +269,15 @@ namespace MathNet.Numerics.Distributions
///
public double Entropy
{
- get { throw new NotImplementedException(); }
+ get
+ {
+ if (_location != 0 || _scale != 1.0)
+ {
+ throw new NotSupportedException();
+ }
+
+ return (((_dof + 1.0) / 2.0) * (SpecialFunctions.DiGamma((1.0 + _dof) / 2.0) - SpecialFunctions.DiGamma(_dof / 2.0))) + Math.Log(Math.Sqrt(_dof) * SpecialFunctions.Beta(_dof / 2.0, 1.0 / 2.0));
+ }
}
///
@@ -292,8 +285,17 @@ namespace MathNet.Numerics.Distributions
///
public double Skewness
{
- get { throw new NotImplementedException(); }
+ get
+ {
+ if (_dof <= 3)
+ {
+ throw new NotSupportedException();
+ }
+
+ return 0.0;
+ }
}
+
#endregion
#region IContinuousDistribution implementation
@@ -303,7 +305,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mode
{
- get { return _location; }
+ get
+ {
+ return _location;
+ }
}
///
@@ -311,7 +316,10 @@ namespace MathNet.Numerics.Distributions
///
public double Median
{
- get { return _location; }
+ get
+ {
+ return _location;
+ }
}
///
@@ -319,7 +327,10 @@ namespace MathNet.Numerics.Distributions
///
public double Minimum
{
- get { return Double.NegativeInfinity; }
+ get
+ {
+ return Double.NegativeInfinity;
+ }
}
///
@@ -327,7 +338,10 @@ namespace MathNet.Numerics.Distributions
///
public double Maximum
{
- get { return Double.PositiveInfinity; }
+ get
+ {
+ return Double.PositiveInfinity;
+ }
}
///
@@ -342,15 +356,13 @@ namespace MathNet.Numerics.Distributions
{
return Normal.Density(_location, _scale, x);
}
- else
- {
- double d = (x - _location) / _scale;
- return SpecialFunctions.Gamma((_dof + 1.0) / 2.0)
- * Math.Pow(1.0 + d * d / _dof, -0.5 * (_dof + 1.0))
- / SpecialFunctions.Gamma(_dof / 2.0)
- / Math.Sqrt(_dof * Math.PI)
- / _scale;
- }
+
+ var d = (x - _location) / _scale;
+ return SpecialFunctions.Gamma((_dof + 1.0) / 2.0)
+ * Math.Pow(1.0 + (d * d / _dof), -0.5 * (_dof + 1.0))
+ / SpecialFunctions.Gamma(_dof / 2.0)
+ / Math.Sqrt(_dof * Math.PI)
+ / _scale;
}
///
@@ -365,15 +377,12 @@ namespace MathNet.Numerics.Distributions
{
return Normal.DensityLn(_location, _scale, x);
}
- else
- {
- double d = (x - _location) / _scale;
- return SpecialFunctions.GammaLn((_dof + 1.0) / 2.0)
- - 0.5 * (_dof + 1.0) * Math.Log(1.0 + d * d / _dof)
- - SpecialFunctions.GammaLn(_dof / 2.0)
- - 0.5 * Math.Log(_dof * Math.PI)
- - Math.Log(_scale);
- }
+
+ var d = (x - _location) / _scale;
+ return SpecialFunctions.GammaLn((_dof + 1.0) / 2.0)
+ - (0.5 * ((_dof + 1.0) * Math.Log(1.0 + (d * d / _dof))))
+ - SpecialFunctions.GammaLn(_dof / 2.0)
+ - (0.5 * Math.Log(_dof * Math.PI)) - Math.Log(_scale);
}
///
@@ -388,20 +397,11 @@ namespace MathNet.Numerics.Distributions
{
return Normal.CumulativeDistribution(_location, _scale, x);
}
- else
- {
- double k = (x - _location) / _scale;
- double h = _dof / (_dof + k * k);
- double ib = 0.5 * SpecialFunctions.BetaRegularized(_dof / 2.0, 0.5, h);
- if (x <= _location)
- {
- return ib;
- }
- else
- {
- return 1.0 - ib;
- }
- }
+
+ var k = (x - _location) / _scale;
+ var h = _dof / (_dof + (k * k));
+ var ib = 0.5 * SpecialFunctions.BetaRegularized(_dof / 2.0, 0.5, h);
+ return x <= _location ? ib : 1.0 - ib;
}
///
@@ -410,7 +410,7 @@ namespace MathNet.Numerics.Distributions
/// a sample from the distribution.
public double Sample()
{
- return _location + _scale * Sample(RandomSource, _dof);
+ return _location + (_scale * Sample(RandomSource, _dof));
}
///
@@ -421,9 +421,10 @@ namespace MathNet.Numerics.Distributions
{
while (true)
{
- yield return _location + _scale * Sample(RandomSource, _dof);
+ yield return _location + (_scale * Sample(RandomSource, _dof));
}
}
+
#endregion
///
@@ -441,7 +442,7 @@ namespace MathNet.Numerics.Distributions
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
- return location + scale * Sample(rng, dof);
+ return location + (scale * Sample(rng, dof));
}
///
@@ -461,7 +462,7 @@ namespace MathNet.Numerics.Distributions
while (true)
{
- yield return location + scale * Sample(rng, dof);
+ yield return location + (scale * Sample(rng, dof));
}
}
@@ -475,10 +476,8 @@ namespace MathNet.Numerics.Distributions
/// a random number from the standard student-t distribution.
internal static double Sample(Random rnd, double dof)
{
- double dummy = 0.0;
- var n = Normal.SampleBoxMuller(rnd, out dummy);
+ var n = Normal.SampleBoxMuller(rnd).Item1;
var g = Gamma.Sample(rnd, 0.5 * dof, 0.5);
-
return Math.Sqrt(dof / g) * n;
}
}
diff --git a/src/Numerics/Distributions/Continuous/Weibull.cs b/src/Numerics/Distributions/Continuous/Weibull.cs
index 32d3502f..695be956 100644
--- a/src/Numerics/Distributions/Continuous/Weibull.cs
+++ b/src/Numerics/Distributions/Continuous/Weibull.cs
@@ -44,7 +44,7 @@ namespace MathNet.Numerics.Distributions
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Weibull : IContinuousDistribution
{
///
@@ -96,7 +96,7 @@ namespace MathNet.Numerics.Distributions
///
/// The shape of the Weibull distribution.
/// The scale of the Weibull distribution.
- /// True when the parameters positive valid floating point numbers, false otherwise.
+ /// true when the parameters positive valid floating point numbers, false otherwise.
private static bool IsValidParameterSet(double shape, double scale)
{
if (shape <= 0.0 || scale <= 0.0 || Double.IsNaN(shape) || Double.IsNaN(scale))
@@ -187,7 +187,7 @@ namespace MathNet.Numerics.Distributions
{
get
{
- return _scale * SpecialFunctions.Gamma(1.0 + 1.0 / _shape);
+ return _scale * SpecialFunctions.Gamma(1.0 + (1.0 / _shape));
}
}
@@ -198,8 +198,7 @@ namespace MathNet.Numerics.Distributions
{
get
{
- double mu = this.Mean;
- return _scale * _scale * SpecialFunctions.Gamma(1.0 + 2.0 / _shape) - mu * mu;
+ return (_scale * _scale * SpecialFunctions.Gamma(1.0 + (2.0 / _shape))) - (Mean * Mean);
}
}
@@ -210,18 +209,19 @@ namespace MathNet.Numerics.Distributions
{
get
{
- return Math.Sqrt(this.Variance);
+ return Math.Sqrt(Variance);
}
}
///
/// Gets the entropy of the Weibull distribution.
///
+ /// Throws a not supported exception.
public double Entropy
{
get
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
}
@@ -232,12 +232,11 @@ namespace MathNet.Numerics.Distributions
{
get
{
- double mu = this.Mean;
- double sigma = this.StdDev;
+ double mu = Mean;
+ double sigma = StdDev;
double sigma2 = sigma * sigma;
double sigma3 = sigma2 * sigma;
- return (_scale * _scale * _scale * SpecialFunctions.Gamma(1.0 + 3.0 / _shape)
- - 3.0 * sigma2 * mu - mu * mu * mu) / sigma3;
+ return ((_scale * _scale * _scale * SpecialFunctions.Gamma(1.0 + (3.0 / _shape))) - (3.0 * sigma2 * mu) - (mu * mu * mu)) / sigma3;
}
}
#endregion
@@ -321,7 +320,7 @@ namespace MathNet.Numerics.Distributions
return Math.Log(_shape) - Math.Log(_scale);
}
- return Math.Log(_shape) + (_shape - 1.0) * Math.Log(x / _scale) - (Math.Pow(x, _shape) * _scalePowShapeInv) - Math.Log(_scale);
+ return Math.Log(_shape) + ((_shape - 1.0) * Math.Log(x / _scale)) - (Math.Pow(x, _shape) * _scalePowShapeInv) - Math.Log(_scale);
}
return double.NegativeInfinity;
@@ -410,9 +409,9 @@ namespace MathNet.Numerics.Distributions
/// The shape of the Weibull distribution.
/// The scale of the Weibull distribution.
/// A sample from a Weibull distributed random variable.
- internal static double SampleWeibull(System.Random rnd, double shape, double scale)
+ internal static double SampleWeibull(Random rnd, double shape, double scale)
{
- double x = rnd.NextDouble();
+ var x = rnd.NextDouble();
return scale * Math.Pow(-Math.Log(x), 1.0 / shape);
}
}
diff --git a/src/Numerics/Distributions/Discrete/Bernoulli.cs b/src/Numerics/Distributions/Discrete/Bernoulli.cs
index 51843064..5862049d 100644
--- a/src/Numerics/Distributions/Discrete/Bernoulli.cs
+++ b/src/Numerics/Distributions/Discrete/Bernoulli.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -42,7 +38,7 @@ namespace MathNet.Numerics.Distributions
/// Users can set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Bernoulli : IDiscreteDistribution
{
///
@@ -63,12 +59,13 @@ namespace MathNet.Numerics.Distributions
public Bernoulli(double p)
{
SetParameters(p);
- RandomSource = new System.Random();
+ RandomSource = new Random();
}
///
/// A string representation of the distribution.
///
+ /// a string representation of the distribution.
public override string ToString()
{
return "Bernoulli(P = " + _p + ")";
@@ -78,7 +75,7 @@ namespace MathNet.Numerics.Distributions
/// Checks whether the parameters of the distribution are valid.
///
/// The probability of generating a one.
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double p)
{
if (p >= 0.0 && p <= 1.0)
@@ -148,7 +145,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mean
{
- get { return _p; }
+ get
+ {
+ return _p;
+ }
}
///
@@ -156,7 +156,10 @@ namespace MathNet.Numerics.Distributions
///
public double StdDev
{
- get { return Math.Sqrt(_p * (1.0 - _p)); }
+ get
+ {
+ return Math.Sqrt(_p * (1.0 - _p));
+ }
}
///
@@ -164,7 +167,10 @@ namespace MathNet.Numerics.Distributions
///
public double Variance
{
- get { return _p * (1.0 - _p); }
+ get
+ {
+ return _p * (1.0 - _p);
+ }
}
///
@@ -172,7 +178,10 @@ namespace MathNet.Numerics.Distributions
///
public double Entropy
{
- get { return -_p * Math.Log(_p) - (1.0 - _p) * Math.Log(1.0 - _p); }
+ get
+ {
+ return -(_p * Math.Log(_p)) - ((1.0 - _p) * Math.Log(1.0 - _p));
+ }
}
///
@@ -180,18 +189,33 @@ namespace MathNet.Numerics.Distributions
///
public double Skewness
{
- get { return (1.0 - 2.0 * _p) / Math.Sqrt(_p * (1.0 - _p)); }
+ get
+ {
+ return (1.0 - (2.0 * _p)) / Math.Sqrt(_p * (1.0 - _p));
+ }
}
///
/// Gets the smallest element in the domain of the distributions which can be represented by an integer.
///
- public int Minimum { get { return 0; } }
+ public int Minimum
+ {
+ get
+ {
+ return 0;
+ }
+ }
///
/// Gets the largest element in the domain of the distributions which can be represented by an integer.
///
- public int Maximum { get { return 1; } }
+ public int Maximum
+ {
+ get
+ {
+ return 1;
+ }
+ }
///
/// Computes the cumulative distribution function of the Bernoulli distribution.
@@ -204,7 +228,8 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (x < 1.0)
+
+ if (x < 1.0)
{
return 1.0 - _p;
}
@@ -217,32 +242,40 @@ namespace MathNet.Numerics.Distributions
#region IDiscreteDistribution Members
///
- /// The mode of the distribution.
+ /// Gets the mode of the distribution.
///
public int Mode
{
- get { return _p > 0.5 ? 1 : 0; }
+ get
+ {
+ return _p > 0.5 ? 1 : 0;
+ }
}
///
- /// The median of the distribution.
+ /// Gets the median of the distribution.
///
public int Median
{
- get { throw new Exception("The median of the Bernoulli distribution is undefined."); }
+ get
+ {
+ throw new Exception("The median of the Bernoulli distribution is undefined.");
+ }
}
///
- /// Computes the probability of a specific value.
+ /// Computes values of the probability mass function.
///
- public double Probability(int val)
+ /// The location in the domain where we want to evaluate the probability mass function.
+ /// the probability mass at location .
+ public double Probability(int k)
{
- if (val == 0)
+ if (k == 0)
{
return 1.0 - _p;
}
- if (val == 1)
+ if (k == 1)
{
return _p;
}
@@ -251,21 +284,18 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Computes the probability of a specific value.
+ /// Computes values of the log probability mass function.
///
- public double ProbabilityLn(int val)
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ /// the log probability mass at location .
+ public double ProbabilityLn(int k)
{
- if (val == 0)
+ if (k == 0)
{
return Math.Log(1.0 - _p);
}
- if (val == 1)
- {
- return Math.Log(_p);
- }
-
- return Double.NegativeInfinity;
+ return k == 1 ? Math.Log(_p) : Double.NegativeInfinity;
}
///
@@ -297,7 +327,7 @@ namespace MathNet.Numerics.Distributions
/// The random number generator to use.
/// The probability of generating a 1.
/// A sample from the Bernoulli distribution.
- public static int Sample(System.Random rnd, double p)
+ public static int Sample(Random rnd, double p)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p))
{
@@ -313,7 +343,7 @@ namespace MathNet.Numerics.Distributions
/// The random number generator to use.
/// The probability of generating a 1.
/// a sequence of samples from the distribution.
- public static IEnumerable Samples(System.Random rnd, double p)
+ public static IEnumerable Samples(Random rnd, double p)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p))
{
@@ -332,7 +362,7 @@ namespace MathNet.Numerics.Distributions
/// The random source to use.
/// The probability of generating a one.
/// A random sample from the Bernoulli distribution.
- private static int DoSample(System.Random rnd, double p)
+ private static int DoSample(Random rnd, double p)
{
if (rnd.NextDouble() < p)
{
@@ -342,4 +372,4 @@ namespace MathNet.Numerics.Distributions
return 0;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Numerics/Distributions/Discrete/Binomial.cs b/src/Numerics/Distributions/Discrete/Binomial.cs
index 0da04e97..ce31e666 100644
--- a/src/Numerics/Distributions/Discrete/Binomial.cs
+++ b/src/Numerics/Distributions/Discrete/Binomial.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -34,7 +30,6 @@ namespace MathNet.Numerics.Distributions
using System.Collections.Generic;
using Properties;
-
///
/// Implements the binomial distribution. For details about this distribution, see
/// Wikipedia - Binomial distribution .
@@ -44,7 +39,7 @@ namespace MathNet.Numerics.Distributions
/// Users can set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Binomial : IDiscreteDistribution
{
///
@@ -72,12 +67,13 @@ namespace MathNet.Numerics.Distributions
public Binomial(double p, int n)
{
SetParameters(p, n);
- RandomSource = new System.Random();
+ RandomSource = new Random();
}
///
/// A string representation of the distribution.
///
+ /// a string representation of the distribution.
public override string ToString()
{
return "Binomial(Success Probability = " + _p + ", Number of Trials = " + _n + ")";
@@ -88,15 +84,15 @@ namespace MathNet.Numerics.Distributions
///
/// The success probability of a trial.
/// The number of trials.
- /// false is not in the interval [0.0,1.0] or is negative, true otherwise.
+ /// false is not in the interval [0.0,1.0] or is negative, true otherwise.
private static bool IsValidParameterSet(double p, int n)
{
- if(p < 0.0 || p > 1.0 || Double.IsNaN(p))
+ if (p < 0.0 || p > 1.0 || Double.IsNaN(p))
{
return false;
}
- if(n < 0)
+ if (n < 0)
{
return false;
}
@@ -182,7 +178,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mean
{
- get { return _p * _n; }
+ get
+ {
+ return _p * _n;
+ }
}
///
@@ -190,7 +189,10 @@ namespace MathNet.Numerics.Distributions
///
public double StdDev
{
- get { return Math.Sqrt(_p * (1.0 - _p) * _n); }
+ get
+ {
+ return Math.Sqrt(_p * (1.0 - _p) * _n);
+ }
}
///
@@ -198,7 +200,10 @@ namespace MathNet.Numerics.Distributions
///
public double Variance
{
- get { return _p * (1.0 - _p) * _n; }
+ get
+ {
+ return _p * (1.0 - _p) * _n;
+ }
}
///
@@ -213,13 +218,14 @@ namespace MathNet.Numerics.Distributions
return 0.0;
}
- double E = 0.0;
- for(int i = 0; i <= _n; i++)
+ var e = 0.0;
+ for (var i = 0; i <= _n; i++)
{
- double p = Probability(i);
- E -= p * Math.Log(p);
+ var p = Probability(i);
+ e -= p * Math.Log(p);
}
- return E;
+
+ return e;
}
}
@@ -228,18 +234,33 @@ namespace MathNet.Numerics.Distributions
///
public double Skewness
{
- get { return (1.0 - 2.0 * _p) / Math.Sqrt(_n * _p * (1.0 - _p)); }
+ get
+ {
+ return (1.0 - (2.0 * _p)) / Math.Sqrt(_n * _p * (1.0 - _p));
+ }
}
///
/// Gets the smallest element in the domain of the distributions which can be represented by an integer.
///
- public int Minimum { get { return 0; } }
+ public int Minimum
+ {
+ get
+ {
+ return 0;
+ }
+ }
///
/// Gets the largest element in the domain of the distributions which can be represented by an integer.
///
- public int Maximum { get { return _n; } }
+ public int Maximum
+ {
+ get
+ {
+ return _n;
+ }
+ }
///
/// Computes the cumulative distribution function of the Binomial distribution.
@@ -252,13 +273,14 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (x > _n)
+
+ if (x > _n)
{
return 1.0;
}
- double cdf = 0.0;
- for (int i = 0; i <= (int) Math.Floor(x); i++)
+ var cdf = 0.0;
+ for (var i = 0; i <= (int)Math.Floor(x); i++)
{
cdf += Combinatorics.Combinations(_n, i) * Math.Pow(_p, i) * Math.Pow(1.0 - _p, _n - i);
}
@@ -271,7 +293,7 @@ namespace MathNet.Numerics.Distributions
#region IDiscreteDistribution Members
///
- /// The mode of the distribution.
+ /// Gets the mode of the distribution.
///
public int Mode
{
@@ -281,99 +303,111 @@ namespace MathNet.Numerics.Distributions
{
return _n;
}
- else if (_p == 0.0)
+
+ if (_p == 0.0)
{
return 0;
}
- return (int) Math.Floor((_n + 1) * _p);
+ return (int)Math.Floor((_n + 1) * _p);
}
}
///
- /// The median of the distribution.
+ /// Gets the median of the distribution.
///
public int Median
{
- get { throw new NotImplementedException(); }
+ get
+ {
+ throw new NotImplementedException();
+ }
}
///
- /// Computes the probability of a specific value.
+ /// Computes values of the probability mass function.
///
- public double Probability(int val)
+ /// The location in the domain where we want to evaluate the probability mass function.
+ /// the probability mass at location .
+ public double Probability(int k)
{
- if (val < 0)
+ if (k < 0)
{
return 0.0;
}
- if (val > _n)
+ if (k > _n)
{
return 0.0;
}
- if (_p == 0.0 && val == 0)
+ if (_p == 0.0 && k == 0)
{
return 1.0;
}
- else if (_p == 0.0)
+
+ if (_p == 0.0)
{
return 0.0;
}
- if (_p == 1.0 && val == _n)
+ if (_p == 1.0 && k == _n)
{
return 1.0;
}
- else if (_p == 1.0)
+
+ if (_p == 1.0)
{
return 0.0;
}
- return SpecialFunctions.Binomial(_n, val) * Math.Pow(_p, val) * Math.Pow(1.0 - _p, _n - val);
+ return SpecialFunctions.Binomial(_n, k) * Math.Pow(_p, k) * Math.Pow(1.0 - _p, _n - k);
}
///
- /// Computes the log probability of a specific value.
+ /// Computes values of the log probability mass function.
///
- public double ProbabilityLn(int val)
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ /// the log probability mass at location .
+ public double ProbabilityLn(int k)
{
- if (val < 0)
+ if (k < 0)
{
return Double.NegativeInfinity;
}
- if (val > _n)
+ if (k > _n)
{
return Double.NegativeInfinity;
}
- if (_p == 0.0 && val == 0)
+ if (_p == 0.0 && k == 0)
{
return 0.0;
}
- else if (_p == 0.0)
+
+ if (_p == 0.0)
{
return Double.NegativeInfinity;
}
- if (_p == 1.0 && val == _n)
+ if (_p == 1.0 && k == _n)
{
return 0.0;
}
- else if (_p == 1.0)
+
+ if (_p == 1.0)
{
return Double.NegativeInfinity;
}
- return SpecialFunctions.BinomialLn(_n, val) + val * Math.Log(_p) + (_n - val) * Math.Log(1.0 - _p);
+ return SpecialFunctions.BinomialLn(_n, k) + (k * Math.Log(_p)) + ((_n - k) * Math.Log(1.0 - _p));
}
///
/// Samples a Binomially distributed random variable.
///
- /// The number of successes in trials.
+ /// The number of successes in N trials.
public int Sample()
{
return DoSample(RandomSource, _p, _n);
@@ -382,7 +416,7 @@ namespace MathNet.Numerics.Distributions
///
/// Samples an array of Bernoulli distributed random variables.
///
- /// a sequence of successes in trials.
+ /// a sequence of successes in N trials.
public IEnumerable Samples()
{
while (true)
@@ -400,7 +434,7 @@ namespace MathNet.Numerics.Distributions
/// The success probability of a trial; must be in the interval [0.0, 1.0].
/// The number of trials; must be positive.
/// The number of successes in trials.
- public static int Sample(System.Random rnd, double p, int n)
+ public static int Sample(Random rnd, double p, int n)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n))
{
@@ -417,7 +451,7 @@ namespace MathNet.Numerics.Distributions
/// The success probability of a trial; must be in the interval [0.0, 1.0].
/// The number of trials; must be positive.
/// a sequence of successes in trials.
- public static IEnumerable Samples(System.Random rnd, double p, int n)
+ public static IEnumerable Samples(Random rnd, double p, int n)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n))
{
@@ -437,15 +471,15 @@ namespace MathNet.Numerics.Distributions
/// The success probability of a trial; must be in the interval [0.0, 1.0].
/// The number of trials; must be positive.
/// The number of successful trials.
- private static int DoSample(System.Random rnd, double p, int n)
+ private static int DoSample(Random rnd, double p, int n)
{
- int k = 0;
- for (int i = 0; i < n; i++)
+ var k = 0;
+ for (var i = 0; i < n; i++)
{
- k += (rnd.NextDouble() < p ? 1 : 0);
+ k += rnd.NextDouble() < p ? 1 : 0;
}
return k;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Numerics/Distributions/Discrete/Categorical.cs b/src/Numerics/Distributions/Discrete/Categorical.cs
index 8fb1ba6d..9d02f83d 100644
--- a/src/Numerics/Distributions/Discrete/Categorical.cs
+++ b/src/Numerics/Distributions/Discrete/Categorical.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -32,9 +28,9 @@ namespace MathNet.Numerics.Distributions
{
using System;
using System.Collections.Generic;
+ using System.Linq;
using Properties;
- using MathNet.Numerics.Statistics;
-
+ using Statistics;
///
/// Implements the categorical distribution. For details about this distribution, see
@@ -48,7 +44,7 @@ namespace MathNet.Numerics.Distributions
/// Users can set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Categorical : IDiscreteDistribution
{
///
@@ -70,11 +66,11 @@ namespace MathNet.Numerics.Distributions
public Categorical(double[] p)
{
SetParameters(p);
- RandomSource = new System.Random();
+ RandomSource = new Random();
}
///
- /// Initializes a new instance of the Categorical class from a histogram . The distribution
+ /// Initializes a new instance of the Categorical class from a . The distribution
/// will not be automatically updated when the histogram changes. The categorical distribution will have
/// one value for each bucket and a probability for that value proportional to the bucket count.
///
@@ -83,25 +79,26 @@ namespace MathNet.Numerics.Distributions
{
if (histogram == null)
{
- throw new ArgumentNullException("Cannot create a categorical variable from a null histogram.");
+ throw new ArgumentNullException("histogram");
}
// The probability distribution vector.
- double[] p = new double[histogram.BucketCount];
+ var p = new double[histogram.BucketCount];
// Fill in the distribution vector.
- for (int i = 0; i < histogram.BucketCount; i++)
+ for (var i = 0; i < histogram.BucketCount; i++)
{
p[i] = histogram[i].Count;
}
SetParameters(p);
- RandomSource = new System.Random();
+ RandomSource = new Random();
}
///
/// A string representation of the distribution.
///
+ /// a string representation of the distribution.
public override string ToString()
{
return "Categorical(Dimension = " + _p.Length + ")";
@@ -112,28 +109,21 @@ namespace MathNet.Numerics.Distributions
///
/// An array of nonnegative ratios: this array does not need to be normalized
/// as this is often impossible using floating point arithmetic.
- /// If any of the probabilities are negative returns false, or if the sum of parameters is 0.0; otherwise true
- private static bool IsValidParameterSet(double[] p)
+ /// If any of the probabilities are negative returns false , or if the sum of parameters is 0.0; otherwise true
+ private static bool IsValidParameterSet(IEnumerable p)
{
- double sum = 0.0;
- for (int i = 0; i < p.Length; i++)
+ var sum = 0.0;
+ foreach (double t in p)
{
- if (p[i] < 0.0 || Double.IsNaN(p[i]))
+ if (t < 0.0 || Double.IsNaN(t))
{
return false;
}
- else
- {
- sum += p[i];
- }
- }
-
- if (sum == 0.0)
- {
- return false;
+
+ sum += t;
}
- return true;
+ return sum != 0.0;
}
///
@@ -155,21 +145,17 @@ namespace MathNet.Numerics.Distributions
///
/// Gets or sets the normalized probability vector of the multinomial.
///
- /// Note that sometimes the normalized probability vector cannot be represented
+ /// Sometimes the normalized probability vector cannot be represented
/// exactly in a floating point representation.
public double[] P
{
get
{
- double[] p = (double[]) _p.Clone();
+ var p = (double[])_p.Clone();
- double sum = 0.0;
- for (int i = 0; i < p.Length; i++)
- {
- sum += p[i];
- }
+ var sum = p.Sum();
- for (int i = 0; i < p.Length; i++)
+ for (var i = 0; i < p.Length; i++)
{
p[i] /= sum;
}
@@ -211,7 +197,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mean
{
- get { return _p.Mean(); }
+ get
+ {
+ return _p.Mean();
+ }
}
///
@@ -219,7 +208,10 @@ namespace MathNet.Numerics.Distributions
///
public double StdDev
{
- get { return _p.StandardDeviation(); }
+ get
+ {
+ return _p.StandardDeviation();
+ }
}
///
@@ -227,7 +219,10 @@ namespace MathNet.Numerics.Distributions
///
public double Variance
{
- get { return _p.Variance(); }
+ get
+ {
+ return _p.Variance();
+ }
}
///
@@ -235,34 +230,45 @@ namespace MathNet.Numerics.Distributions
///
public double Entropy
{
- get {
- double E = 0.0;
- for (int i = 0; i < _p.Length; i++)
- {
- double p = _p[i];
- E += p * Math.Log(p);
- }
- return E;
+ get
+ {
+ return _p.Sum(p => p * Math.Log(p));
}
}
///
/// Gets the skewness of the distribution.
///
+ /// Throws a .
public double Skewness
{
- get { throw new NotImplementedException(); }
+ get
+ {
+ throw new NotSupportedException();
+ }
}
///
/// Gets the smallest element in the domain of the distributions which can be represented by an integer.
///
- public int Minimum { get { return 0; } }
+ public int Minimum
+ {
+ get
+ {
+ return 0;
+ }
+ }
///
/// Gets the largest element in the domain of the distributions which can be represented by an integer.
///
- public int Maximum { get { return _p.Length-1; } }
+ public int Maximum
+ {
+ get
+ {
+ return _p.Length - 1;
+ }
+ }
///
/// Computes the cumulative distribution function of the Binomial distribution.
@@ -275,13 +281,14 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (x >= _p.Length)
+
+ if (x >= _p.Length)
{
return 1.0;
}
- var cdf = UnnormalizedCDF(_p);
- return cdf[(int) Math.Floor(x)] / cdf[_p.Length - 1];
+ var cdf = UnnormalizedCdf(_p);
+ return cdf[(int)Math.Floor(x)] / cdf[_p.Length - 1];
}
#endregion
@@ -289,55 +296,66 @@ namespace MathNet.Numerics.Distributions
#region IDiscreteDistribution Members
///
- /// The mode of the distribution.
+ /// Gets he mode of the distribution.
///
+ /// Throws a .
public int Mode
{
- get { throw new NotImplementedException(); }
+ get
+ {
+ throw new NotSupportedException();
+ }
}
///
- /// The median of the distribution.
+ /// Gets the median of the distribution.
///
public int Median
{
- get { return (int) _p.Median(); }
+ get
+ {
+ return (int)_p.Median();
+ }
}
///
- /// Computes the probability of a specific value.
+ /// Computes values of the probability mass function.
///
- public double Probability(int val)
+ /// The location in the domain where we want to evaluate the probability mass function.
+ /// the probability mass at location .
+ public double Probability(int k)
{
- if (val < 0)
+ if (k < 0)
{
return 0.0;
}
- if (val >= _p.Length)
+ if (k >= _p.Length)
{
return 0.0;
}
- return _p[val];
+ return _p[k];
}
///
- /// Computes the probability of a specific value.
+ /// Computes values of the log probability mass function.
///
- public double ProbabilityLn(int val)
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ /// the log probability mass at location .
+ public double ProbabilityLn(int k)
{
- if (val < 0)
+ if (k < 0)
{
return 0.0;
}
- if (val >= _p.Length)
+ if (k >= _p.Length)
{
return 0.0;
}
- return Math.Log(_p[val]);
+ return Math.Log(_p[k]);
}
///
@@ -367,7 +385,7 @@ namespace MathNet.Numerics.Distributions
/// An array of nonnegative ratios: this array does not need to be normalized
/// as this is often impossible using floating point arithmetic.
/// One random integer between 0 and the size of the categorical (exclusive).
- public static int Sample(System.Random rnd, double[] p)
+ public static int Sample(Random rnd, double[] p)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p))
{
@@ -375,7 +393,7 @@ namespace MathNet.Numerics.Distributions
}
// The cumulative density of p.
- double[] cp = UnnormalizedCDF(p);
+ var cp = UnnormalizedCdf(p);
return DoSample(rnd, cp);
}
@@ -386,8 +404,8 @@ namespace MathNet.Numerics.Distributions
/// The random number generator to use.
/// An array of nonnegative ratios: this array does not need to be normalized
/// as this is often impossible using floating point arithmetic.
- /// random integers between 0 and the size of the categorical (exclusive).
- public static IEnumerable Samples(System.Random rnd, double[] p)
+ /// random integers between 0 and the size of the categorical (exclusive).
+ public static IEnumerable Samples(Random rnd, double[] p)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p))
{
@@ -395,7 +413,7 @@ namespace MathNet.Numerics.Distributions
}
// The cumulative density of p.
- double[] cp = UnnormalizedCDF(p);
+ var cp = UnnormalizedCdf(p);
while (true)
{
@@ -410,11 +428,11 @@ namespace MathNet.Numerics.Distributions
/// An array of nonnegative ratios: this array does not need to be normalized
/// as this is often impossible using floating point arithmetic.
/// An array representing the unnormalized cumulative distribution function.
- internal static double[] UnnormalizedCDF(double[] p)
+ internal static double[] UnnormalizedCdf(double[] p)
{
- double[] cp = (double[]) p.Clone();
+ var cp = (double[])p.Clone();
- for (int i = 1; i < p.Length; i++)
+ for (var i = 1; i < p.Length; i++)
{
cp[i] += cp[i - 1];
}
@@ -428,16 +446,18 @@ namespace MathNet.Numerics.Distributions
/// The random number generator to use.
/// The cumulative distribution of the probability distribution.
/// One sample from the categorical distribution implied by .
- internal static int DoSample(System.Random rnd, double[] cdf)
+ internal static int DoSample(Random rnd, double[] cdf)
{
// TODO : use binary search to speed up this procedure.
- double u = rnd.NextDouble() * cdf[cdf.Length - 1];
- int idx = 0;
+ var u = rnd.NextDouble() * cdf[cdf.Length - 1];
+
+ var idx = 0;
while (u > cdf[idx])
{
idx++;
}
+
return idx;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Numerics/Distributions/Discrete/ConwayMaxwellPoisson.cs b/src/Numerics/Distributions/Discrete/ConwayMaxwellPoisson.cs
new file mode 100644
index 00000000..98618b47
--- /dev/null
+++ b/src/Numerics/Distributions/Discrete/ConwayMaxwellPoisson.cs
@@ -0,0 +1,562 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The Conway-Maxwell-Poisson distribution is a generalization of the Poisson, Geometric and Bernoulli
+ /// distributions. It is parameterized by two real numbers "lambda" and "nu". For
+ ///
+ /// - nu = 0 the distribution reverts to a Geometric distribution
+ /// - nu = 1 the distribution reverts to the Poisson distribution
+ /// - nu -> infinity the distribution converges to a Bernoulli distribution
+ ///
+ /// This implementation will cache the value of the normalization constant.
+ /// Wikipedia - ConwayMaxwellPoisson distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class ConwayMaxwellPoisson : IDiscreteDistribution
+ {
+ ///
+ /// Since many properties of the distribution can only be computed approximately, the tolerance
+ /// level specifies how much error we accept.
+ ///
+ private const double Tolerance = 1e-12;
+
+ ///
+ /// The mean of the distribution.
+ ///
+ private double _mean = double.MinValue;
+
+ ///
+ /// The variance of the distribution.
+ ///
+ private double _variance = double.MinValue;
+
+ ///
+ /// Caches the value of the normalization constant.
+ ///
+ private double _z = double.MinValue;
+
+ ///
+ /// The lambda parameter.
+ ///
+ private double _lambda;
+
+ ///
+ /// The nu parameter.
+ ///
+ private double _nu;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The lambda parameter.
+ ///
+ ///
+ /// The nu parameter.
+ ///
+ public ConwayMaxwellPoisson(double lambda, double nu)
+ {
+ SetParameters(lambda, nu);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The lambda parameter.
+ /// The nu parameter.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double lambda, double nu)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(lambda, nu))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _lambda = lambda;
+ _nu = nu;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The lambda parameter.
+ /// The nu parameter.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double lambda, double nu)
+ {
+ if (lambda <= 0.0)
+ {
+ return false;
+ }
+
+ if (nu < 0.0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the lambda parameter.
+ ///
+ /// The value of the lambda parameter.
+ public double Lambda
+ {
+ get
+ {
+ return _lambda;
+ }
+
+ set
+ {
+ SetParameters(value, _nu);
+ }
+ }
+
+ ///
+ /// Gets or sets the Nu parameter.
+ ///
+ /// The value of the Nu parameter.
+ public double Nu
+ {
+ get
+ {
+ return _nu;
+ }
+
+ set
+ {
+ SetParameters(_lambda, value);
+ }
+ }
+
+ ///
+ /// Returns a that represents this instance.
+ ///
+ ///
+ /// A that represents this instance.
+ ///
+ public override string ToString()
+ {
+ return "ConwayMaxwellPoisson(Lambda = " + _lambda + ", Nu = " + _nu + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ // Special case requiring no computation.
+ if (_lambda == 0)
+ {
+ return 0.0;
+ }
+
+ if (_mean != double.MinValue)
+ {
+ return _mean;
+ }
+
+ // The normalization constant for the distribution.
+ var z = 1 + _lambda;
+
+ // The probability of the next term.
+ var a1 = _lambda * _lambda / Math.Pow(2, _nu);
+
+ // The unnormalized mean.
+ var zx = _lambda;
+
+ // The contribution of the next term to the mean.
+ var ax1 = 2 * a1;
+
+ for (var i = 3; i < 1000; i++)
+ {
+ var e = _lambda / Math.Pow(i, _nu);
+ var ex = _lambda / Math.Pow(i, _nu - 1) / (i - 1);
+ var a2 = a1 * e;
+ var ax2 = ax1 * ex;
+
+ var m = zx / z;
+ var upper = (zx + (ax1 / (1 - (ax2 / ax1)))) / z;
+ var lower = zx / (z + (a1 / (1 - (a2 / a1))));
+
+ if ((ax2 < ax1) && (a2 < a1))
+ {
+ var r = (upper - lower) / m;
+ if (r < Tolerance)
+ {
+ break;
+ }
+ }
+
+ z = z + a1;
+ zx = zx + ax1;
+ a1 = a2;
+ ax1 = ax2;
+ }
+
+ _mean = zx / z;
+ return _mean;
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ // Special case requiring no computation.
+ if (_lambda == 0)
+ {
+ return 0.0;
+ }
+
+ if (_variance != double.MinValue)
+ {
+ return _variance;
+ }
+
+ // The normalization constant for the distribution.
+ var z = 1 + _lambda;
+
+ // The probability of the next term.
+ var a1 = _lambda * _lambda / Math.Pow(2, _nu);
+
+ // The unnormalized second moment.
+ var zxx = _lambda;
+
+ // The contribution of the next term to the second moment.
+ var axx1 = 4 * a1;
+
+ for (var i = 3; i < 1000; i++)
+ {
+ var e = _lambda / Math.Pow(i, _nu);
+ var exx = _lambda / Math.Pow(i, _nu - 2) / (i - 1) / (i - 1);
+ var a2 = a1 * e;
+ var axx2 = axx1 * exx;
+
+ var m = zxx / z;
+ var upper = (zxx + (axx1 / (1 - (axx2 / axx1)))) / z;
+ var lower = zxx / (z + (a1 / (1 - (a2 / a1))));
+
+ if ((axx2 < axx1) && (a2 < a1))
+ {
+ var r = (upper - lower) / m;
+ if (r < Tolerance)
+ {
+ break;
+ }
+ }
+
+ z = z + a1;
+ zxx = zxx + axx1;
+ a1 = a2;
+ axx1 = axx2;
+ }
+
+ var mean = Mean;
+ _variance = (zxx / z) - (mean * mean);
+ return _variance;
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(Variance);
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the ConwayMaxwellPoisson distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ double sum = 0;
+ for (var i = 0; i < x + 1; i++)
+ {
+ sum += Probability(i);
+ }
+
+ return sum;
+ }
+
+ #endregion
+
+ #region IDiscreteDistribution Members
+
+ ///
+ /// Gets the mode of the distribution
+ ///
+ public int Mode
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public int Median
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Gets the smallest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Minimum
+ {
+ get
+ {
+ return 0;
+ }
+ }
+
+ ///
+ /// Gets the largest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Maximum
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Computes the probability of a specific value.
+ ///
+ /// The location in the domain where we want to evaluate the probability mass function.
+ ///
+ /// the probability mass at location .
+ ///
+ public double Probability(int k)
+ {
+ return Math.Pow(_lambda, k) / Math.Pow(SpecialFunctions.Factorial(k), _nu) / Z;
+ }
+
+ ///
+ /// Computes the log probability of a specific value.
+ ///
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ ///
+ /// the log probability mass at location .
+ ///
+ public double ProbabilityLn(int k)
+ {
+ return Math.Log(Probability(k));
+ }
+
+ ///
+ /// Samples a Conway-Maxwell-Poisson distributed random variable.
+ ///
+ /// a sample from the distribution.
+ public int Sample()
+ {
+ return DoSample(RandomSource, _lambda, _nu, Z);
+ }
+
+ ///
+ /// Samples a sequence of a Conway-Maxwell-Poisson distributed random variables.
+ ///
+ ///
+ /// a sequence of samples from a Conway-Maxwell-Poisson distribution.
+ ///
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _lambda, _nu, Z);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Gets the normalization constant of the Conway-Maxwell-Poisson distribution.
+ ///
+ private double Z
+ {
+ get
+ {
+ if (_z != double.MinValue)
+ {
+ return _z;
+ }
+
+ _z = Normalization(_lambda, _nu);
+ return _z;
+ }
+ }
+
+ ///
+ /// Computes an approximate normalization constant for the CMP distribution.
+ ///
+ /// The lambda parameter for the CMP distribution.
+ /// The nu parameter for the CMP distribution.
+ ///
+ /// an approximate normalization constant for the CMP distribution.
+ ///
+ private static double Normalization(double lambda, double nu)
+ {
+ // Initialize Z with the first two terms.
+ var z = 1.0 + lambda;
+
+ // Remembers the last term added.
+ var t = lambda;
+
+ // Start adding more terms until convergence.
+ for (var i = 2; i < 1000; i++)
+ {
+ // The new addition for term i.
+ var e = lambda / Math.Pow(i, nu);
+
+ // The new term.
+ t = t * e;
+
+ // The updated normalization constant.
+ z = z + t;
+
+ // The stopping criterion.
+ if (e < 1)
+ {
+ if (t / (1 - e) / z < Tolerance)
+ {
+ break;
+ }
+ }
+ }
+
+ return z;
+ }
+
+ ///
+ /// Returns one trials from the distribution.
+ ///
+ /// The random number generator to use.
+ /// The lambda parameter
+ /// The nu parameter.
+ /// The z parameter.
+ ///
+ /// One sample from the distribution implied by .
+ ///
+ private static int DoSample(Random rnd, double lambda, double nu, double z)
+ {
+ var u = rnd.NextDouble();
+ var p = 1.0 / z;
+ var cdf = p;
+ var i = 0;
+
+ while (u > cdf)
+ {
+ i++;
+ p = p * lambda / Math.Pow(i, nu);
+ cdf += p;
+ }
+
+ return i;
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Discrete/DiscreteUniform.cs b/src/Numerics/Distributions/Discrete/DiscreteUniform.cs
index 69828e3d..a29ccb38 100644
--- a/src/Numerics/Distributions/Discrete/DiscreteUniform.cs
+++ b/src/Numerics/Distributions/Discrete/DiscreteUniform.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -42,7 +38,7 @@ namespace MathNet.Numerics.Distributions
/// Users can set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class DiscreteUniform : IDiscreteDistribution
{
///
@@ -66,14 +62,17 @@ namespace MathNet.Numerics.Distributions
/// Lower bound.
/// Upper bound; must be at least as large as .
public DiscreteUniform(int lower, int upper)
- {
+ {
SetParameters(lower, upper);
- RandomSource = new System.Random();
+ RandomSource = new Random();
}
///
- /// A string representation of the distribution.
+ /// Returns a that represents this instance.
///
+ ///
+ /// A that represents this instance.
+ ///
public override string ToString()
{
return "DiscreteUniform(Lower = " + _lower + ", Upper = " + _upper + ")";
@@ -84,7 +83,7 @@ namespace MathNet.Numerics.Distributions
///
/// Lower bound.
/// Upper bound; must be at least as large as .
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(int lower, int upper)
{
if (lower <= upper)
@@ -172,7 +171,10 @@ namespace MathNet.Numerics.Distributions
///
public double Mean
{
- get { return (_lower + _upper) / 2.0; }
+ get
+ {
+ return (_lower + _upper) / 2.0;
+ }
}
///
@@ -180,7 +182,10 @@ namespace MathNet.Numerics.Distributions
///
public double StdDev
{
- get { return System.Math.Sqrt(((_upper - _lower + 1.0) * (_upper - _lower + 1.0) - 1.0) / 12.0); }
+ get
+ {
+ return Math.Sqrt((((_upper - _lower + 1.0) * (_upper - _lower + 1.0)) - 1.0) / 12.0);
+ }
}
///
@@ -188,7 +193,10 @@ namespace MathNet.Numerics.Distributions
///
public double Variance
{
- get { return ((_upper - _lower + 1.0) * (_upper - _lower + 1.0) - 1.0) / 12.0; }
+ get
+ {
+ return (((_upper - _lower + 1.0) * (_upper - _lower + 1.0)) - 1.0) / 12.0;
+ }
}
///
@@ -196,7 +204,10 @@ namespace MathNet.Numerics.Distributions
///
public double Entropy
{
- get { return System.Math.Log(_upper - _lower + 1.0); }
+ get
+ {
+ return Math.Log(_upper - _lower + 1.0);
+ }
}
///
@@ -204,18 +215,33 @@ namespace MathNet.Numerics.Distributions
///
public double Skewness
{
- get { return 0.0; }
+ get
+ {
+ return 0.0;
+ }
}
///
/// Gets the smallest element in the domain of the distributions which can be represented by an integer.
///
- public int Minimum { get { return _lower; } }
+ public int Minimum
+ {
+ get
+ {
+ return _lower;
+ }
+ }
///
/// Gets the largest element in the domain of the distributions which can be represented by an integer.
///
- public int Maximum { get { return _upper; } }
+ public int Maximum
+ {
+ get
+ {
+ return _upper;
+ }
+ }
///
/// Computes the cumulative distribution function of the Bernoulli distribution.
@@ -228,7 +254,8 @@ namespace MathNet.Numerics.Distributions
{
return 0.0;
}
- else if (x >= _upper)
+
+ if (x >= _upper)
{
return 1.0;
}
@@ -241,27 +268,37 @@ namespace MathNet.Numerics.Distributions
#region IDiscreteDistribution Members
///
- /// The mode of the distribution; since every element in the domain has the same probability this method returns the middle one.
+ /// Gets the mode of the distribution; since every element in the domain has the same probability this method returns the middle one.
///
public int Mode
{
- get { return (int) Math.Floor((_lower + _upper) / 2.0); }
+ get
+ {
+ return (int)Math.Floor((_lower + _upper) / 2.0);
+ }
}
///
- /// The median of the distribution.
+ /// Gets the median of the distribution.
///
public int Median
{
- get { return (int)Math.Floor((_lower + _upper) / 2.0); }
+ get
+ {
+ return (int)Math.Floor((_lower + _upper) / 2.0);
+ }
}
///
- /// Computes the probability of a specific value.
+ /// Computes values of the probability mass function.
///
- public double Probability(int val)
+ /// The location in the domain where we want to evaluate the probability mass function.
+ ///
+ /// the probability mass at location .
+ ///
+ public double Probability(int k)
{
- if (val >= _lower && val <= _upper)
+ if (k >= _lower && k <= _upper)
{
return 1.0 / (_upper - _lower + 1);
}
@@ -272,19 +309,24 @@ namespace MathNet.Numerics.Distributions
///
/// Computes the probability of a specific value.
///
- public double ProbabilityLn(int val)
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ ///
+ /// the log probability mass at location .
+ ///
+ public double ProbabilityLn(int k)
{
- if (val >= _lower && val <= _upper)
+ if (k >= _lower && k <= _upper)
{
- return - Math.Log(_upper - _lower + 1);
+ return -Math.Log(_upper - _lower + 1);
}
return Double.NegativeInfinity;
}
///
- /// Samples a uniformly distributed random variable.
+ /// Draws a random sample from the distribution.
///
+ /// a sample from the distribution.
public int Sample()
{
return DoSample(RandomSource, _lower, _upper);
@@ -311,7 +353,7 @@ namespace MathNet.Numerics.Distributions
/// The lower bound of the uniform random variable.
/// The upper bound of the uniform random variable.
/// A sample from the discrete uniform distribution.
- public static int Sample(System.Random rnd, int lower, int upper)
+ public static int Sample(Random rnd, int lower, int upper)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(lower, upper))
{
@@ -328,7 +370,7 @@ namespace MathNet.Numerics.Distributions
/// The lower bound of the uniform random variable.
/// The upper bound of the uniform random variable.
/// a sequence of samples from the discrete uniform distribution.
- public static IEnumerable Samples(System.Random rnd, int lower, int upper)
+ public static IEnumerable Samples(Random rnd, int lower, int upper)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(lower, upper))
{
@@ -348,9 +390,9 @@ namespace MathNet.Numerics.Distributions
/// The lower bound of the uniform random variable.
/// The upper bound of the uniform random variable.
/// A random sample from the discrete uniform distribution.
- private static int DoSample(System.Random rnd, int lower, int upper)
+ private static int DoSample(Random rnd, int lower, int upper)
{
- return rnd.Next() % (upper - lower + 1) + lower;
+ return (rnd.Next() % (upper - lower + 1)) + lower;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Numerics/Distributions/Discrete/Geometric.cs b/src/Numerics/Distributions/Discrete/Geometric.cs
new file mode 100644
index 00000000..b8348349
--- /dev/null
+++ b/src/Numerics/Distributions/Discrete/Geometric.cs
@@ -0,0 +1,330 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The Geometric distribution is a distribution over positive integers parameterized by one positive real number.
+ /// This implementation of the Geometric distribution will never generate 0's.
+ /// Wikipedia - geometric distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Geometric : IDiscreteDistribution
+ {
+ ///
+ /// The geometric distribution parameter.
+ ///
+ private double _p;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the Geometric class.
+ ///
+ /// The probability of generating one.
+ /// If the Geometric parameter is not in the range [0,1].
+ public Geometric(double p)
+ {
+ SetParameters(p);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The probability of generating a one.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double p)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(p))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _p = p;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The probability of generating a one.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double p)
+ {
+ if (p >= 0.0 && p <= 1.0)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ ///
+ /// Gets or sets the probability of generating a one.
+ ///
+ public double P
+ {
+ get
+ {
+ return _p;
+ }
+
+ set
+ {
+ SetParameters(value);
+ }
+ }
+
+ ///
+ /// Returns a that represents this instance.
+ ///
+ ///
+ /// A that represents this instance.
+ ///
+ public override string ToString()
+ {
+ return "Geometric(P = " + _p + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ return 1.0 / _p;
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return (1.0 - _p) / (_p * _p);
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(1.0 - _p) / _p;
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ return ((-_p * Math.Log(_p, 2.0)) - ((1.0 - _p) * Math.Log(1.0 - _p, 2.0))) / _p;
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ /// Throws a not supported exception.
+ public double Skewness
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the Bernoulli distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ return 1.0 - Math.Pow(1.0 - _p, x);
+ }
+
+ #endregion
+
+ #region IDiscreteDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public int Mode
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public int Median
+ {
+ get
+ {
+ return (int)Math.Ceiling(-Math.Log(2.0) / Math.Log(1 - _p));
+ }
+ }
+
+ ///
+ /// Gets the smallest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Minimum
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ ///
+ /// Gets the largest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Maximum
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ ///
+ /// Computes values of the probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the probability mass function.
+ ///
+ /// the probability mass at location .
+ ///
+ public double Probability(int k)
+ {
+ if (k <= 0)
+ {
+ return 0.0;
+ }
+
+ return Math.Pow(1.0 - _p, k - 1) * _p;
+ }
+
+ ///
+ /// Computes values of the log probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ ///
+ /// the log probability mass at location .
+ ///
+ public double ProbabilityLn(int k)
+ {
+ if (k <= 0)
+ {
+ return Double.NegativeInfinity;
+ }
+
+ return ((k - 1) * Math.Log(1.0 - _p)) + Math.Log(_p);
+ }
+
+ ///
+ /// Samples a Geometric distributed random variable.
+ ///
+ /// A sample from the Geometric distribution.
+ public int Sample()
+ {
+ return DoSample(RandomSource, _p);
+ }
+
+ ///
+ /// Samples an array of Geometric distributed random variables.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _p);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Returns one sample from the distribution.
+ ///
+ /// The random number generator to use.
+ /// The p parameter
+ ///
+ /// One sample from the distribution implied by .
+ ///
+ private static int DoSample(Random rnd, double p)
+ {
+ return (int)Math.Ceiling(-Math.Log(rnd.NextDouble()) / p);
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Discrete/Hypergeometric.cs b/src/Numerics/Distributions/Discrete/Hypergeometric.cs
new file mode 100644
index 00000000..209e7abc
--- /dev/null
+++ b/src/Numerics/Distributions/Discrete/Hypergeometric.cs
@@ -0,0 +1,375 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// This class implements functionality for the Hypergeometric distribution. This distribution is
+ /// a discrete probability distribution that describes the number of successes in a sequence
+ /// of n draws from a finite population without replacement, just as the binomial distribution
+ /// describes the number of successes for draws with replacement
+ /// Wikipedia - Hypergeometric distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property .
+ ///
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Hypergeometric : IDiscreteDistribution
+ {
+ ///
+ /// The size of the population.
+ ///
+ private int _populationSize;
+
+ ///
+ /// The m parameter of the distribution.
+ ///
+ private int _m;
+
+ ///
+ /// The n parameter (number to draw) of the distribution.
+ ///
+ private int _n;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the Hypergeometric class.
+ ///
+ /// The population size.
+ /// The m parameter of the distribution.
+ /// The n parameter of the distribution.
+ public Hypergeometric(int populationSize, int m, int n)
+ {
+ SetParameters(populationSize, m, n);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The Total parameter of the distribution.
+ /// The m parameter of the distribution.
+ /// The n parameter of the distribution.
+ private void SetParameters(int total, int m, int n)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(total, m, n))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _populationSize = total;
+ _m = m;
+ _n = n;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The Total parameter of the distribution.
+ /// The m parameter of the distribution.
+ /// The n parameter of the distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(int total, int m, int n)
+ {
+ if (total < 0 || m < 0 || n < 0)
+ {
+ return false;
+ }
+
+ if (m > total || n > total)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the population size.
+ ///
+ public int PopulationSize
+ {
+ get { return _populationSize; }
+ set { SetParameters(value, _m, _n); }
+ }
+
+ ///
+ /// Gets or sets the n parameter of the distribution.
+ ///
+ public int N
+ {
+ get { return _n; }
+ set { SetParameters(_populationSize, value, _n); }
+ }
+
+ ///
+ /// Gets or sets the m parameter of the distribution.
+ ///
+ public int M
+ {
+ get { return _m; }
+ set { SetParameters(_populationSize, _m, value); }
+ }
+
+ ///
+ /// Returns a that represents this instance.
+ ///
+ ///
+ /// A that represents this instance.
+ ///
+ public override string ToString()
+ {
+ return "Hypergeometric(N = " + _populationSize + ", m = " + _m + ", n = " + _n + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ return (double)_m * _n / _populationSize;
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return _n * _m * (_populationSize - _n) * (_populationSize - _m) / (_populationSize * _populationSize * (_populationSize - 1.0));
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get { return Math.Sqrt(Variance); }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get { throw new NotSupportedException(); }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ return (Math.Sqrt(_populationSize - 1.0) * (_populationSize - (2 * _n)) * (_populationSize - (2 * _m))) / (Math.Sqrt(_n * _m * (_populationSize - _m) * (_populationSize - _n)) * (_populationSize - 2.0));
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ int alpha = Minimum;
+ int beta = Maximum;
+ if (x <= alpha)
+ {
+ return 0.0;
+ }
+
+ if (x > beta)
+ {
+ return 1.0;
+ }
+
+ var sum = 0.0;
+ var k = (int)Math.Ceiling(x - alpha) - 1;
+ for (var i = alpha; i <= alpha + k; i++)
+ {
+ sum += SpecialFunctions.Binomial(_m, i) * SpecialFunctions.Binomial(_populationSize - _m, _n - i);
+ }
+
+ return sum / SpecialFunctions.Binomial(_populationSize, _n);
+ }
+
+ #endregion
+
+ #region IDiscreteDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public int Mode
+ {
+ get { return (_n + 1) * (_m + 1) / (_populationSize + 2); }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public int Median
+ {
+ get { throw new NotSupportedException(); }
+ }
+
+ ///
+ /// Gets the minimum of the distribution.
+ ///
+ public int Minimum
+ {
+ get { return Math.Max(0, _n + _m - _populationSize); }
+ }
+
+ ///
+ /// Gets the maximum of the distribution.
+ ///
+ public int Maximum
+ {
+ get { return Math.Min(_m, _n); }
+ }
+
+ ///
+ /// Computes values of the probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the probability mass function.
+ ///
+ /// the probability mass at location .
+ ///
+ public double Probability(int k)
+ {
+ return SpecialFunctions.Binomial(_m, k) * SpecialFunctions.Binomial(_populationSize - _m, _n - k) / SpecialFunctions.Binomial(_populationSize, _n);
+ }
+
+ ///
+ /// Computes values of the log probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ ///
+ /// the log probability mass at location .
+ ///
+ public double ProbabilityLn(int k)
+ {
+ return Math.Log(Probability(k));
+ }
+
+ ///
+ /// Samples a Hypergeometric distributed random variable.
+ ///
+ /// The number of successes in n trials.
+ public int Sample()
+ {
+ return DoSample(RandomSource, _populationSize, _m, _n);
+ }
+
+ ///
+ /// Samples an array of Hypergeometric distributed random variables.
+ ///
+ /// a sequence of successes in n trials.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _populationSize, _m, _n);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Generates a sample from the Hypergeometric distribution without doing parameter checking.
+ ///
+ /// The random number generator to use.
+ /// The Total parameter of the distribution.
+ /// The m parameter of the distribution.
+ /// The n parameter of the distribution.
+ /// a random number from the Hypergeometric distribution.
+ private static int DoSample(Random rnd, int size, int m, int n)
+ {
+ var x = 0;
+
+ do
+ {
+ var p = (double)m / size;
+ var r = rnd.NextDouble();
+ if (r < p)
+ {
+ x++;
+ m--;
+ }
+
+ size--;
+ }
+ while (1 < n);
+
+ return x;
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Discrete/NegativeBinomial.cs b/src/Numerics/Distributions/Discrete/NegativeBinomial.cs
new file mode 100644
index 00000000..2d6633d9
--- /dev/null
+++ b/src/Numerics/Distributions/Discrete/NegativeBinomial.cs
@@ -0,0 +1,383 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// The negative binomial is a distribution over the natural numbers with two parameters r,p. For the special
+ /// case that r is an integer one can interpret the distribution as the number of tails before the r'th head
+ /// when the probability of head is p.
+ /// Wikipedia - NegativeBinomial distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class NegativeBinomial : IDiscreteDistribution
+ {
+ ///
+ /// The r parameter of the distribution.
+ ///
+ private double _r;
+
+ ///
+ /// The p parameter of the distribution.
+ ///
+ private double _p;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Gets or sets the r parameter.
+ ///
+ public double R
+ {
+ get
+ {
+ return _r;
+ }
+
+ set
+ {
+ SetParameters(value, _p);
+ }
+ }
+
+ ///
+ /// Gets or sets the p parameter.
+ ///
+ public double P
+ {
+ get
+ {
+ return _p;
+ }
+
+ set
+ {
+ SetParameters(_r, value);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The r parameter.
+ ///
+ ///
+ /// The p parameter.
+ ///
+ public NegativeBinomial(double r, double p)
+ {
+ SetParameters(r, p);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The r parameter.
+ /// The p parameter.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double r, double p)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(r, p))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _p = p;
+ _r = r;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The r parameter.
+ /// The p parameter.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double r, double p)
+ {
+ if (r < 0.0 || Double.IsNaN(r))
+ {
+ return false;
+ }
+
+ if (p < 0.0 || p > 1.0 || Double.IsNaN(p))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Returns a that represents this instance.
+ ///
+ ///
+ /// A that represents this instance.
+ ///
+ public override string ToString()
+ {
+ return "NegativeBinomial(R = " + _r + ", P = " + _p + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the distribution's random number generator.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ return _r * (1.0 - _p) / _p;
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ return _r * (1.0 - _p) / (_p * _p);
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(_r * (1.0 - _p)) / _p;
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ throw new Exception("Not implemented yet.");
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ return (2.0 - _p) / Math.Sqrt(_r * (1.0 - _p));
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the NegativeBinomial distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #region IDiscreteDistribution Members
+
+ ///
+ /// Gets the mode of the distribution
+ ///
+ public int Mode
+ {
+ get
+ {
+ return _r > 1.0 ? (int)Math.Floor((_r - 1.0) * (1.0 - _p) / _p) : 0;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public int Median
+ {
+ get
+ {
+ throw new Exception("Not implemented yet.");
+ }
+ }
+
+ ///
+ /// Gets the smallest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Minimum
+ {
+ get
+ {
+ return 0;
+ }
+ }
+
+ ///
+ /// Gets the largest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Maximum
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Computes values of the probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the probability mass function.
+ ///
+ /// the probability mass at location .
+ ///
+ public double Probability(int k)
+ {
+ var ln = SpecialFunctions.GammaLn(_r + k)
+ - SpecialFunctions.GammaLn(_r)
+ - SpecialFunctions.GammaLn(k + 1.0)
+ + (_r * Math.Log(_p))
+ + (k * Math.Log(1.0 - _p));
+ return Math.Exp(ln);
+ }
+
+ ///
+ /// Computes values of the log probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ ///
+ /// the log probability mass at location .
+ ///
+ public double ProbabilityLn(int k)
+ {
+ var ln = SpecialFunctions.GammaLn(_r + k)
+ - SpecialFunctions.GammaLn(_r)
+ - SpecialFunctions.GammaLn(k + 1.0)
+ + (_r * Math.Log(_p))
+ + (k * Math.Log(1.0 - _p));
+ return ln;
+ }
+
+ ///
+ /// Samples a NegativeBinomial distributed random variable.
+ ///
+ /// a sample from the distribution.
+ public int Sample()
+ {
+ return DoSample(RandomSource, _r, _p);
+ }
+
+ ///
+ /// Samples an array of NegativeBinomial distributed random variables.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _r, _p);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Samples a negative binomial distributed random variable.
+ ///
+ /// The random number generator to use.
+ /// The r parameter.
+ /// The p parameter.
+ /// a sample from the distribution.
+ private static int DoSample(Random rnd, double r, double p)
+ {
+ var lambda = Gamma.Sample(rnd, r, p);
+ return DoPoissonSample(rnd, lambda);
+ }
+
+ ///
+ /// Use Knuth's method to generate Poisson distributed random variables.
+ ///
+ /// The random number generator.
+ /// The lambda value.
+ /// a Poisson distributed random number.
+ private static int DoPoissonSample(Random rnd, double lambda)
+ {
+ var c = Math.Exp(-lambda);
+ var p = 1.0;
+ var k = 0;
+ do
+ {
+ k = k + 1;
+ p = p * rnd.NextDouble();
+ }
+ while (p >= c);
+ return k - 1;
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Discrete/Zipf.cs b/src/Numerics/Distributions/Discrete/Zipf.cs
new file mode 100644
index 00000000..54232f75
--- /dev/null
+++ b/src/Numerics/Distributions/Discrete/Zipf.cs
@@ -0,0 +1,387 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using System.Collections.Generic;
+ using Properties;
+
+ ///
+ /// Zipf's law, an empirical law formulated using mathematical statistics, refers to the fact
+ /// that many types of data studied in the physical and social sciences can be approximated with
+ /// a Zipfian distribution, one of a family of related discrete power law probability distributions.
+ /// For details about this distribution, see
+ /// Wikipedia - Zipf distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can get/set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Zipf : IDiscreteDistribution
+ {
+ ///
+ /// The s parameter of the distribution.
+ ///
+ private double _s;
+
+ ///
+ /// The n parameter of the distribution.
+ ///
+ private int _n;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The s parameter of the distribution.
+ ///
+ ///
+ /// The n parameter of the distribution.
+ ///
+ public Zipf(double s, int n)
+ {
+ SetParameters(s, n);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The s parameter of the distribution.
+ /// The n parameter of the distribution.
+ private void SetParameters(double s, int n)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(s, n))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _s = s;
+ _n = n;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The s parameter of the distribution.
+ /// The n parameter of the distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double s, int n)
+ {
+ if (n <= 0 || s <= 0 || Double.IsNaN(s))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the s parameter of the distribution.
+ ///
+ public double S
+ {
+ get
+ {
+ return _s;
+ }
+
+ set
+ {
+ SetParameters(value, _n);
+ }
+ }
+
+ ///
+ /// Gets or sets the n parameter of the distribution.
+ ///
+ public int N
+ {
+ get
+ {
+ return _n;
+ }
+
+ set
+ {
+ SetParameters(_s, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Zipf(S = " + _s + ", N = " + _n + ")";
+ }
+
+ #region IDistribution Members
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ public double Mean
+ {
+ get
+ {
+ return SpecialFunctions.GeneralHarmonic(_n, _s - 1.0) / SpecialFunctions.GeneralHarmonic(_n, _s);
+ }
+ }
+
+ ///
+ /// Gets the variance of the distribution.
+ ///
+ public double Variance
+ {
+ get
+ {
+ if (_s <= 3)
+ {
+ throw new NotSupportedException();
+ }
+
+ var generalHarmonicsNS = SpecialFunctions.GeneralHarmonic(_n, _s);
+ return (SpecialFunctions.GeneralHarmonic(_n, _s - 2) * SpecialFunctions.GeneralHarmonic(_n, _s)) - (Math.Pow(SpecialFunctions.GeneralHarmonic(_n, _s - 1), 2) / (generalHarmonicsNS * generalHarmonicsNS));
+ }
+ }
+
+ ///
+ /// Gets the standard deviation of the distribution.
+ ///
+ public double StdDev
+ {
+ get
+ {
+ return Math.Sqrt(Variance);
+ }
+ }
+
+ ///
+ /// Gets the entropy of the distribution.
+ ///
+ public double Entropy
+ {
+ get
+ {
+ double sum = 0;
+ for (var i = 0; i < _n; i++)
+ {
+ sum += Math.Log(i + 1) / Math.Pow(i + 1, _s);
+ }
+
+ return ((_s / SpecialFunctions.GeneralHarmonic(_n, _s)) * sum) + Math.Log(SpecialFunctions.GeneralHarmonic(_n, _s));
+ }
+ }
+
+ ///
+ /// Gets the skewness of the distribution.
+ ///
+ public double Skewness
+ {
+ get
+ {
+ if (_s <= 4)
+ {
+ throw new NotSupportedException();
+ }
+
+ return (SpecialFunctions.GeneralHarmonic(_n, _s - 3) * Math.Pow(SpecialFunctions.GeneralHarmonic(_n, _s), 2) - SpecialFunctions.GeneralHarmonic(_n, _s - 1) * (3 * SpecialFunctions.GeneralHarmonic(_n, _s - 2) * SpecialFunctions.GeneralHarmonic(_n, _s) - Math.Pow(SpecialFunctions.GeneralHarmonic(_n, _s - 1), 2))) / Math.Pow(SpecialFunctions.GeneralHarmonic(_n, _s - 2) * SpecialFunctions.GeneralHarmonic(_n, _s) - Math.Pow(SpecialFunctions.GeneralHarmonic(_n, _s - 1), 2), 1.5);
+ }
+ }
+
+ ///
+ /// Computes the cumulative distribution function of the distribution.
+ ///
+ /// The location at which to compute the cumulative density.
+ /// the cumulative density at .
+ public double CumulativeDistribution(double x)
+ {
+ if (x <= 1)
+ {
+ return 0.0;
+ }
+
+ var sum = 0.0;
+ var k = (int)Math.Ceiling(x) - 1;
+ for (var i = 0; i < k; i++)
+ {
+ sum += Math.Pow(i + 1, -_s);
+ }
+
+ return sum / SpecialFunctions.GeneralHarmonic(_n, _s);
+ }
+
+ #endregion
+
+ #region IDiscreteDistribution Members
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ public int Mode
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ ///
+ /// Gets the median of the distribution.
+ ///
+ public int Median
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Gets the smallest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Minimum
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ ///
+ /// Gets the largest element in the domain of the distributions which can be represented by an integer.
+ ///
+ public int Maximum
+ {
+ get
+ {
+ return _n;
+ }
+ }
+
+ ///
+ /// Computes values of the probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the probability mass function.
+ ///
+ /// the probability mass at location .
+ ///
+ public double Probability(int k)
+ {
+ return (1.0 / Math.Pow(k, _s)) / SpecialFunctions.GeneralHarmonic(_n, _s);
+ }
+
+ ///
+ /// Computes values of the log probability mass function.
+ ///
+ /// The location in the domain where we want to evaluate the log probability mass function.
+ ///
+ /// the log probability mass at location .
+ ///
+ public double ProbabilityLn(int k)
+ {
+ return Math.Log(Probability(k));
+ }
+
+ ///
+ /// Draws a random sample from the distribution.
+ ///
+ /// a sample from the distribution.
+ public int Sample()
+ {
+ return DoSample(RandomSource, _s, _n);
+ }
+
+ ///
+ /// Samples an array of zipf distributed random variables.
+ ///
+ /// a sequence of samples from the distribution.
+ public IEnumerable Samples()
+ {
+ while (true)
+ {
+ yield return DoSample(RandomSource, _s, _n);
+ }
+ }
+
+ #endregion
+
+ ///
+ /// Generates a sample from the Zipf distribution without doing parameter checking.
+ ///
+ /// The random number generator to use.
+ /// The s parameter of the distribution.
+ /// The n parameter of the distribution.
+ /// a random number from the Zipf distribution.
+ private static int DoSample(Random rnd, double s, int n)
+ {
+ var r = rnd.NextDouble();
+ var x = 1;
+ var p = 1.0 / SpecialFunctions.GeneralHarmonic(n, s);
+ do
+ {
+ r -= p;
+ if (r >= 0)
+ {
+ x++;
+ p = p / Math.Pow((double)(x - 1) / x, s - 1);
+ }
+ }
+ while (r >= 0);
+ return x;
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Multivariate/Dirichlet.cs b/src/Numerics/Distributions/Multivariate/Dirichlet.cs
index b63b1493..7b468e45 100644
--- a/src/Numerics/Distributions/Multivariate/Dirichlet.cs
+++ b/src/Numerics/Distributions/Multivariate/Dirichlet.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -31,6 +27,7 @@
namespace MathNet.Numerics.Distributions
{
using System;
+ using System.Linq;
using Properties;
///
@@ -41,10 +38,12 @@ namespace MathNet.Numerics.Distributions
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Dirichlet
{
- // The Dirichlet distribution parameters.
+ ///
+ /// The Dirichlet distribution parameters.
+ ///
private double[] _alpha;
///
@@ -64,16 +63,21 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Constructs a new symmetric Dirichlet distribution. The distribution will
- /// be initialized with the default random number generator.
+ /// Initializes a new instance of the class.
+ ///
+ /// random number generator.
///
- /// The value of each parameter of the Dirichlet distribution.
- /// The dimension of the Dirichlet distribution.
+ ///
+ /// The value of each parameter of the Dirichlet distribution.
+ ///
+ ///
+ /// The dimension of the Dirichlet distribution.
+ ///
public Dirichlet(double alpha, int k)
{
// Create a parameter structure.
- double[] parm = new double[k];
- for (int i = 0; i < k; i++)
+ var parm = new double[k];
+ for (var i = 0; i < k; i++)
{
parm[i] = alpha;
}
@@ -83,33 +87,32 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Checks whether the parameters of the distribution are valid: no parameter can be less than zero and
- /// at least one parameter should be larger than zero.
+ /// Checks whether the parameters of the distribution are valid: no
+ /// parameter can be less than zero and at least one parameter should be
+ /// larger than zero.
///
- /// The parameters of the Dirichlet distribution.
- /// True when the parameters are valid, false otherwise.
+ /// The parameters of the Dirichlet distribution.
+ ///
+ /// true when the parameters are valid, false
+ /// otherwise.
public static bool IsValidParameterSet(double[] alpha)
{
- bool allzero = true;
+ var allzero = true;
- for (int i = 0; i < alpha.Length; i++)
+ foreach (var t in alpha)
{
- if (alpha[i] < 0.0)
+ if (t < 0.0)
{
return false;
}
- else if (alpha[i] > 0.0)
+
+ if (t > 0.0)
{
allzero = false;
}
}
- if (allzero)
- {
- return false;
- }
-
- return true;
+ return !allzero;
}
///
@@ -124,15 +127,18 @@ namespace MathNet.Numerics.Distributions
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
- _alpha = (double[]) alpha.Clone();
+ _alpha = (double[])alpha.Clone();
}
///
- /// A string representation of the distribution.
+ /// Returns a that represents this instance.
///
+ ///
+ /// A that represents this instance.
+ ///
public override string ToString()
{
- return "Dirichlet(Dimension = " + this.Dimension + ")";
+ return "Dirichlet(Dimension = " + Dimension + ")";
}
///
@@ -140,7 +146,10 @@ namespace MathNet.Numerics.Distributions
///
public int Dimension
{
- get { return _alpha.Length; }
+ get
+ {
+ return _alpha.Length;
+ }
}
///
@@ -152,6 +161,7 @@ namespace MathNet.Numerics.Distributions
{
return _alpha;
}
+
set
{
SetParameters(value);
@@ -159,18 +169,13 @@ namespace MathNet.Numerics.Distributions
}
///
- /// The sum of the Dirichlet parameters.
+ /// Gets the sum of the Dirichlet parameters.
///
private double AlphaSum
{
get
{
- double s = 0.0;
- for (int i = 0; i < _alpha.Length; i++)
- {
- s += _alpha[i];
- }
- return s;
+ return _alpha.Sum();
}
}
@@ -181,9 +186,9 @@ namespace MathNet.Numerics.Distributions
{
get
{
- double sum = AlphaSum;
- double[] parm = new double[Dimension];
- for (int i = 0; i < Dimension; i++)
+ var sum = AlphaSum;
+ var parm = new double[Dimension];
+ for (var i = 0; i < Dimension; i++)
{
parm[i] = _alpha[i] / sum;
}
@@ -199,12 +204,13 @@ namespace MathNet.Numerics.Distributions
{
get
{
- double s = this.AlphaSum;
- double[] v = new double[_alpha.Length];
- for (int i = 0; i < _alpha.Length; i++)
+ var s = AlphaSum;
+ var v = new double[_alpha.Length];
+ for (var i = 0; i < _alpha.Length; i++)
{
- v[i] = _alpha[i]*(s - _alpha[i])/(s*s*(s + 1.0));
+ v[i] = _alpha[i] * (s - _alpha[i]) / (s * s * (s + 1.0));
}
+
return v;
}
}
@@ -233,6 +239,7 @@ namespace MathNet.Numerics.Distributions
///
/// Samples a Dirichlet distributed random vector.
///
+ /// A sample from this distribution.
public double[] Sample()
{
return Sample(RandomSource, _alpha);
@@ -243,17 +250,18 @@ namespace MathNet.Numerics.Distributions
///
/// The random number generator to use.
/// The Dirichlet distribution parameter.
- public static double[] Sample(System.Random rnd, double[] alpha)
+ /// a sample from the distribution.
+ public static double[] Sample(Random rnd, double[] alpha)
{
if (Control.CheckDistributionParameters && ! IsValidParameterSet(alpha))
{
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
- int n = alpha.Length;
- double[] gv = new double[n];
- double sum = 0.0;
- for (int i = 0; i < n; i++)
+ var n = alpha.Length;
+ var gv = new double[n];
+ var sum = 0.0;
+ for (var i = 0; i < n; i++)
{
if (alpha[i] == 0.0)
{
@@ -267,7 +275,7 @@ namespace MathNet.Numerics.Distributions
sum += gv[i];
}
- for (int i = 0; i < n; i++)
+ for (var i = 0; i < n; i++)
{
gv[i] /= sum;
}
@@ -275,4 +283,4 @@ namespace MathNet.Numerics.Distributions
return gv;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Numerics/Distributions/Multivariate/InverseWishart.cs b/src/Numerics/Distributions/Multivariate/InverseWishart.cs
new file mode 100644
index 00000000..2fa00128
--- /dev/null
+++ b/src/Numerics/Distributions/Multivariate/InverseWishart.cs
@@ -0,0 +1,265 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using LinearAlgebra.Generic;
+ using LinearAlgebra.Generic.Factorization;
+ using Properties;
+
+ ///
+ /// This class implements functionality for the inverse Wishart distribution. This distribution is
+ /// parameterized by the degrees of freedom nu and the scale matrix S. The inverse Wishart distribution
+ /// is the conjugate prior for the covariance matrix of a multivariate normal distribution.
+ /// Wikipedia - Inverse-Wishart distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class InverseWishart
+ {
+ ///
+ /// The degrees of freedom for the inverse Wishart distribution.
+ ///
+ private double _nu;
+
+ ///
+ /// The scale matrix for the inverse Wishart distribution.
+ ///
+ private Matrix _s;
+
+ ///
+ /// Caches the Cholesky factorization of the scale matrix.
+ ///
+ private Cholesky _chol;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The degrees of freedom for the inverse Wishart distribution.
+ ///
+ ///
+ /// The scale matrix for the inverse Wishart distribution.
+ ///
+ public InverseWishart(double nu, Matrix s)
+ {
+ SetParameters(nu, s);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "InverseWishart(Nu = " + _nu + ", Rows = " + _s.RowCount + ", Columns = " + _s.ColumnCount + ")";
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The degrees of freedom for the Wishart distribution.
+ /// The scale matrix for the Wishart distribution.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double nu, Matrix s)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(nu, s))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _nu = nu;
+ _s = s;
+ _chol = Cholesky.Create(_s);
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The degrees of freedom for the Wishart distribution.
+ /// The scale matrix for the Wishart distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double nu, Matrix s)
+ {
+ if (s.RowCount != s.ColumnCount)
+ {
+ return false;
+ }
+
+ for (var i = 0; i < s.RowCount; i++)
+ {
+ if (s[i, i] <= 0.0)
+ {
+ return false;
+ }
+ }
+
+ if (nu <= 0.0 || Double.IsNaN(nu))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the degrees of freedom for the inverse Wishart distribution.
+ ///
+ public double Nu
+ {
+ get
+ {
+ return _nu;
+ }
+
+ set
+ {
+ SetParameters(value, _s);
+ }
+ }
+
+ ///
+ /// Gets or sets the scale matrix for the inverse Wishart distribution.
+ ///
+ public Matrix S
+ {
+ get
+ {
+ return _s;
+ }
+
+ set
+ {
+ SetParameters(_nu, value);
+ }
+ }
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean.
+ ///
+ /// The mean of the distribution.
+ public Matrix Mean
+ {
+ get
+ {
+ return _s * (1.0 / (_nu - _s.RowCount - 1.0));
+ }
+ }
+
+ ///
+ /// Evaluates the probability density function for the inverse Wishart distribution.
+ ///
+ /// The matrix at which to evaluate the density at.
+ /// If the argument does not have the same dimensions as the scale matrix.
+ /// the density at .
+ public double Density(Matrix x)
+ {
+ var p = _s.RowCount;
+
+ if (x.RowCount != p || x.ColumnCount != p)
+ {
+ throw new ArgumentOutOfRangeException("x", Resources.ArgumentMatrixDimensions);
+ }
+
+ var chol = Cholesky.Create(x);
+ var dX = chol.Determinant;
+ var sXi = chol.Solve(S);
+
+ // Compute the multivariate Gamma function.
+ var gp = Math.Pow(Constants.Pi, p * (p - 1.0) / 4.0);
+ for (var j = 1; j <= p; j++)
+ {
+ gp *= SpecialFunctions.Gamma((_nu + 1.0 - j) / 2.0);
+ }
+
+ return Math.Pow(dX, -(_nu + p + 1.0) / 2.0)
+ * Math.Exp(-0.5 * sXi.Trace())
+ * Math.Pow(_chol.Determinant, _nu / 2.0)
+ / Math.Pow(2.0, _nu * p / 2.0)
+ / gp;
+ }
+
+ ///
+ /// Samples an inverse Wishart distributed random variable by sampling
+ /// a Wishart random variable and inverting the matrix.
+ ///
+ /// a sample from the distribution.
+ public Matrix Sample()
+ {
+ return Sample(RandomSource, _nu, _s);
+ }
+
+ ///
+ /// Samples an inverse Wishart distributed random variable by sampling
+ /// a Wishart random variable and inverting the matrix.
+ ///
+ /// The random number generator to use.
+ /// The degrees of freedom.
+ /// The scale matrix.
+ /// a sample from the distribution.
+ public static Matrix Sample(Random rnd, double nu, Matrix s)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(nu, s))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ var r = Wishart.Sample(rnd, nu, s.Inverse());
+ return r.Inverse();
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Multivariate/MatrixNormal.cs b/src/Numerics/Distributions/Multivariate/MatrixNormal.cs
new file mode 100644
index 00000000..638fc761
--- /dev/null
+++ b/src/Numerics/Distributions/Multivariate/MatrixNormal.cs
@@ -0,0 +1,341 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using LinearAlgebra.Double;
+ using LinearAlgebra.Generic;
+ using LinearAlgebra.Generic.Factorization;
+ using Properties;
+
+ ///
+ /// This class implements functionality for matrix valued normal distributions. The distribution
+ /// is parameterized by a mean matrix (M), a covariance matrix for the rows (V) and a covariance matrix
+ /// for the columns (K). If the dimension of M is d-by-m then V is d-by-d and K is m-by-m.
+ /// Wikipedia - MatrixNormal distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class MatrixNormal
+ {
+ ///
+ /// The mean of the matrix normal distribution.
+ ///
+ private Matrix _m;
+
+ ///
+ /// The covariance matrix for the rows.
+ ///
+ private Matrix _v;
+
+ ///
+ /// The covariance matrix for the columns.
+ ///
+ private Matrix _k;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The mean of the matrix normal.
+ ///
+ ///
+ /// The covariance matrix for the rows.
+ ///
+ ///
+ /// The covariance matrix for the columns.
+ ///
+ ///
+ /// If the dimensions of the mean and two covariance matrices don't match.
+ ///
+ public MatrixNormal(Matrix m, Matrix v, Matrix k)
+ {
+ SetParameters(m, v, k);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Returns a that represents this instance.
+ ///
+ ///
+ /// A that represents this instance.
+ ///
+ public override string ToString()
+ {
+ return "MatrixNormal(Rows = " + _m.RowCount + ", Columns = " + _m.ColumnCount + ")";
+ }
+
+ ///
+ /// Gets or sets the mean. (M)
+ ///
+ /// The mean of the distribution.
+ public Matrix Mean
+ {
+ get
+ {
+ return _m;
+ }
+
+ set
+ {
+ SetParameters(value, _v, _k);
+ }
+ }
+
+ ///
+ /// Gets or sets the row covariance. (V)
+ ///
+ /// The row covariance.
+ public Matrix RowCovariance
+ {
+ get
+ {
+ return _v;
+ }
+
+ set
+ {
+ SetParameters(_m, value, _k);
+ }
+ }
+
+ ///
+ /// Gets or sets the column covariance. (K)
+ ///
+ /// The column covariance.
+ public Matrix ColumnCovariance
+ {
+ get
+ {
+ return _k;
+ }
+
+ set
+ {
+ SetParameters(_m, _v, value);
+ }
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The mean of the matrix normal.
+ /// The covariance matrix for the rows.
+ /// The covariance matrix for the columns.
+ /// When the parameters don't pass the function.
+ private void SetParameters(Matrix m, Matrix v, Matrix k)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(m, v, k))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _m = m;
+ _v = v;
+ _k = k;
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The mean of the matrix normal.
+ /// The covariance matrix for the rows.
+ /// The covariance matrix for the columns.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(Matrix m, Matrix v, Matrix k)
+ {
+ var n = m.RowCount;
+ var p = m.ColumnCount;
+ if (v.ColumnCount != n || v.RowCount != n)
+ {
+ return false;
+ }
+
+ if (k.ColumnCount != p || k.RowCount != p)
+ {
+ return false;
+ }
+
+ for (var i = 0; i < v.RowCount; i++)
+ {
+ if (v[i, i] <= 0)
+ {
+ return false;
+ }
+ }
+
+ for (var i = 0; i < k.RowCount; i++)
+ {
+ if (k[i, i] <= 0)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Evaluates the probability density function for the matrix normal distribution.
+ ///
+ /// The matrix at which to evaluate the density at.
+ /// the density at
+ /// If the argument does not have the correct dimensions.
+ public double Density(Matrix x)
+ {
+ if (x.RowCount != _m.RowCount || x.ColumnCount != _m.ColumnCount)
+ {
+ throw new ArgumentOutOfRangeException("x", Resources.ArgumentMatrixDimensions);
+ }
+
+ var a = x - _m;
+ var cholV = Cholesky.Create(_v);
+ var cholK = Cholesky.Create(_k);
+
+ return Math.Exp(-0.5 * cholV.Solve(a.Transpose() * cholK.Solve(a)).Trace())
+ / Math.Pow(2.0 * Constants.Pi, x.RowCount * x.ColumnCount / 2.0)
+ / Math.Pow(cholV.Determinant, x.RowCount / 2.0)
+ / Math.Pow(cholK.Determinant, x.ColumnCount / 2.0);
+ }
+
+ ///
+ /// Samples a matrix normal distributed random variable.
+ ///
+ /// A random number from this distribution.
+ public Matrix Sample()
+ {
+ return Sample(RandomSource, _m, _v, _k);
+ }
+
+ ///
+ /// Samples a matrix normal distributed random variable.
+ ///
+ /// The random number generator to use.
+ /// The mean of the matrix normal.
+ /// The covariance matrix for the rows.
+ /// The covariance matrix for the columns.
+ /// If the dimensions of the mean and two covariance matrices don't match.
+ /// a sequence of samples from the distribution.
+ public static Matrix Sample(Random rnd, Matrix m, Matrix v, Matrix k)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(m, v, k))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ var n = m.RowCount;
+ var p = m.ColumnCount;
+
+ // Compute the Kronecker product of V and K, this is the covariance matrix for the stacked matrix.
+ var vki = v.KroneckerProduct(k.Inverse());
+
+ // Sample a vector valued random variable with VKi as the covariance.
+ var vector = SampleVectorNormal(rnd, new DenseVector(n * n, 0.0), vki);
+
+ // Unstack the vector v and add the mean.
+ var r = m.Clone();
+ for (var i = 0; i < n; i++)
+ {
+ for (var j = 0; j < p; j++)
+ {
+ r[i, j] += vector[(j * n) + i];
+ }
+ }
+
+ return r;
+ }
+
+ ///
+ /// Samples a vector normal distributed random variable.
+ ///
+ /// The random number generator to use.
+ /// The mean of the vector normal distribution.
+ /// The covariance matrix of the vector normal distribution.
+ /// a sequence of samples from defined distribution.
+ private static Vector SampleVectorNormal(Random rnd, Vector mean, Matrix covariance)
+ {
+ var chol = Cholesky.Create(covariance);
+ return SampleVectorNormal(rnd, mean, chol);
+ }
+
+ ///
+ /// Samples a vector normal distributed random variable.
+ ///
+ /// The random number generator to use.
+ /// The mean of the vector normal distribution.
+ /// The Cholesky factorization of the covariance matrix.
+ /// a sequence of samples from defined distribution.
+ private static Vector SampleVectorNormal(Random rnd, Vector mean, Cholesky cholesky)
+ {
+ var count = mean.Count;
+
+ // Sample a standard normal variable.
+ var v = new DenseVector(count, 0.0);
+ for (var d = 0; d < count; d += 2)
+ {
+ var sample = Normal.SampleBoxMuller(rnd);
+ v[d] = sample.Item1;
+ if (d + 1 < count)
+ {
+ v[d + 1] = sample.Item2;
+ }
+ }
+
+ // Return the transformed variable.
+ return mean + (cholesky.Factor * v);
+ }
+ }
+}
diff --git a/src/Numerics/Distributions/Multivariate/Multinomial.cs b/src/Numerics/Distributions/Multivariate/Multinomial.cs
index 00f95a54..73d3a934 100644
--- a/src/Numerics/Distributions/Multivariate/Multinomial.cs
+++ b/src/Numerics/Distributions/Multivariate/Multinomial.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -34,7 +30,6 @@ namespace MathNet.Numerics.Distributions
using System.Collections.Generic;
using Properties;
-
///
/// Implements the multinomial distribution. For details about this distribution, see
/// Wikipedia - Multinomial distribution .
@@ -46,7 +41,7 @@ namespace MathNet.Numerics.Distributions
/// Users can set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class Multinomial
{
///
@@ -75,7 +70,7 @@ namespace MathNet.Numerics.Distributions
public Multinomial(double[] p, int n)
{
SetParameters(p, n);
- RandomSource = new System.Random();
+ RandomSource = new Random();
}
/* TODO
@@ -100,6 +95,7 @@ namespace MathNet.Numerics.Distributions
///
/// A string representation of the distribution.
///
+ /// a string representation of the distribution.
public override string ToString()
{
return "Multinomial(Dimension = " + _p.Length + ", Number of Trails = " + _n + ")";
@@ -111,34 +107,27 @@ namespace MathNet.Numerics.Distributions
/// An array of nonnegative ratios: this array does not need to be normalized
/// as this is often impossible using floating point arithmetic.
/// The number of trials.
- /// If any of the probabilities are negative returns false,
- /// if the sum of parameters is 0.0, or if the number of trials is negative; otherwise true
- private static bool IsValidParameterSet(double[] p, int n)
+ /// If any of the probabilities are negative returns false ,
+ /// if the sum of parameters is 0.0, or if the number of trials is negative; otherwise true .
+ private static bool IsValidParameterSet(IEnumerable p, int n)
{
- double sum = 0.0;
- for (int i = 0; i < p.Length; i++)
+ var sum = 0.0;
+ foreach (var t in p)
{
- if (p[i] < 0.0 || Double.IsNaN(p[i]))
+ if (t < 0.0 || Double.IsNaN(t))
{
return false;
}
- else
- {
- sum += p[i];
- }
- }
- if (sum == 0.0)
- {
- return false;
+ sum += t;
}
- if (n < 0)
+ if (sum == 0.0)
{
return false;
}
- return true;
+ return n >= 0;
}
///
@@ -166,7 +155,7 @@ namespace MathNet.Numerics.Distributions
{
get
{
- return (double[]) _p.Clone();
+ return (double[])_p.Clone();
}
set
@@ -241,7 +230,7 @@ namespace MathNet.Numerics.Distributions
/// as this is often impossible using floating point arithmetic.
/// The number of trials.
/// the counts for each of the different possible values.
- public static int[] Sample(System.Random rnd, double[] p, int n)
+ public static int[] Sample(Random rnd, double[] p, int n)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n))
{
@@ -249,11 +238,12 @@ namespace MathNet.Numerics.Distributions
}
// The cumulative density of p.
- double[] cp = Categorical.UnnormalizedCDF(p);
- // The variable that stores the counts.
- int[] ret = new int[p.Length];
+ var cp = Categorical.UnnormalizedCdf(p);
+
+// The variable that stores the counts.
+ var ret = new int[p.Length];
- for (int i = 0; i < n; i++)
+ for (var i = 0; i < n; i++)
{
ret[Categorical.DoSample(rnd, cp)]++;
}
@@ -269,7 +259,7 @@ namespace MathNet.Numerics.Distributions
/// as this is often impossible using floating point arithmetic.
/// The number of variables needed.
/// a sequence of counts for each of the different possible values.
- public static IEnumerable Samples(System.Random rnd, double[] p, int n)
+ public static IEnumerable Samples(Random rnd, double[] p, int n)
{
if (Control.CheckDistributionParameters && !IsValidParameterSet(p, n))
{
@@ -277,14 +267,14 @@ namespace MathNet.Numerics.Distributions
}
// The cumulative density of p.
- double[] cp = Categorical.UnnormalizedCDF(p);
+ var cp = Categorical.UnnormalizedCdf(p);
while (true)
{
// The variable that stores the counts.
- int[] ret = new int[p.Length];
+ var ret = new int[p.Length];
- for (int i = 0; i < n; i++)
+ for (var i = 0; i < n; i++)
{
ret[Categorical.DoSample(rnd, cp)]++;
}
@@ -293,4 +283,4 @@ namespace MathNet.Numerics.Distributions
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Numerics/Distributions/Multivariate/NormalGamma.cs b/src/Numerics/Distributions/Multivariate/NormalGamma.cs
index 4c40ddc0..46a9585a 100644
--- a/src/Numerics/Distributions/Multivariate/NormalGamma.cs
+++ b/src/Numerics/Distributions/Multivariate/NormalGamma.cs
@@ -3,9 +3,7 @@
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
-//
// Copyright (c) 2009-2010 Math.NET
-//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
@@ -14,10 +12,8 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
-//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -40,36 +36,61 @@ namespace MathNet.Numerics.Distributions
///
public struct MeanPrecisionPair
{
- private double mMean;
- private double mPrecision;
+ ///
+ /// The mean value.
+ ///
+ private double _mean;
+
+ ///
+ /// The precision value.
+ ///
+ private double _precision;
///
- /// Constructs a new mean precision pair.
+ /// Initializes a new instance of the struct.
///
- /// The mean of the pair.
- /// The precision of the pair.
+ ///
+ /// The mean of the pair.
+ ///
+ ///
+ /// The precision of the pair.
+ ///
public MeanPrecisionPair(double m, double p)
{
- mMean = m;
- mPrecision = p;
+ _mean = m;
+ _precision = p;
}
///
- /// Gets/sets the mean of the pair.
+ /// Gets or sets the mean of the pair.
///
public double Mean
{
- get { return mMean; }
- set { mMean = value; }
+ get
+ {
+ return _mean;
+ }
+
+ set
+ {
+ _mean = value;
+ }
}
///
- /// Gets/sets the precision of the pair.
+ /// Gets or sets the precision of the pair.
///
public double Precision
{
- get { return mPrecision; }
- set { mPrecision = value; }
+ get
+ {
+ return _precision;
+ }
+
+ set
+ {
+ _precision = value;
+ }
}
}
@@ -84,11 +105,11 @@ namespace MathNet.Numerics.Distributions
/// infinity. When the mean is known, the mean location will encode the value of the mean while the scale
/// will be positive infinity. A completely degenerate NormalGamma distribution with known mean and precision is possible as well.
///
- /// The distribution will use the by default.
+ /// The distribution will use the by default.
/// Users can get/set the random number generator by using the property.
/// The statistics classes will check all the incoming parameters whether they are in the allowed
/// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
- /// to false, all parameter checks can be turned off.
+ /// to false , all parameter checks can be turned off.
public class NormalGamma
{
///
@@ -117,18 +138,26 @@ namespace MathNet.Numerics.Distributions
private Random _random;
///
- /// Constructs a NormalGamma distribution.
+ /// Initializes a new instance of the class.
///
- /// The location of the mean.
- /// The scale of the mean.
- /// The shape of the precision.
- /// The inverse scale of the precision.
- public NormalGamma(double meanLocation, double meanScale, double precShape, double precInvScale)
+ ///
+ /// The location of the mean.
+ ///
+ ///
+ /// The scale of the mean.
+ ///
+ ///
+ /// The shape of the precision.
+ ///
+ ///
+ /// The inverse scale of the precision.
+ ///
+ public NormalGamma(double meanLocation, double meanScale, double precisionShape, double precisionInverseScale)
{
- SetParameters(meanLocation, meanScale, precShape, precInvScale);
+ SetParameters(meanLocation, meanScale, precisionShape, precisionInverseScale);
_random = new Random();
}
-
+
///
/// Checks whether the parameters of the distribution are valid.
///
@@ -136,11 +165,11 @@ namespace MathNet.Numerics.Distributions
/// The scale of the mean.
/// The shape of the precision.
/// The inverse scale of the precision.
- /// True when the parameters are valid, false otherwise.
+ /// true when the parameters are valid, false otherwise.
private static bool IsValidParameterSet(double meanLocation, double meanScale, double precShape, double precInvScale)
{
- if (meanScale <= 0.0 || precShape <= 0.0 || precInvScale <= 0.0
- || Double.IsNaN(meanLocation) || Double.IsNaN(meanScale) || Double.IsNaN(precShape)
+ if (meanScale <= 0.0 || precShape <= 0.0 || precInvScale <= 0.0
+ || Double.IsNaN(meanLocation) || Double.IsNaN(meanScale) || Double.IsNaN(precShape)
|| Double.IsNaN(precInvScale))
{
return false;
@@ -173,46 +202,75 @@ namespace MathNet.Numerics.Distributions
///
/// A string representation of the distribution.
///
+ /// a string representation of the distribution.
public override string ToString()
{
return "NormalGamma(Mean Location = " + _meanLocation + ", Mean Scale = " + _meanScale +
- ", Precision Shape = " + _precisionShape + ", Precision Inverse Scale = " + _precisionInvScale + ")";
+ ", Precision Shape = " + _precisionShape + ", Precision Inverse Scale = " + _precisionInvScale + ")";
}
///
- /// Gets the location of the mean.
+ /// Gets or sets the location of the mean.
///
public double MeanLocation
{
- get { return _meanLocation; }
- set { SetParameters(value, _meanScale, _precisionShape, _precisionInvScale); }
+ get
+ {
+ return _meanLocation;
+ }
+
+ set
+ {
+ SetParameters(value, _meanScale, _precisionShape, _precisionInvScale);
+ }
}
///
- /// Gets the scale of the mean.
+ /// Gets or sets the scale of the mean.
///
public double MeanScale
{
- get { return _meanScale; }
- set { SetParameters(_meanLocation, value, _precisionShape, _precisionInvScale); }
+ get
+ {
+ return _meanScale;
+ }
+
+ set
+ {
+ SetParameters(_meanLocation, value, _precisionShape, _precisionInvScale);
+ }
}
///
- /// Gets the shape of the precision.
+ /// Gets or sets the shape of the precision.
///
public double PrecisionShape
{
- get { return _precisionShape; }
- set { SetParameters(_meanLocation, _meanScale, value, _precisionInvScale); }
+ get
+ {
+ return _precisionShape;
+ }
+
+ set
+ {
+ SetParameters(_meanLocation, _meanScale, value, _precisionInvScale);
+ }
}
///
- /// Gets the inverse scale of the precision.
+ /// Gets or sets the inverse scale of the precision.
///
public double PrecisionInverseScale
{
- get { return _precisionInvScale; }
- set { SetParameters(_meanLocation, _meanScale, _precisionShape, value); }
+ get
+ {
+ return _precisionInvScale;
+ }
+
+ set
+ {
+ SetParameters(_meanLocation, _meanScale, _precisionShape, value);
+ }
}
///
@@ -237,25 +295,23 @@ namespace MathNet.Numerics.Distributions
}
///
- /// Returns the marginal distribution for the mean of the distribution.
+ /// Returns the marginal distribution for the mean of the NormalGamma distribution.
///
- ///
+ /// the marginal distribution for the mean of the NormalGamma distribution.
public StudentT MeanMarginal()
{
if (Double.IsPositiveInfinity(_precisionInvScale))
{
return new StudentT(_meanLocation, 1.0 / (_meanScale * _precisionShape), Double.PositiveInfinity);
}
- else
- {
- return new StudentT(_meanLocation, Math.Sqrt(_precisionInvScale / (_meanScale * _precisionShape)), 2.0 * _precisionShape);
- }
+
+ return new StudentT(_meanLocation, Math.Sqrt(_precisionInvScale / (_meanScale * _precisionShape)), 2.0 * _precisionShape);
}
///
/// Returns the marginal distribution for the precision of the distribution.
///
- ///
+ /// The marginal distribution for the precision of the distribution/
public Gamma PrecisionMarginal()
{
return new Gamma(_precisionShape, _precisionInvScale);
@@ -269,14 +325,7 @@ namespace MathNet.Numerics.Distributions
{
get
{
- if (Double.IsPositiveInfinity(_precisionInvScale))
- {
- return new MeanPrecisionPair(_meanLocation, _precisionShape);
- }
- else
- {
- return new MeanPrecisionPair(_meanLocation, _precisionShape / _precisionInvScale);
- }
+ return Double.IsPositiveInfinity(_precisionInvScale) ? new MeanPrecisionPair(_meanLocation, _precisionShape) : new MeanPrecisionPair(_meanLocation, _precisionShape / _precisionInvScale);
}
}
@@ -349,63 +398,49 @@ namespace MathNet.Numerics.Distributions
}*/
///
- /// Generates a sample from the NormalGamma distribution.
+ /// Generates a sample from the NormalGamma distribution.
///
/// a sample from the distribution.
public MeanPrecisionPair Sample()
{
- return NormalGamma.Sample(RandomSource, _meanLocation, _meanScale, _precisionShape, _precisionInvScale);
+ return Sample(RandomSource, _meanLocation, _meanScale, _precisionShape, _precisionInvScale);
}
///
- /// Generates a sequence of samples from the NormalGamma distribution
+ /// Generates a sequence of samples from the NormalGamma distribution
///
/// a sequence of samples from the distribution.
public IEnumerable Samples()
{
while (true)
{
- yield return NormalGamma.Sample(RandomSource, _meanLocation, _meanScale, _precisionShape, _precisionInvScale);
+ yield return Sample(RandomSource, _meanLocation, _meanScale, _precisionShape, _precisionInvScale);
}
}
///
- /// Generates a sample from the NormalGamma distribution.
+ /// Generates a sample from the NormalGamma distribution.
///
/// The random number generator to use.
/// The location of the mean.
/// The scale of the mean.
- /// The shape of the precision.
- /// The inverse scale of the precision.
+ /// The shape of the precision.
+ /// The inverse scale of the precision.
/// a sample from the distribution.
- public static MeanPrecisionPair Sample(System.Random rnd, double meanLocation, double meanScale, double precShape, double precInvScale)
+ public static MeanPrecisionPair Sample(Random rnd, double meanLocation, double meanScale, double precisionShape, double precisionInverseScale)
{
- if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precShape, precInvScale))
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precisionShape, precisionInverseScale))
{
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
- MeanPrecisionPair mp = new MeanPrecisionPair();
+ var mp = new MeanPrecisionPair();
// Sample the precision.
- if(Double.IsPositiveInfinity(precInvScale))
- {
- mp.Precision = precShape;
- }
- else
- {
- mp.Precision = Gamma.Sample(rnd, precShape, precInvScale);
- }
+ mp.Precision = Double.IsPositiveInfinity(precisionInverseScale) ? precisionShape : Gamma.Sample(rnd, precisionShape, precisionInverseScale);
// Sample the mean.
- if (meanScale == 0.0)
- {
- mp.Mean = meanLocation;
- }
- else
- {
- mp.Mean = Normal.Sample(rnd, meanLocation, System.Math.Sqrt(1.0 / (meanScale * mp.Precision)));
- }
+ mp.Mean = meanScale == 0.0 ? meanLocation : Normal.Sample(rnd, meanLocation, Math.Sqrt(1.0 / (meanScale * mp.Precision)));
return mp;
}
@@ -416,42 +451,28 @@ namespace MathNet.Numerics.Distributions
/// The random number generator to use.
/// The location of the mean.
/// The scale of the mean.
- /// The shape of the precision.
- /// The inverse scale of the precision.
+ /// The shape of the precision.
+ /// The inverse scale of the precision.
/// a sequence of samples from the distribution.
- public static IEnumerable Samples(System.Random rnd, double meanLocation, double meanScale, double precShape, double precInvScale)
+ public static IEnumerable Samples(Random rnd, double meanLocation, double meanScale, double precisionShape, double precisionInvScale)
{
- if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precShape, precInvScale))
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(meanLocation, meanScale, precisionShape, precisionInvScale))
{
throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
}
while (true)
{
- MeanPrecisionPair mp = new MeanPrecisionPair();
+ var mp = new MeanPrecisionPair();
// Sample the precision.
- if (Double.IsPositiveInfinity(precInvScale))
- {
- mp.Precision = precShape;
- }
- else
- {
- mp.Precision = Gamma.Sample(rnd, precShape, precInvScale);
- }
+ mp.Precision = Double.IsPositiveInfinity(precisionInvScale) ? precisionShape : Gamma.Sample(rnd, precisionShape, precisionInvScale);
// Sample the mean.
- if (meanScale == 0.0)
- {
- mp.Mean = meanLocation;
- }
- else
- {
- mp.Mean = Normal.Sample(rnd, meanLocation, System.Math.Sqrt(1.0 / (meanScale * mp.Precision)));
- }
+ mp.Mean = meanScale == 0.0 ? meanLocation : Normal.Sample(rnd, meanLocation, Math.Sqrt(1.0 / (meanScale * mp.Precision)));
yield return mp;
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Numerics/Distributions/Multivariate/Wishart.cs b/src/Numerics/Distributions/Multivariate/Wishart.cs
new file mode 100644
index 00000000..71aa39b3
--- /dev/null
+++ b/src/Numerics/Distributions/Multivariate/Wishart.cs
@@ -0,0 +1,313 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+// Copyright (c) 2009-2010 Math.NET
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.Distributions
+{
+ using System;
+ using LinearAlgebra.Double;
+ using LinearAlgebra.Generic;
+ using LinearAlgebra.Generic.Factorization;
+ using Properties;
+
+ ///
+ /// This class implements functionality for the Wishart distribution. This distribution is
+ /// parameterized by the degrees of freedom nu and the scale matrix S. The Wishart distribution
+ /// is the conjugate prior for the precision (inverse covariance) matrix of the multivariate
+ /// normal distribution.
+ /// Wikipedia - Wishart distribution .
+ ///
+ /// The distribution will use the by default.
+ /// Users can set the random number generator by using the property.
+ /// The statistics classes will check all the incoming parameters whether they are in the allowed
+ /// range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters
+ /// to false , all parameter checks can be turned off.
+ public class Wishart
+ {
+ ///
+ /// The degrees of freedom for the Wishart distribution.
+ ///
+ private double _nu;
+
+ ///
+ /// The scale matrix for the Wishart distribution.
+ ///
+ private Matrix _s;
+
+ ///
+ /// Caches the Cholesky factorization of the scale matrix.
+ ///
+ private Cholesky _chol;
+
+ ///
+ /// The distribution's random number generator.
+ ///
+ private Random _random;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The degrees of freedom for the Wishart distribution.
+ ///
+ ///
+ /// The scale matrix for the Wishart distribution.
+ ///
+ public Wishart(double nu, Matrix s)
+ {
+ SetParameters(nu, s);
+ RandomSource = new Random();
+ }
+
+ ///
+ /// Sets the parameters of the distribution after checking their validity.
+ ///
+ /// The degrees of freedom for the Wishart distribution.
+ /// The scale matrix for the Wishart distribution.
+ /// When the parameters don't pass the function.
+ private void SetParameters(double nu, Matrix s)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(nu, s))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ _nu = nu;
+ _s = s;
+ _chol = Cholesky.Create(_s);
+ }
+
+ ///
+ /// Checks whether the parameters of the distribution are valid.
+ ///
+ /// The degrees of freedom for the Wishart distribution.
+ /// The scale matrix for the Wishart distribution.
+ /// true when the parameters are valid, false otherwise.
+ private static bool IsValidParameterSet(double nu, Matrix s)
+ {
+ if (s.RowCount != s.ColumnCount)
+ {
+ return false;
+ }
+
+ for (var i = 0; i < s.RowCount; i++)
+ {
+ if (s[i, i] <= 0.0)
+ {
+ return false;
+ }
+ }
+
+ if (nu <= 0.0 || Double.IsNaN(nu))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
+ /// Gets or sets the degrees of freedom for the Wishart distribution.
+ ///
+ public double Nu
+ {
+ get
+ {
+ return _nu;
+ }
+
+ set
+ {
+ SetParameters(value, _s);
+ }
+ }
+
+ ///
+ /// Gets or sets the scale matrix for the Wishart distribution.
+ ///
+ public Matrix S
+ {
+ get
+ {
+ return _s;
+ }
+
+ set
+ {
+ SetParameters(_nu, value);
+ }
+ }
+
+ ///
+ /// A string representation of the distribution.
+ ///
+ /// a string representation of the distribution.
+ public override string ToString()
+ {
+ return "Wishart(Nu = " + _nu + ", Rows = " + _s.RowCount + ", Columns = " + _s.ColumnCount + ")";
+ }
+
+ ///
+ /// Gets or sets the random number generator which is used to draw random samples.
+ ///
+ public Random RandomSource
+ {
+ get
+ {
+ return _random;
+ }
+
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException();
+ }
+
+ _random = value;
+ }
+ }
+
+ ///
+ /// Gets the mean of the distribution.
+ ///
+ /// The mean of the distribution.
+ public Matrix Mean
+ {
+ get
+ {
+ return _nu * _s;
+ }
+ }
+
+ ///
+ /// Gets the mode of the distribution.
+ ///
+ /// The mode of the distribution.
+ public Matrix Mode
+ {
+ get
+ {
+ return (_nu - _s.RowCount - 1.0) * _s;
+ }
+ }
+
+ ///
+ /// Evaluates the probability density function for the Wishart distribution.
+ ///
+ /// The matrix at which to evaluate the density at.
+ /// If the argument does not have the same dimensions as the scale matrix.
+ /// the density at .
+ public double Density(Matrix x)
+ {
+ var p = _s.RowCount;
+
+ if (x.RowCount != p || x.ColumnCount != p)
+ {
+ throw new ArgumentOutOfRangeException("x", Resources.ArgumentMatrixDimensions);
+ }
+
+ var dX = x.Determinant();
+ var siX = _chol.Solve(x);
+
+ // Compute the multivariate Gamma function.
+ var gp = Math.Pow(Constants.Pi, p * (p - 1.0) / 4.0);
+ for (var j = 1; j <= p; j++)
+ {
+ gp *= SpecialFunctions.Gamma((_nu + 1.0 - j) / 2.0);
+ }
+
+ return Math.Pow(dX, (_nu - p - 1.0) / 2.0)
+ * Math.Exp(-0.5 * siX.Trace())
+ / Math.Pow(2.0, _nu * p / 2.0)
+ / Math.Pow(_chol.Determinant, _nu / 2.0)
+ / gp;
+ }
+
+ ///
+ /// Samples a Wishart distributed random variable using the method
+ /// Algorithm AS 53: Wishart Variate Generator
+ /// W. B. Smith and R. R. Hocking
+ /// Applied Statistics, Vol. 21, No. 3 (1972), pp. 341-345
+ ///
+ /// A random number from this distribution.
+ public Matrix Sample()
+ {
+ return DoSample(RandomSource, _nu, _s, _chol);
+ }
+
+ ///
+ /// Samples a Wishart distributed random variable using the method
+ /// Algorithm AS 53: Wishart Variate Generator
+ /// W. B. Smith and R. R. Hocking
+ /// Applied Statistics, Vol. 21, No. 3 (1972), pp. 341-345
+ ///
+ /// The random number generator to use.
+ /// The degrees of freedom.
+ /// The scale matrix.
+ /// a sequence of samples from the distribution.
+ public static Matrix Sample(Random rnd, double nu, Matrix s)
+ {
+ if (Control.CheckDistributionParameters && !IsValidParameterSet(nu, s))
+ {
+ throw new ArgumentOutOfRangeException(Resources.InvalidDistributionParameters);
+ }
+
+ return DoSample(rnd, nu, s, Cholesky.Create(s));
+ }
+
+ ///
+ /// Samples the distribution.
+ ///
+ /// The random number generator to use.
+ /// The nu parameter to use.
+ /// The S parameter to use.
+ /// The cholesky decomposition to use.
+ /// a random number from the distribution.
+ private static Matrix DoSample(Random rnd, double nu, Matrix s, Cholesky chol)
+ {
+ var count = s.RowCount;
+
+ // First generate a lower triangular matrix with Sqrt(Chi-Squares) on the diagonal
+ // and normal distributed variables in the lower triangle.
+ var a = new DenseMatrix(count, count, 0.0);
+ for (var d = 0; d < count; d++)
+ {
+ a[d, d] = Math.Sqrt(Gamma.Sample(rnd, (nu - d) / 2.0, 0.5));
+ }
+
+ for (var i = 1; i < count; i++)
+ {
+ for (var j = 0; j < i; j++)
+ {
+ a[i, j] = Normal.Sample(rnd, 0.0, 1.0);
+ }
+ }
+
+ var factor = chol.Factor;
+ return factor * a * a.Transpose() * factor.Transpose();
+ }
+ }
+}
diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj
index 5cba634b..cb70bbc9 100644
--- a/src/Numerics/Numerics.csproj
+++ b/src/Numerics/Numerics.csproj
@@ -104,6 +104,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Numerics/SpecialFunctions.cs b/src/Numerics/SpecialFunctions.cs
index b64089fe..0029f0c3 100644
--- a/src/Numerics/SpecialFunctions.cs
+++ b/src/Numerics/SpecialFunctions.cs
@@ -58,6 +58,22 @@ namespace MathNet.Numerics
return Constants.EulerMascheroni + DiGamma(t + 1.0);
}
+ ///
+ /// Compute the generalized harmonic number of order n of m. (1 + 1/2^m + 1/3^m + ... + 1/n^m)
+ ///
+ /// The order parameter.
+ /// The power parameter.
+ /// General Harmonic number.
+ public static double GeneralHarmonic(int n, double m)
+ {
+ double sum = 0;
+ for (int i = 0; i < n; i++)
+ {
+ sum += Math.Pow(i + 1, -m);
+ }
+ return sum;
+ }
+
///
/// Computes the logarithm of the Euler Beta function.
///
diff --git a/src/Silverlight/Silverlight.csproj b/src/Silverlight/Silverlight.csproj
index cb19f88e..e0190c7e 100644
--- a/src/Silverlight/Silverlight.csproj
+++ b/src/Silverlight/Silverlight.csproj
@@ -83,18 +83,51 @@
Distributions\Continuous\Beta.cs
+
+ Distributions\Continuous\Cauchy.cs
+
+
+ Distributions\Continuous\Chi.cs
+
+
+ Distributions\Continuous\ChiSquare.cs
+
Distributions\Continuous\ContinuousUniform.cs
+
+ Distributions\Continuous\Erlang.cs
+
+
+ Distributions\Continuous\Exponential.cs
+
+
+ Distributions\Continuous\FisherSnedecor.cs
+
Distributions\Continuous\Gamma.cs
+
+ Distributions\Continuous\InverseGamma.cs
+
+
+ Distributions\Continuous\Laplace.cs
+
Distributions\Continuous\LogNormal.cs
Distributions\Continuous\Normal.cs
+
+ Distributions\Continuous\Pareto.cs
+
+
+ Distributions\Continuous\Rayleigh.cs
+
+
+ Distributions\Continuous\Stable.cs
+
Distributions\Continuous\StudentT.cs
@@ -110,9 +143,24 @@
Distributions\Discrete\Categorical.cs
+
+ Distributions\Discrete\ConwayMaxwellPoisson.cs
+
Distributions\Discrete\DiscreteUniform.cs
+
+ Distributions\Discrete\Geometric.cs
+
+
+ Distributions\Discrete\Hypergeometric.cs
+
+
+ Distributions\Discrete\NegativeBinomial.cs
+
+
+ Distributions\Continuous\Zipf.cs
+
Distributions\IContinuousDistribution.cs
@@ -125,12 +173,21 @@
Distributions\Multivariate\Dirichlet.cs
+
+ Distributions\Multivariate\InverseWishart.cs
+
+
+ Distributions\Multivariate\MatrixNormal.cs
+
Distributions\Multivariate\Multinomial.cs
Distributions\Multivariate\NormalGamma.cs
+
+ Distributions\Multivariate\Wishart.cs
+
GlobalizationHelper.cs
diff --git a/src/UnitTests/ComplexTests/Complex32Test.cs b/src/UnitTests/ComplexTests/Complex32Test.cs
index 4d149cc9..30582dda 100644
--- a/src/UnitTests/ComplexTests/Complex32Test.cs
+++ b/src/UnitTests/ComplexTests/Complex32Test.cs
@@ -34,6 +34,7 @@ namespace MathNet.Numerics.UnitTests.ComplexTests
using System.Numerics;
using MbUnit.Framework;
+
[TestFixture]
public class Complex32Test
{
diff --git a/src/UnitTests/DistributionTests/Continuous/BetaTests.cs b/src/UnitTests/DistributionTests/Continuous/BetaTests.cs
index a73885f9..50b9f800 100644
--- a/src/UnitTests/DistributionTests/Continuous/BetaTests.cs
+++ b/src/UnitTests/DistributionTests/Continuous/BetaTests.cs
@@ -58,8 +58,8 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void CanCreateBeta(double a, double b)
{
var n = new Beta(a, b);
- AssertEx.AreEqual(a, n.A);
- AssertEx.AreEqual(b, n.B);
+ Assert.AreEqual(a, n.A);
+ Assert.AreEqual(b, n.B);
}
[Test]
@@ -79,7 +79,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateToString()
{
var n = new Beta(1.0, 2.0);
- AssertEx.AreEqual("Beta(A = 1, B = 2)", n.ToString());
+ Assert.AreEqual("Beta(A = 1, B = 2)", n.ToString());
}
[Test]
@@ -138,7 +138,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateMean(double a, double b, double mean)
{
var n = new Beta(a, b);
- AssertEx.AreEqual(mean, n.Mean);
+ Assert.AreEqual(mean, n.Mean);
}
[Test]
@@ -189,7 +189,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateMode(double a, double b, double mode)
{
var n = new Beta(a, b);
- AssertEx.AreEqual(mode, n.Mode);
+ Assert.AreEqual(mode, n.Mode);
}
[Test]
@@ -214,14 +214,14 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateMinimum()
{
var n = new Beta(1.0, 1.0);
- AssertEx.AreEqual(0.0, n.Minimum);
+ Assert.AreEqual(0.0, n.Minimum);
}
[Test]
public void ValidateMaximum()
{
var n = new Beta(1.0, 1.0);
- AssertEx.AreEqual(1.0, n.Maximum);
+ Assert.AreEqual(1.0, n.Maximum);
}
[Test]
diff --git a/src/UnitTests/DistributionTests/Continuous/CauchyTests.cs b/src/UnitTests/DistributionTests/Continuous/CauchyTests.cs
new file mode 100644
index 00000000..5a03ca7b
--- /dev/null
+++ b/src/UnitTests/DistributionTests/Continuous/CauchyTests.cs
@@ -0,0 +1,268 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
+{
+ using System;
+ using System.Linq;
+ using MbUnit.Framework;
+ using Distributions;
+
+ [TestFixture]
+ public class CauchyTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ Control.CheckDistributionParameters = true;
+ }
+
+ [Test, MultipleAsserts]
+ public void CanCreateCauchy()
+ {
+ var n = new Cauchy();
+ Assert.AreEqual(0.0, n.Location);
+ Assert.AreEqual(1.0, n.Scale);
+ }
+
+ [Test, MultipleAsserts]
+ [Row(0.0, 0.1)]
+ [Row(0.0, 1.0)]
+ [Row(0.0, 10.0)]
+ [Row(10.0, 11.0)]
+ [Row(-5.0, 100.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ public void CanCreateCauchy(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ Assert.AreEqual(location, n.Location);
+ Assert.AreEqual(scale, n.Scale);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(Double.NaN, 1.0)]
+ [Row(1.0, Double.NaN)]
+ [Row(Double.NaN, Double.NaN)]
+ [Row(1.0, 0.0)]
+ public void CauchyCreateFailsWithBadParameters(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ }
+
+ [Test]
+ public void ValidateToString()
+ {
+ var n = new Cauchy(1.0, 2.0);
+ Assert.AreEqual("Cauchy(Location = 1, Scale = 2)", n.ToString());
+ }
+
+ [Test]
+ [Row(-10.0)]
+ [Row(-0.0)]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ public void CanSetLocation(double location)
+ {
+ var n = new Cauchy();
+ n.Location = location;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetLocationFail()
+ {
+ var n = new Cauchy();
+ n.Location = Double.NaN;
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(2.0)]
+ [Row(12.0)]
+ public void CanSetScale(double scale)
+ {
+ var n = new Cauchy();
+ n.Scale = scale;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetScaleFail()
+ {
+ var n = new Cauchy();
+ n.Scale = -1.0;
+ }
+
+ [Test]
+ [Row(-0.0, 2.0)]
+ [Row(0.0, 2.0)]
+ [Row(0.1, 4.0)]
+ [Row(1.0, 10.0)]
+ [Row(10.0, 11.0)]
+ public void ValidateEntropy(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ Assert.AreEqual(Math.Log(4.0 * Constants.Pi * scale), n.Entropy);
+ }
+
+ [Test]
+ [ExpectedException(typeof(NotSupportedException))]
+ [Row(-0.0, 2.0)]
+ [Row(0.0, 2.0)]
+ [Row(0.1, 4.0)]
+ [Row(1.0, 10.0)]
+ [Row(10.0, 11.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ public void ValidateSkewness(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ Assert.AreEqual(0.0, n.Skewness);
+ }
+
+ [Test]
+ [Row(-0.0, 2.0)]
+ [Row(0.0, 2.0)]
+ [Row(0.1, 4.0)]
+ [Row(1.0, 10.0)]
+ [Row(10.0, 11.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ public void ValidateMode(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ Assert.AreEqual(location, n.Mode);
+ }
+
+ [Test]
+ [Row(-0.0, 2.0)]
+ [Row(0.0, 2.0)]
+ [Row(0.1, 4.0)]
+ [Row(1.0, 10.0)]
+ [Row(10.0, 11.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ public void ValidateMedian(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ Assert.AreEqual(location, n.Median);
+ }
+
+ [Test]
+ [Row(-0.0, 2.0)]
+ [Row(0.0, 2.0)]
+ [Row(0.1, 4.0)]
+ [Row(1.0, 10.0)]
+ [Row(10.0, 11.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ public void ValidateMinimum(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ Assert.AreEqual(Double.NegativeInfinity, n.Minimum);
+ }
+
+ [Test]
+ [Row(-0.0, 2.0)]
+ [Row(0.0, 2.0)]
+ [Row(0.1, 4.0)]
+ [Row(1.0, 10.0)]
+ [Row(10.0, 11.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ public void ValidateMaximum(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ Assert.AreEqual(Double.PositiveInfinity, n.Maximum);
+ }
+
+ [Test]
+ [Row(0.0, 0.1)]
+ [Row(0.0, 1.0)]
+ [Row(0.0, 10.0)]
+ [Row(-5.0, 100.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ public void ValidateDensity(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ for (int i = 0; i < 11; i++)
+ {
+ double x = i - 5.0;
+ Assert.AreEqual(1.0 / (Constants.Pi * scale * (1.0 + ((x - location) / scale) * ((x - location) / scale))), n.Density(x));
+ }
+ }
+
+ [Test]
+ [Row(0.0, 0.1)]
+ [Row(0.0, 1.0)]
+ [Row(0.0, 10.0)]
+ [Row(-5.0, 100.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ public void ValidateDensityLn(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ for (int i = 0; i < 11; i++)
+ {
+ double x = i - 5.0;
+ Assert.AreEqual(-Math.Log(Constants.Pi * scale * (1.0 + ((x - location) / scale) * ((x - location) / scale))), n.DensityLn(x));
+ }
+ }
+
+ [Test]
+ public void CanSample()
+ {
+ var n = new Cauchy();
+ var d = n.Sample();
+ }
+
+ [Test]
+ public void CanSampleSequence()
+ {
+ var n = new Cauchy();
+ var ied = n.Samples();
+ var e = ied.Take(5).ToArray();
+ }
+
+ [Test]
+ [Row(0.0, 0.1)]
+ [Row(0.0, 1.0)]
+ [Row(0.0, 10.0)]
+ [Row(-5.0, 100.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ public void ValidateCumulativeDistribution(double location, double scale)
+ {
+ var n = new Cauchy(location, scale);
+ for (int i = 0; i < 11; i++)
+ {
+ double x = i - 5.0;
+ Assert.AreEqual((1.0 / Constants.Pi) * Math.Atan((x - location) / scale) + 0.5, n.CumulativeDistribution(x));
+ }
+ }
+ }
+}
diff --git a/src/UnitTests/DistributionTests/Continuous/ChiSquareTests.cs b/src/UnitTests/DistributionTests/Continuous/ChiSquareTests.cs
new file mode 100644
index 00000000..82220efc
--- /dev/null
+++ b/src/UnitTests/DistributionTests/Continuous/ChiSquareTests.cs
@@ -0,0 +1,295 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
+{
+ using System;
+ using System.Linq;
+ using MbUnit.Framework;
+ using Distributions;
+
+ [TestFixture]
+ public class ChiSquareTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ Control.CheckDistributionParameters = true;
+ }
+
+ [Test, MultipleAsserts]
+ [Row(1.0)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanCreateChiSquare(double dof)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(dof, n.DegreesOfFreedom);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(0.0)]
+ [Row(-1.0)]
+ [Row(-100.0)]
+ [Row(Double.NegativeInfinity)]
+ [Row(Double.NaN)]
+ public void ChiSquareCreateFailsWithBadParameters(double dof)
+ {
+ var n = new ChiSquare(dof);
+ }
+
+ [Test]
+ public void ValidateToString()
+ {
+ var n = new ChiSquare(1.0);
+ Assert.AreEqual("ChiSquare(DoF = 1)", n.ToString());
+ }
+
+ [Test]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanSetDoF(double dof)
+ {
+ var n = new ChiSquare(1.0);
+ n.DegreesOfFreedom = dof;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(-1.0)]
+ [Row(-0.0)]
+ [Row(0.0)]
+ public void SetDofFailsWithNonPositiveDoF(double dof)
+ {
+ {
+ var n = new ChiSquare(1.0);
+ n.DegreesOfFreedom = dof;
+ }
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(2.0)]
+ [Row(2.5)]
+ [Row(5.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMean(double dof)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(dof, n.Mean);
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(2.0)]
+ [Row(2.5)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateVariance(double dof)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(2 * dof, n.Variance);
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(2.0)]
+ [Row(2.5)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateStdDev(double dof)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(Math.Sqrt(n.Variance), n.StdDev);
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(1.5)]
+ [Row(2.5)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMode(double dof)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(dof - 2, n.Mode);
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(1.5)]
+ [Row(2.5)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMedian(double dof)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(dof - 2.0 / 3.0, n.Median);
+ }
+
+ [Test]
+ public void ValidateMinimum()
+ {
+ var n = new ChiSquare(1.0);
+ Assert.AreEqual(0.0, n.Minimum);
+ }
+
+ [Test]
+ public void ValidateMaximum()
+ {
+ var n = new ChiSquare(1.0);
+ Assert.AreEqual(Double.PositiveInfinity, n.Maximum);
+ }
+
+ [Test]
+ [Row(1.0, 0.0)]
+ [Row(1.0, 0.1)]
+ [Row(1.0, 1.0)]
+ [Row(1.0, 5.5)]
+ [Row(1.0, 110.1)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(2.0, 0.0)]
+ [Row(2.0, 0.1)]
+ [Row(2.0, 1.0)]
+ [Row(2.0, 5.5)]
+ [Row(2.0, 110.1)]
+ [Row(2.0, Double.PositiveInfinity)]
+ [Row(2.5, 0.0)]
+ [Row(2.5, 0.1)]
+ [Row(2.5, 1.0)]
+ [Row(2.5, 5.5)]
+ [Row(2.5, 110.1)]
+ [Row(2.5, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(Double.PositiveInfinity, 5.5)]
+ [Row(Double.PositiveInfinity, 110.1)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateDensity(double dof, double x)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual((Math.Pow(x, dof / 2.0 - 1.0) * Math.Exp(-x / 2.0)) / (Math.Pow(2.0, dof / 2.0) * SpecialFunctions.Gamma(dof / 2.0)), n.Density(x));
+ }
+
+ [Test]
+ [Row(1.0, 0.0)]
+ [Row(1.0, 0.1)]
+ [Row(1.0, 1.0)]
+ [Row(1.0, 5.5)]
+ [Row(1.0, 110.1)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(2.0, 0.0)]
+ [Row(2.0, 0.1)]
+ [Row(2.0, 1.0)]
+ [Row(2.0, 5.5)]
+ [Row(2.0, 110.1)]
+ [Row(2.0, Double.PositiveInfinity)]
+ [Row(2.5, 0.0)]
+ [Row(2.5, 0.1)]
+ [Row(2.5, 1.0)]
+ [Row(2.5, 5.5)]
+ [Row(2.5, 110.1)]
+ [Row(2.5, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(Double.PositiveInfinity, 5.5)]
+ [Row(Double.PositiveInfinity, 110.1)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateDensityLn(double dof, double x)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(-x / 2.0 + (dof / 2.0 - 1.0) * Math.Log(x) - (dof / 2.0) * Math.Log(2) - SpecialFunctions.GammaLn(dof / 2.0), n.DensityLn(x));
+ }
+
+ [Test]
+ public void CanSampleStatic()
+ {
+ var d = ChiSquare.Sample(new Random(), 2.0);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void FailSampleStatic()
+ {
+ var d = ChiSquare.Sample(new Random(), -1.0);
+ }
+
+ [Test]
+ public void CanSample()
+ {
+ var n = new ChiSquare(1.0);
+ var d = n.Sample();
+ }
+
+ [Test]
+ public void CanSampleSequence()
+ {
+ var n = new ChiSquare(1.0);
+ var ied = n.Samples();
+ var e = ied.Take(5).ToArray();
+ }
+
+ [Test]
+ [Row(1.0, 0.0)]
+ [Row(1.0, 0.1)]
+ [Row(1.0, 1.0)]
+ [Row(1.0, 5.5)]
+ [Row(1.0, 110.1)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(2.0, 0.0)]
+ [Row(2.0, 0.1)]
+ [Row(2.0, 1.0)]
+ [Row(2.0, 5.5)]
+ [Row(2.0, 110.1)]
+ [Row(2.0, Double.PositiveInfinity)]
+ [Row(2.5, 0.0)]
+ [Row(2.5, 0.1)]
+ [Row(2.5, 1.0)]
+ [Row(2.5, 5.5)]
+ [Row(2.5, 110.1)]
+ [Row(2.5, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(Double.PositiveInfinity, 5.5)]
+ [Row(Double.PositiveInfinity, 110.1)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateCumulativeDistribution(double dof, double x)
+ {
+ var n = new ChiSquare(dof);
+ Assert.AreEqual(SpecialFunctions.GammaUpperIncomplete(dof / 2.0, x / 2.0) / SpecialFunctions.Gamma(dof / 2.0), n.CumulativeDistribution(x));
+ }
+ }
+}
diff --git a/src/UnitTests/DistributionTests/Continuous/ChiTests.cs b/src/UnitTests/DistributionTests/Continuous/ChiTests.cs
new file mode 100644
index 00000000..76fc2c3d
--- /dev/null
+++ b/src/UnitTests/DistributionTests/Continuous/ChiTests.cs
@@ -0,0 +1,281 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
+{
+ using System;
+ using System.Linq;
+ using MbUnit.Framework;
+ using Distributions;
+
+ [TestFixture]
+ public class ChiTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ Control.CheckDistributionParameters = true;
+ }
+
+ [Test, MultipleAsserts]
+ [Row(1.0)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanCreateChi(double dof)
+ {
+ var n = new Chi(dof);
+ Assert.AreEqual(dof, n.DegreesOfFreedom);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(0.0)]
+ [Row(-1.0)]
+ [Row(-100.0)]
+ [Row(Double.NegativeInfinity)]
+ [Row(Double.NaN)]
+ public void ChiCreateFailsWithBadParameters(double dof)
+ {
+ var n = new Chi(dof);
+ }
+
+ [Test]
+ public void ValidateToString()
+ {
+ var n = new Chi(1.0);
+ Assert.AreEqual("Chi(DoF = 1)", n.ToString());
+ }
+
+ [Test]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanSetDoF(double dof)
+ {
+ var n = new Chi(1.0);
+ n.DegreesOfFreedom = dof;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(-1.0)]
+ [Row(-0.0)]
+ [Row(0.0)]
+ public void SetDofFailsWithNonPositiveDoF(double dof)
+ {
+ {
+ var n = new Chi(1.0);
+ n.DegreesOfFreedom = dof;
+ }
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(2.0)]
+ [Row(2.5)]
+ [Row(5.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMean(double dof)
+ {
+ var n = new Chi(dof);
+ Assert.AreEqual(Math.Sqrt(2) * (SpecialFunctions.Gamma((dof + 1.0) / 2.0) / SpecialFunctions.Gamma(dof / 2.0)), n.Mean);
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(2.0)]
+ [Row(2.5)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateVariance(double dof)
+ {
+ var n = new Chi(dof);
+ Assert.AreEqual(dof - n.Mean * n.Mean, n.Variance);
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(2.0)]
+ [Row(2.5)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateStdDev(double dof)
+ {
+ var n = new Chi(dof);
+ Assert.AreEqual(Math.Sqrt(n.Variance), n.StdDev);
+ }
+
+ [Test]
+ [Row(1.0)]
+ [Row(1.5)]
+ [Row(2.5)]
+ [Row(3.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMode(double dof)
+ {
+ var n = new Chi(dof);
+ if (dof >= 1)
+ {
+ Assert.AreEqual(Math.Sqrt(dof - 1), n.Mode);
+ }
+ }
+
+ [Test]
+ [ExpectedException(typeof(NotSupportedException))]
+ public void ValidateMedian()
+ {
+ var n = new Chi(1.0);
+ var median = n.Median;
+ }
+
+ [Test]
+ public void ValidateMinimum()
+ {
+ var n = new Chi(1.0);
+ Assert.AreEqual(0.0, n.Minimum);
+ }
+
+ [Test]
+ public void ValidateMaximum()
+ {
+ var n = new Chi(1.0);
+ Assert.AreEqual(Double.PositiveInfinity, n.Maximum);
+ }
+
+ [Test]
+ [Row(1.0, 0.0)]
+ [Row(1.0, 0.1)]
+ [Row(1.0, 1.0)]
+ [Row(1.0, 5.5)]
+ [Row(1.0, 110.1)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(2.0, 0.0)]
+ [Row(2.0, 0.1)]
+ [Row(2.0, 1.0)]
+ [Row(2.0, 5.5)]
+ [Row(2.0, 110.1)]
+ [Row(2.0, Double.PositiveInfinity)]
+ [Row(2.5, 0.0)]
+ [Row(2.5, 0.1)]
+ [Row(2.5, 1.0)]
+ [Row(2.5, 5.5)]
+ [Row(2.5, 110.1)]
+ [Row(2.5, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(Double.PositiveInfinity, 5.5)]
+ [Row(Double.PositiveInfinity, 110.1)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateDensity(double dof, double x)
+ {
+ var n = new Chi(dof);
+ Assert.AreEqual((Math.Pow(2.0, 1.0 - dof / 2.0) * Math.Pow(x, dof - 1.0) * Math.Exp(-x * x / 2.0)) / SpecialFunctions.Gamma(dof / 2.0), n.Density(x));
+ }
+
+ [Test]
+ [Row(1.0, 0.0)]
+ [Row(1.0, 0.1)]
+ [Row(1.0, 1.0)]
+ [Row(1.0, 5.5)]
+ [Row(1.0, 110.1)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(2.0, 0.0)]
+ [Row(2.0, 0.1)]
+ [Row(2.0, 1.0)]
+ [Row(2.0, 5.5)]
+ [Row(2.0, 110.1)]
+ [Row(2.0, Double.PositiveInfinity)]
+ [Row(2.5, 0.0)]
+ [Row(2.5, 0.1)]
+ [Row(2.5, 1.0)]
+ [Row(2.5, 5.5)]
+ [Row(2.5, 110.1)]
+ [Row(2.5, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(Double.PositiveInfinity, 5.5)]
+ [Row(Double.PositiveInfinity, 110.1)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateDensityLn(double dof, double x)
+ {
+ var n = new Chi(dof);
+ Assert.AreEqual((1.0 - dof / 2.0) * Math.Log(2.0) + (dof - 1.0) * Math.Log(x) - x * x / 2.0 - SpecialFunctions.GammaLn(dof / 2.0), n.DensityLn(x));
+ }
+
+ [Test]
+ public void CanSample()
+ {
+ var n = new Chi(1.0);
+ var d = n.Sample();
+ }
+
+ [Test]
+ public void CanSampleSequence()
+ {
+ var n = new Chi(1.0);
+ var ied = n.Samples();
+ var e = ied.Take(5).ToArray();
+ }
+
+ [Test]
+ [Row(1.0, 0.0)]
+ [Row(1.0, 0.1)]
+ [Row(1.0, 1.0)]
+ [Row(1.0, 5.5)]
+ [Row(1.0, 110.1)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(2.0, 0.0)]
+ [Row(2.0, 0.1)]
+ [Row(2.0, 1.0)]
+ [Row(2.0, 5.5)]
+ [Row(2.0, 110.1)]
+ [Row(2.0, Double.PositiveInfinity)]
+ [Row(2.5, 0.0)]
+ [Row(2.5, 0.1)]
+ [Row(2.5, 1.0)]
+ [Row(2.5, 5.5)]
+ [Row(2.5, 110.1)]
+ [Row(2.5, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(Double.PositiveInfinity, 5.5)]
+ [Row(Double.PositiveInfinity, 110.1)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateCumulativeDistribution(double dof, double x)
+ {
+ var n = new Chi(dof);
+ Assert.AreEqual(SpecialFunctions.GammaLowerIncomplete(dof / 2.0, x * x / 2.0) / SpecialFunctions.Gamma(dof / 2.0), n.CumulativeDistribution(x));
+ }
+ }
+}
diff --git a/src/UnitTests/DistributionTests/Continuous/ContinuousUniformTests.cs b/src/UnitTests/DistributionTests/Continuous/ContinuousUniformTests.cs
index df083c3f..28cb1cfb 100644
--- a/src/UnitTests/DistributionTests/Continuous/ContinuousUniformTests.cs
+++ b/src/UnitTests/DistributionTests/Continuous/ContinuousUniformTests.cs
@@ -48,8 +48,8 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void CanCreateContinuousUniform()
{
var n = new ContinuousUniform();
- AssertEx.AreEqual(0.0, n.Lower);
- AssertEx.AreEqual(1.0, n.Upper);
+ Assert.AreEqual(0.0, n.Lower);
+ Assert.AreEqual(1.0, n.Upper);
}
[Test, MultipleAsserts]
@@ -63,8 +63,8 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void CanCreateContinuousUniform(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
- AssertEx.AreEqual(lower, n.Lower);
- AssertEx.AreEqual(upper, n.Upper);
+ Assert.AreEqual(lower, n.Lower);
+ Assert.AreEqual(upper, n.Upper);
}
[Test]
@@ -82,7 +82,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateToString()
{
var n = new ContinuousUniform(1.0, 2.0);
- AssertEx.AreEqual("ContinuousUniform(Lower = 1, Upper = 2)", n.ToString());
+ Assert.AreEqual("ContinuousUniform(Lower = 1, Upper = 2)", n.ToString());
}
[Test]
@@ -133,7 +133,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateEntropy(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
- AssertEx.AreEqual(Math.Log(upper - lower), n.Entropy);
+ Assert.AreEqual(Math.Log(upper - lower), n.Entropy);
}
[Test]
@@ -146,7 +146,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateSkewness(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
- AssertEx.AreEqual(0.0, n.Skewness);
+ Assert.AreEqual(0.0, n.Skewness);
}
[Test]
@@ -159,7 +159,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateMode(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
- AssertEx.AreEqual( (lower + upper) / 2.0 , n.Mode);
+ Assert.AreEqual( (lower + upper) / 2.0 , n.Mode);
}
[Test]
@@ -172,7 +172,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateMedian(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
- AssertEx.AreEqual((lower + upper) / 2.0, n.Median);
+ Assert.AreEqual((lower + upper) / 2.0, n.Median);
}
[Test]
@@ -185,7 +185,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateMinimum(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
- AssertEx.AreEqual(lower, n.Minimum);
+ Assert.AreEqual(lower, n.Minimum);
}
[Test]
@@ -198,7 +198,7 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void ValidateMaximum(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
- AssertEx.AreEqual(upper, n.Maximum);
+ Assert.AreEqual(upper, n.Maximum);
}
[Test]
@@ -216,11 +216,11 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
double x = i - 5.0;
if(x >= lower && x <= upper)
{
- AssertEx.AreEqual(1.0 / (upper - lower), n.Density(x));
+ Assert.AreEqual(1.0 / (upper - lower), n.Density(x));
}
else
{
- AssertEx.AreEqual(0.0, n.Density(x));
+ Assert.AreEqual(0.0, n.Density(x));
}
}
}
@@ -240,11 +240,11 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
double x = i - 5.0;
if (x >= lower && x <= upper)
{
- AssertEx.AreEqual(-Math.Log(upper - lower), n.DensityLn(x));
+ Assert.AreEqual(-Math.Log(upper - lower), n.DensityLn(x));
}
else
{
- AssertEx.AreEqual(double.NegativeInfinity, n.DensityLn(x));
+ Assert.AreEqual(double.NegativeInfinity, n.DensityLn(x));
}
}
}
@@ -306,15 +306,15 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
double x = i - 5.0;
if (x <= lower)
{
- AssertEx.AreEqual(0.0, n.CumulativeDistribution(x));
+ Assert.AreEqual(0.0, n.CumulativeDistribution(x));
}
else if (x >= upper)
{
- AssertEx.AreEqual(1.0, n.CumulativeDistribution(x));
+ Assert.AreEqual(1.0, n.CumulativeDistribution(x));
}
else
{
- AssertEx.AreEqual((x - lower) / (upper - lower), n.CumulativeDistribution(x));
+ Assert.AreEqual((x - lower) / (upper - lower), n.CumulativeDistribution(x));
}
}
}
diff --git a/src/UnitTests/DistributionTests/Continuous/ErlangTests.cs b/src/UnitTests/DistributionTests/Continuous/ErlangTests.cs
new file mode 100644
index 00000000..e6315202
--- /dev/null
+++ b/src/UnitTests/DistributionTests/Continuous/ErlangTests.cs
@@ -0,0 +1,364 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
+{
+ using System;
+ using System.Linq;
+ using MbUnit.Framework;
+ using Distributions;
+
+ [TestFixture]
+ public class ErlangTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ Control.CheckDistributionParameters = true;
+ }
+
+ [Test, MultipleAsserts]
+ [Row(0, 0.0)]
+ [Row(1, 0.1)]
+ [Row(1, 1.0)]
+ [Row(10, 10.0)]
+ [Row(10, 1.0)]
+ [Row(10, Double.PositiveInfinity)]
+ public void CanCreateErlang(int shape, double invScale)
+ {
+ var n = new Erlang(shape, invScale);
+ Assert.AreEqual(shape, n.Shape);
+ Assert.AreEqual(invScale, n.InvScale);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(1, Double.NaN)]
+ [Row(1, -1.0)]
+ [Row(-1, 1.0)]
+ [Row(-1, -1.0)]
+ [Row(-1, Double.NaN)]
+ public void ErlangCreateFailsWithBadParameters(int shape, double invScale)
+ {
+ var n = new Erlang(shape, invScale);
+ }
+
+ [Test, MultipleAsserts]
+ [Row(0, 0.0)]
+ [Row(1, 0.1)]
+ [Row(1, 1.0)]
+ [Row(10, 10.0)]
+ [Row(10, 1.0)]
+ [Row(10, Double.PositiveInfinity)]
+ public void CanCreateErlangWithShapeInvScale(int shape, double invScale)
+ {
+ var n = Erlang.WithShapeInvScale(shape, invScale);
+ Assert.AreEqual(shape, n.Shape);
+ Assert.AreEqual(invScale, n.InvScale);
+ }
+
+ [Test, MultipleAsserts]
+ [Row(0, 0.0)]
+ [Row(1, 0.1)]
+ [Row(1, 1.0)]
+ [Row(10, 10.0)]
+ [Row(10, 1.0)]
+ [Row(10, Double.PositiveInfinity)]
+ public void CanCreateGammaWithShapeScale(int shape, double scale)
+ {
+ var n = Erlang.WithShapeScale(shape, scale);
+ Assert.AreEqual(shape, n.Shape);
+ Assert.AreEqual(scale, n.Scale);
+ }
+
+ [Test]
+ public void ValidateToString()
+ {
+ var n = new Erlang(1, 2.0);
+ Assert.AreEqual("Erlang(Shape = 1, Inverse Scale = 2)", n.ToString());
+ }
+
+ [Test]
+ [Row(-0)]
+ [Row(0)]
+ [Row(1)]
+ [Row(10)]
+ public void CanSetShape(int shape)
+ {
+ var n = new Erlang(1, 1.0);
+ n.Shape = shape;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetShapeFailsWithNegativeShape()
+ {
+ var n = new Erlang(1, 1.0);
+ n.Shape = -1;
+ }
+
+ [Test]
+ [Row(-0.0)]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanSetScale(double scale)
+ {
+ var n = new Erlang(1, 1.0);
+ n.Scale = scale;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetScaleFailsWithNegativeScale()
+ {
+ var n = new Erlang(1, 1.0);
+ n.Scale = -1.0;
+ }
+
+ [Test]
+ [Row(-0.0)]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanSetInvScale(double invScale)
+ {
+ var n = new Erlang(1, 1.0);
+ n.InvScale = invScale;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetInvScaleFailsWithNegativeInvScale()
+ {
+ var n = new Erlang(1, 1.0);
+ n.InvScale = -1.0;
+ }
+
+ [Test]
+ [Row(0, 0.0, Double.NaN)]
+ [Row(1, 0.1, 10.0)]
+ [Row(1, 1.0, 1.0)]
+ [Row(10, 10.0, 1.0)]
+ [Row(10, 1.0, 10.0)]
+ [Row(10, Double.PositiveInfinity, 10.0)]
+ public void ValidateMean(int shape, double invScale, double mean)
+ {
+ var n = new Erlang(shape, invScale);
+ Assert.AreEqual(mean, n.Mean);
+ }
+
+ [Test]
+ [Row(0, 0.0, Double.NaN)]
+ [Row(1, 0.1, 100.0)]
+ [Row(1, 1.0, 1.0)]
+ [Row(10, 10.0, 0.1)]
+ [Row(10, 1.0, 10.0)]
+ [Row(10, Double.PositiveInfinity, 0.0)]
+ public void ValidateVariance(int shape, double invScale, double var)
+ {
+ var n = new Erlang(shape, invScale);
+ AssertHelpers.AlmostEqual(var, n.Variance, 15);
+ }
+
+ [Test]
+ [Row(0, 0.0, Double.NaN)]
+ [Row(1, 0.1, 10.0)]
+ [Row(1, 1.0, 1.0)]
+ [Row(10, 10.0, 0.31622776601683794197697302588502426416723164097476643)]
+ [Row(10, 1.0, 3.1622776601683793319988935444327185337195551393252168)]
+ [Row(10, Double.PositiveInfinity, 0.0)]
+ public void ValidateStdDev(int shape, double invScale, double sdev)
+ {
+ var n = new Erlang(shape, invScale);
+ AssertHelpers.AlmostEqual(sdev, n.StdDev, 15);
+ }
+
+ [Test]
+ [Row(0, 0.0, Double.NaN)]
+ [Row(1, 0.1, 3.3025850929940456285068402234265387271634735938763824)]
+ [Row(1, 1.0, 1.0)]
+ [Row(10, 10.0, 0.23346908548693395836262094490967812177376750477943892)]
+ [Row(10, 1.0, 2.5360541784809796423806123995940423293748689934081866)]
+ [Row(10, Double.PositiveInfinity, 0.0)]
+ public void ValidateEntropy(int shape, double invScale, double entropy)
+ {
+ var n = new Erlang(shape, invScale);
+ AssertHelpers.AlmostEqual(entropy, n.Entropy, 13);
+ }
+
+ [Test]
+ [Row(0, 0.0, Double.NaN)]
+ [Row(1, 0.1, 2.0)]
+ [Row(1, 1.0, 2.0)]
+ [Row(10, 10.0, 0.63245553203367586639977870888654370674391102786504337)]
+ [Row(10, 1.0, 0.63245553203367586639977870888654370674391102786504337)]
+ [Row(10, Double.PositiveInfinity, 0.0)]
+ public void ValidateSkewness(int shape, double invScale, double skewness)
+ {
+ var n = new Erlang(shape, invScale);
+ AssertHelpers.AlmostEqual(skewness, n.Skewness, 15);
+ }
+
+ [Test]
+ [Row(1, 0.1, 0.0)]
+ [Row(1, 1.0, 0.0)]
+ [Row(10, 10.0, 0.9)]
+ [Row(10, 1.0, 9.0)]
+ [Row(10, Double.PositiveInfinity, 10.0)]
+ public void ValidateMode(int shape, double invScale, double mode)
+ {
+ var n = new Erlang(shape, invScale);
+ Assert.AreEqual(mode, n.Mode);
+ }
+
+ [Test]
+ [ExpectedException(typeof(NotSupportedException))]
+ [Row(0, 0.0)]
+ [Row(1, 0.1)]
+ [Row(1, 1.0)]
+ [Row(10, 10.0)]
+ [Row(10, 1.0)]
+ [Row(10, Double.PositiveInfinity)]
+ public void ValidateMedian(int shape, double invScale)
+ {
+ var n = new Erlang(shape, invScale);
+ var median = n.Median;
+ }
+
+ [Test]
+ public void ValidateMinimum()
+ {
+ var n = new Erlang(1, 1.0);
+ Assert.AreEqual(0.0, n.Minimum);
+ }
+
+ [Test]
+ public void ValidateMaximum()
+ {
+ var n = new Erlang(1, 1.0);
+ Assert.AreEqual(System.Double.PositiveInfinity, n.Maximum);
+ }
+
+ [Test]
+ [Row(0, 0.0, 0.0, 0.0)]
+ [Row(0, 0.0, 1.0, 0.0)]
+ [Row(0, 0.0, 10.0, 0.0)]
+ [Row(1, 0.1, 0.0, 0.10000000000000000555111512312578270211815834045410156)]
+ [Row(1, 0.1, 1.0, 0.090483741803595961836995913651194571475319347018875963)]
+ [Row(1, 0.1, 10.0, 0.036787944117144234201693506390001264039984687455876246)]
+ [Row(1, 1.0, 0.0, 1.0)]
+ [Row(1, 1.0, 1.0, 0.36787944117144232159552377016146086744581113103176804)]
+ [Row(1, 1.0, 10.0, 0.000045399929762484851535591515560550610237918088866564953)]
+ [Row(10, 10.0, 0.0, 0.0)]
+ [Row(10, 10.0, 1.0, 1.2511003572113329898476497894772544708420990097708588)]
+ [Row(10, 10.0, 10.0, 1.0251532120868705806216092933926141802686541811003037e-30)]
+ [Row(10, 1.0, 0.0, 0.0)]
+ [Row(10, 1.0, 1.0, 0.0000010137771196302974029859010421116095333052555418644397)]
+ [Row(10, 1.0, 10.0, 0.12511003572113329898476497894772544708420990097708601)]
+ [Row(10, Double.PositiveInfinity, 0.0, 0.0)]
+ [Row(10, Double.PositiveInfinity, 1.0, 0.0)]
+ [Row(10, Double.PositiveInfinity, 10.0, Double.PositiveInfinity)]
+ public void ValidateDensity(int shape, double invScale, double x, double pdf)
+ {
+ var n = new Erlang(shape, invScale);
+ AssertHelpers.AlmostEqual(pdf, n.Density(x), 14);
+ }
+
+ [Test]
+ [Row(0, 0.0, 0.0, Double.NegativeInfinity)]
+ [Row(0, 0.0, 1.0, Double.NegativeInfinity)]
+ [Row(0, 0.0, 10.0, Double.NegativeInfinity)]
+ [Row(1, 0.1, 0.0, -2.3025850929940456285068402234265387271634735938763824)]
+ [Row(1, 0.1, 1.0, -2.402585092994045634057955346552321429281631934330484)]
+ [Row(1, 0.1, 10.0, -3.3025850929940456285068402234265387271634735938763824)]
+ [Row(1, 1.0, 0.0, 0.0)]
+ [Row(1, 1.0, 1.0, -1.0)]
+ [Row(1, 1.0, 10.0, -10.0)]
+ [Row(10, 10.0, 0.0, Double.NegativeInfinity)]
+ [Row(10, 10.0, 1.0, 0.22402344985898722897219667227693591172986563062456522)]
+ [Row(10, 10.0, 10.0, -69.052710713194601614865880235563786219860220971716511)]
+ [Row(10, 1.0, 0.0, Double.NegativeInfinity)]
+ [Row(10, 1.0, 1.0, -13.801827480081469611207717874566706164281149255663166)]
+ [Row(10, 1.0, 10.0, -2.0785616431350584550457947824074282958712358580042068)]
+ [Row(10, Double.PositiveInfinity, 0.0, Double.NegativeInfinity)]
+ [Row(10, Double.PositiveInfinity, 1.0, Double.NegativeInfinity)]
+ [Row(10, Double.PositiveInfinity, 10.0, Double.PositiveInfinity)]
+ public void ValidateDensityLn(int shape, double invScale, double x, double pdfln)
+ {
+ var n = new Erlang(shape, invScale);
+ AssertHelpers.AlmostEqual(pdfln, n.DensityLn(x), 14);
+ }
+
+ [Test]
+ public void CanSample()
+ {
+ var n = new Erlang(1, 2.0);
+ var d = n.Sample();
+ }
+
+ [Test]
+ public void CanSampleSequence()
+ {
+ var n = new Erlang(1, 2.0);
+ var ied = n.Samples();
+ var e = ied.Take(5).ToArray();
+ }
+
+ [Test]
+ [Row(0, 0.0, 0.0, 0.0)]
+ [Row(0, 0.0, 1.0, 0.0)]
+ [Row(0, 0.0, 10.0, 0.0)]
+ [Row(1, 0.1, 0.0, 0.0)]
+ [Row(1, 0.1, 1.0, 0.095162581964040431858607615783064404690935346242622848)]
+ [Row(1, 0.1, 10.0, 0.63212055882855767840447622983853913255418886896823196)]
+ [Row(1, 1.0, 0.0, 0.0)]
+ [Row(1, 1.0, 1.0, 0.63212055882855767840447622983853913255418886896823196)]
+ [Row(1, 1.0, 10.0, 0.99995460007023751514846440848443944938976208191113396)]
+ [Row(10, 10.0, 0.0, 0.0)]
+ [Row(10, 10.0, 1.0, 0.54207028552814779168583514294066541824736464003242184)]
+ [Row(10, 10.0, 10.0, 0.99999999999999999999999999999988746526039157266114706)]
+ [Row(10, 1.0, 0.0, 0.0)]
+ [Row(10, 1.0, 1.0, 0.00000011142547833872067735305068724025236288094949815466035)]
+ [Row(10, 1.0, 10.0, 0.54207028552814779168583514294066541824736464003242184)]
+ [Row(10, Double.PositiveInfinity, 0.0, 0.0)]
+ [Row(10, Double.PositiveInfinity, 1.0, 0.0)]
+ [Row(10, Double.PositiveInfinity, 10.0, 1.0)]
+ public void ValidateCumulativeDistribution(int shape, double invScale, double x, double cdf)
+ {
+ var n = new Erlang(shape, invScale);
+ AssertHelpers.AlmostEqual(cdf, n.CumulativeDistribution(x), 14);
+ }
+ }
+}
diff --git a/src/UnitTests/DistributionTests/Continuous/ExponentialTests.cs b/src/UnitTests/DistributionTests/Continuous/ExponentialTests.cs
new file mode 100644
index 00000000..eafbfdb9
--- /dev/null
+++ b/src/UnitTests/DistributionTests/Continuous/ExponentialTests.cs
@@ -0,0 +1,305 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
+{
+ using System;
+ using System.Linq;
+ using MbUnit.Framework;
+ using Distributions;
+
+ [TestFixture]
+ public class ExponentialTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ Control.CheckDistributionParameters = true;
+ }
+
+ [Test, MultipleAsserts]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanCreateExponential(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(lambda, n.Lambda);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(Double.NaN)]
+ [Row(-1.0)]
+ [Row(-10.0)]
+ public void ExponentialCreateFailsWithBadParameters(double lambda)
+ {
+ var n = new Exponential(lambda);
+ }
+
+ [Test]
+ public void ValidateToString()
+ {
+ var n = new Exponential(2.0);
+ Assert.AreEqual("Exponential(Lambda = 2)", n.ToString());
+ }
+
+ [Test]
+ [Row(-0.0)]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanSetLambda(double lambda)
+ {
+ var n = new Exponential(1.0);
+ n.Lambda = lambda;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetLambdaFailsWithNegativeLambda()
+ {
+ var n = new Exponential(1.0);
+ n.Lambda = -1.0;
+ }
+
+ [Test]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMean(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(1.0 / lambda, n.Mean);
+ }
+
+ [Test]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateVariance(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(1.0 / (lambda * lambda), n.Variance);
+ }
+
+ [Test]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateStdDev(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(1.0 / lambda, n.StdDev);
+ }
+
+ [Test]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateEntropy(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(1.0 - Math.Log(lambda), n.Entropy);
+ }
+
+ [Test]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateSkewness(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(2.0, n.Skewness);
+ }
+
+ [Test]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMode(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(0.0, n.Mode);
+ }
+
+ [Test]
+ [Row(0.0)]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void ValidateMedian(double lambda)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(Math.Log(2.0) / lambda, n.Median);
+ }
+
+ [Test]
+ public void ValidateMinimum()
+ {
+ var n = new Exponential(1.0);
+ Assert.AreEqual(0.0, n.Minimum);
+ }
+
+ [Test]
+ public void ValidateMaximum()
+ {
+ var n = new Exponential(1.0);
+ Assert.AreEqual(Double.PositiveInfinity, n.Maximum);
+ }
+
+ [Test]
+ [Row(0.0, 0.0)]
+ [Row(0.1, 0.0)]
+ [Row(1.0, 0.0)]
+ [Row(10.0, 0.0)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(0.0, 0.1)]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.0, 1.0)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateDensity(double lambda, double x)
+ {
+ var n = new Exponential(lambda);
+ if (x >= 0)
+ {
+ Assert.AreEqual(lambda * Math.Exp(-lambda * x), n.Density(x));
+ }
+ else
+ {
+ Assert.AreEqual(0.0, n.Density(lambda));
+ }
+ }
+
+ [Test]
+ [Row(0.0, 0.0)]
+ [Row(0.1, 0.0)]
+ [Row(1.0, 0.0)]
+ [Row(10.0, 0.0)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(0.0, 0.1)]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.0, 1.0)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateDensityLn(double lambda, double x)
+ {
+ var n = new Exponential(lambda);
+ Assert.AreEqual(Math.Log(lambda) - lambda * x, n.DensityLn(x));
+ }
+
+ [Test]
+ public void CanSample()
+ {
+ var n = new Exponential(1.0);
+ var d = n.Sample();
+ }
+
+ [Test]
+ public void CanSampleSequence()
+ {
+ var n = new Exponential(1.0);
+ var ied = n.Samples();
+ var e = ied.Take(5).ToArray();
+ }
+
+ [Test]
+ [Row(0.0, 0.0)]
+ [Row(0.1, 0.0)]
+ [Row(1.0, 0.0)]
+ [Row(10.0, 0.0)]
+ [Row(Double.PositiveInfinity, 0.0)]
+ [Row(0.0, 0.1)]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.0, 1.0)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.0, Double.PositiveInfinity)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateCumulativeDistribution(double lambda, double x)
+ {
+ var n = new Exponential(lambda);
+ if (x >= 0.0)
+ {
+ Assert.AreEqual(1.0 - Math.Exp(-lambda * x), n.CumulativeDistribution(x));
+ }
+ else
+ {
+ Assert.AreEqual(0.0, n.CumulativeDistribution(x));
+ }
+ }
+ }
+}
diff --git a/src/UnitTests/DistributionTests/Continuous/FisherSnedecorTests.cs b/src/UnitTests/DistributionTests/Continuous/FisherSnedecorTests.cs
new file mode 100644
index 00000000..0c67e276
--- /dev/null
+++ b/src/UnitTests/DistributionTests/Continuous/FisherSnedecorTests.cs
@@ -0,0 +1,371 @@
+//
+// Math.NET Numerics, part of the Math.NET Project
+// http://numerics.mathdotnet.com
+// http://github.com/mathnet/mathnet-numerics
+// http://mathnetnumerics.codeplex.com
+//
+// Copyright (c) 2009-2010 Math.NET
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
+{
+ using System;
+ using System.Linq;
+ using MbUnit.Framework;
+ using Distributions;
+
+ [TestFixture]
+ public class FisherSnedecorTests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ Control.CheckDistributionParameters = true;
+ }
+
+ [Test, MultipleAsserts]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void CanCreateFisherSnedecor(double d1, double d2)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ Assert.AreEqual(d1, n.DegreeOfFreedom1);
+ Assert.AreEqual(d2, n.DegreeOfFreedom2);
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ [Row(Double.NaN, Double.NaN)]
+ [Row(0.0, Double.NaN)]
+ [Row(-1.0, Double.NaN)]
+ [Row(-10.0, Double.NaN)]
+ [Row(Double.NaN, 0.0)]
+ [Row(0.0, 0.0)]
+ [Row(-1.0, 0.0)]
+ [Row(-10.0, 0.0)]
+ [Row(Double.NaN, -1.0)]
+ [Row(0.0, -1.0)]
+ [Row(-1.0, -1.0)]
+ [Row(-10.0, -1.0)]
+ [Row(Double.NaN, -10.0)]
+ [Row(0.0, -10.0)]
+ [Row(-1.0, -10.0)]
+ [Row(-10.0, -10.0)]
+ public void FisherSnedecorCreateFailsWithBadParameters(double d1, double d2)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ }
+
+ [Test]
+ public void ValidateToString()
+ {
+ var n = new FisherSnedecor(2.0, 1.0);
+ Assert.AreEqual("FisherSnedecor(DegreeOfFreedom1 = 2, DegreeOfFreedom2 = 1)", n.ToString());
+ }
+
+ [Test]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanSetDegreeOfFreedom1(double d1)
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ n.DegreeOfFreedom1 = d1;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetDegreeOfFreedom1FailsWithNegativeDegreeOfFreedom()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ n.DegreeOfFreedom1 = -1.0;
+ }
+
+ [Test]
+ [Row(0.1)]
+ [Row(1.0)]
+ [Row(10.0)]
+ [Row(Double.PositiveInfinity)]
+ public void CanSetDegreeOfFreedom2(double d2)
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ n.DegreeOfFreedom2 = d2;
+ }
+
+ [Test]
+ [ExpectedException(typeof(ArgumentOutOfRangeException))]
+ public void SetDegreeOfFreedom2FailsWithNegativeDegreeOfFreedom()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ n.DegreeOfFreedom2 = -1.0;
+ }
+
+ [Test]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateMean(double d1, double d2)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ if (d2 > 2)
+ {
+ Assert.AreEqual(d2 / (d2 - 2.0), n.Mean);
+ }
+ }
+
+ [Test]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateVariance(double d1, double d2)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ if (d2 > 4)
+ {
+ Assert.AreEqual((2.0 * d2 * d2 * (d1 + d2 - 2.0)) / (d1 * (d2 - 2.0) * (d2 - 2.0) * (d2 - 4.0)), n.Variance);
+ }
+ }
+
+ [Test]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateStdDev(double d1, double d2)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ if (d2 > 4)
+ {
+ Assert.AreEqual(Math.Sqrt(n.Variance), n.StdDev);
+ }
+ }
+
+ [Test]
+ [ExpectedException(typeof(NotSupportedException))]
+ public void ValidateEntropy()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ var ent = n.Entropy;
+ }
+
+ [Test]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(Double.PositiveInfinity, 0.1)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(Double.PositiveInfinity, 1.0)]
+ [Row(0.1, Double.PositiveInfinity)]
+ [Row(1.0, Double.PositiveInfinity)]
+ [Row(10.0, Double.PositiveInfinity)]
+ [Row(Double.PositiveInfinity, Double.PositiveInfinity)]
+ public void ValidateSkewness(double d1, double d2)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ if (d2 > 6)
+ {
+ Assert.AreEqual(((2.0 * d1 + d2 - 2.0) * Math.Sqrt(8.0 * (d2 - 4.0))) / ((d2 - 6.0) * Math.Sqrt(d1 * (d1 + d2 - 2.0))), n.Skewness);
+ }
+ }
+
+ [Test]
+ [Row(0.1, 0.1)]
+ [Row(1.0, 0.1)]
+ [Row(10.0, 0.1)]
+ [Row(100.0, 0.1)]
+ [Row(0.1, 1.0)]
+ [Row(1.0, 1.0)]
+ [Row(10.0, 1.0)]
+ [Row(100.0, 1.0)]
+ [Row(0.1, 100.0)]
+ [Row(1.0, 100.0)]
+ [Row(10.0, 100.0)]
+ [Row(100.0, 100.0)]
+ public void ValidateMode(double d1, double d2)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ if (d1 > 2)
+ {
+ Assert.AreEqual((d2 * (d1 - 2.0)) / (d1 * (d2 + 2.0)), n.Mode);
+ }
+ }
+
+ [Test]
+ [ExpectedException(typeof(NotSupportedException))]
+ public void ValidateMedian()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ var m = n.Median;
+ }
+
+ [Test]
+ public void ValidateMinimum()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ Assert.AreEqual(0.0, n.Minimum);
+ }
+
+ [Test]
+ public void ValidateMaximum()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ Assert.AreEqual(Double.PositiveInfinity, n.Maximum);
+ }
+
+ [Test]
+ [Row(0.1, 0.1, 1.0)]
+ [Row(1.0, 0.1, 1.0)]
+ [Row(10.0, 0.1, 1.0)]
+ [Row(100.0, 0.1, 1.0)]
+ [Row(0.1, 1.0, 1.0)]
+ [Row(1.0, 1.0, 1.0)]
+ [Row(10.0, 1.0, 1.0)]
+ [Row(100.0, 1.0, 1.0)]
+ [Row(0.1, 100.0, 1.0)]
+ [Row(1.0, 100.0, 1.0)]
+ [Row(10.0, 100.0, 1.0)]
+ [Row(100.0, 100.0, 1.0)]
+ [Row(0.1, 0.1, 10.0)]
+ [Row(1.0, 0.1, 10.0)]
+ [Row(10.0, 0.1, 10.0)]
+ [Row(100.0, 0.1, 10.0)]
+ [Row(0.1, 1.0, 10.0)]
+ [Row(1.0, 1.0, 10.0)]
+ [Row(10.0, 1.0, 10.0)]
+ [Row(100.0, 1.0, 10.0)]
+ [Row(0.1, 100.0, 10.0)]
+ [Row(1.0, 100.0, 10.0)]
+ [Row(10.0, 100.0, 10.0)]
+ [Row(100.0, 100.0, 10.0)]
+ public void ValidateDensity(double d1, double d2, double x)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ Assert.AreEqual(Math.Sqrt(Math.Pow(d1 * x, d1) * Math.Pow(d2, d2) / (Math.Pow(d1 * x + d2, d1 + d2))) / (x * SpecialFunctions.Beta(d1 / 2.0, d2 / 2.0)), n.Density(x));
+ }
+
+ [Test]
+ [Row(0.1, 0.1, 1.0)]
+ [Row(1.0, 0.1, 1.0)]
+ [Row(10.0, 0.1, 1.0)]
+ [Row(100.0, 0.1, 1.0)]
+ [Row(0.1, 1.0, 1.0)]
+ [Row(1.0, 1.0, 1.0)]
+ [Row(10.0, 1.0, 1.0)]
+ [Row(100.0, 1.0, 1.0)]
+ [Row(0.1, 100.0, 1.0)]
+ [Row(1.0, 100.0, 1.0)]
+ [Row(10.0, 100.0, 1.0)]
+ [Row(100.0, 100.0, 1.0)]
+ [Row(0.1, 0.1, 10.0)]
+ [Row(1.0, 0.1, 10.0)]
+ [Row(10.0, 0.1, 10.0)]
+ [Row(100.0, 0.1, 10.0)]
+ [Row(0.1, 1.0, 10.0)]
+ [Row(1.0, 1.0, 10.0)]
+ [Row(10.0, 1.0, 10.0)]
+ [Row(100.0, 1.0, 10.0)]
+ [Row(0.1, 100.0, 10.0)]
+ [Row(1.0, 100.0, 10.0)]
+ [Row(10.0, 100.0, 10.0)]
+ [Row(100.0, 100.0, 10.0)]
+ public void ValidateDensityLn(double d1, double d2, double x)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ Assert.AreEqual(Math.Log(n.Density(x)), n.DensityLn(x));
+ }
+
+ [Test]
+ public void CanSample()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ var d = n.Sample();
+ }
+
+ [Test]
+ public void CanSampleSequence()
+ {
+ var n = new FisherSnedecor(1.0, 2.0);
+ var ied = n.Samples();
+ var e = ied.Take(5).ToArray();
+ }
+
+ [Test]
+ [Row(0.1, 0.1, 1.0)]
+ [Row(1.0, 0.1, 1.0)]
+ [Row(10.0, 0.1, 1.0)]
+ [Row(0.1, 1.0, 1.0)]
+ [Row(1.0, 1.0, 1.0)]
+ [Row(10.0, 1.0, 1.0)]
+ [Row(0.1, 0.1, 10.0)]
+ [Row(1.0, 0.1, 10.0)]
+ [Row(10.0, 0.1, 10.0)]
+ [Row(0.1, 1.0, 10.0)]
+ [Row(1.0, 1.0, 10.0)]
+ [Row(10.0, 1.0, 10.0)]
+ public void ValidateCumulativeDistribution(double d1, double d2, double x)
+ {
+ var n = new FisherSnedecor(d1, d2);
+ Assert.AreEqual(SpecialFunctions.BetaRegularized(d1 / 2.0, d2 / 2.0, d1 * d2 / (d1 + d1 * d2)), n.CumulativeDistribution(x));
+ }
+ }
+}
diff --git a/src/UnitTests/DistributionTests/Continuous/GammaTests.cs b/src/UnitTests/DistributionTests/Continuous/GammaTests.cs
index 013fe9ce..4bb6c6cc 100644
--- a/src/UnitTests/DistributionTests/Continuous/GammaTests.cs
+++ b/src/UnitTests/DistributionTests/Continuous/GammaTests.cs
@@ -54,8 +54,8 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void CanCreateGamma(double shape, double invScale)
{
var n = new Gamma(shape, invScale);
- AssertEx.AreEqual(shape, n.Shape);
- AssertEx.AreEqual(invScale, n.InvScale);
+ Assert.AreEqual(shape, n.Shape);
+ Assert.AreEqual(invScale, n.InvScale);
}
[Test]
@@ -81,8 +81,8 @@ namespace MathNet.Numerics.UnitTests.DistributionTests.Continuous
public void CanCreateGammaWithShapeInvScale(double shape, double invScale)
{
var n = Gamma.WithShapeInvScale(shape, invScale);
- AssertEx.AreEqual