diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 412eeda..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,22 +0,0 @@
-# Auto detect text files and perform LF normalization
-* text=auto
-
-# Custom for Visual Studio
-*.cs diff=csharp
-*.sln merge=union
-*.csproj merge=union
-*.vbproj merge=union
-*.fsproj merge=union
-*.dbproj merge=union
-
-# Standard to msysgit
-*.doc diff=astextplain
-*.DOC diff=astextplain
-*.docx diff=astextplain
-*.DOCX diff=astextplain
-*.dot diff=astextplain
-*.DOT diff=astextplain
-*.pdf diff=astextplain
-*.PDF diff=astextplain
-*.rtf diff=astextplain
-*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
index 5ebd21a..dd3450e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,56 +1,89 @@
-#################
-## Eclipse
-#################
-
-*.pydevproject
-.project
-.metadata
-bin/
-tmp/
-*.tmp
-*.bak
-*.swp
-*~.nib
-local.properties
-.classpath
-.settings/
-.loadpath
-
-# External tool builders
-.externalToolBuilders/
-
-# Locally stored "Eclipse launch configurations"
-*.launch
-
-# CDT-specific
-.cproject
-# PDT-specific
-.buildpath
-
-
-#################
-## Visual Studio
-#################
+# Created by https://www.toptal.com/developers/gitignore/api/visualstudio,csharp
+# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio,csharp
+### Csharp ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
+*.rsuser
*.suo
*.user
+*.userosscache
*.sln.docstates
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
# Build results
[Dd]ebug/
+[Dd]ebugPublic/
[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
*_i.c
*_p.c
+*_h.h
*.ilk
*.meta
*.obj
+*.iobj
*.pch
*.pdb
+*.ipdb
*.pgc
*.pgd
*.rsp
@@ -59,29 +92,84 @@ local.properties
*.tli
*.tlh
*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
*.vspscc
+*.vssscc
.builds
-*.dotCover
+*.pidb
+*.svclog
+*.scc
-## TODO: If you have NuGet Package Restore enabled, uncomment this
-#packages/
+# Chutzpah Test files
+_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
+*.opendb
*.opensdf
*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
# ReSharper is a .NET coding add-in
-_ReSharper*
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
# Installshield output folder
-[Ee]xpress
+[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
@@ -94,70 +182,389 @@ DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
-publish
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Nuget personal access tokens and Credentials
+nuget.config
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
# Others
-[Bb]in
-[Oo]bj
-sql
-TestResults
-*.Cache
-ClientBin
-stylecop.*
+ClientBin/
~$*
+*~
*.dbmdl
-Generated_Code #added for RIA/Silverlight projects
-
-# Backup & report files from converting an old project file to a newer
-# Visual Studio version. Backup files are not needed, because we have git ;-)
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+### VisualStudio ###
+
+# User-specific files
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+
+# Mono auto generated files
+
+# Build results
+
+# Visual Studio 2015/2017 cache/options directory
+# Uncomment if you have tasks that create the project's static files in wwwroot
+
+# Visual Studio 2017 auto generated files
+
+# MSTest test Results
+
+# NUnit
+
+# Build Results of an ATL Project
+
+# Benchmark Results
+
+# .NET Core
+
+# ASP.NET Scaffolding
+
+# StyleCop
+
+# Files built by Visual Studio
+
+# Chutzpah Test files
+
+# Visual C++ cache files
+
+# Visual Studio profiler
+
+# Visual Studio Trace Files
+
+# TFS 2012 Local Workspace
+
+# Guidance Automation Toolkit
+
+# ReSharper is a .NET coding add-in
+
+# TeamCity is a build add-in
+
+# DotCover is a Code Coverage Tool
+
+# AxoCover is a Code Coverage Tool
+
+# Coverlet is a free, cross platform Code Coverage Tool
+
+# Visual Studio code coverage results
+
+# NCrunch
+
+# MightyMoose
+
+# Web workbench (sass)
+
+# Installshield output folder
+
+# DocProject is a documentation generator add-in
+
+# Click-Once directory
+
+# Publish Web Output
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+
+# NuGet Packages
+# NuGet Symbol Packages
+# The packages folder can be ignored because of Package Restore
+# except build/, which is used as an MSBuild target.
+# Uncomment if necessary however generally it will be regenerated when needed
+# NuGet v3's project.json files produces more ignorable files
+
+# Nuget personal access tokens and Credentials
+
+# Microsoft Azure Build Output
+
+# Microsoft Azure Emulator
+
+# Windows Store app package directories and files
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+# but keep track of directories ending in .cache
+
+# Others
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+
+# RIA/Silverlight projects
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+
+# SQL Server files
+
+# Business Intelligence projects
+
+# Microsoft Fakes
+
+# GhostDoc plugin setting file
+
+# Node.js Tools for Visual Studio
+
+# Visual Studio 6 build log
+
+# Visual Studio 6 workspace options file
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+
+# Visual Studio LightSwitch build output
+
+# Paket dependency manager
+
+# FAKE - F# Make
+
+# CodeRush personal settings
+
+# Python Tools for Visual Studio (PTVS)
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+
+# Telerik's JustMock configuration file
+
+# BizTalk build output
+
+# OpenCover UI analysis results
+
+# Azure Stream Analytics local run output
+# MSBuild Binary and Structured Log
+# NVidia Nsight GPU debugger configuration file
-############
-## Windows
-############
+# MFractors (Xamarin productivity tool) working folder
-# Windows image file caches
-Thumbs.db
+# Local History for Visual Studio
-# Folder config file
-Desktop.ini
+# BeatPulse healthcheck temp database
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
-#############
-## Python
-#############
+# Ionide (cross platform F# VS Code tools) working folder
-*.py[co]
+# Fody - auto-generated XML schema
-# Packages
-*.egg
-*.egg-info
-dist
-build
-eggs
-parts
-bin
-var
-sdist
-develop-eggs
-.installed.cfg
+# VS Code files for those working on multiple tools
-# Installer logs
-pip-log.txt
+# Local History for Visual Studio Code
-# Unit test / coverage reports
-.coverage
-.tox
+# Windows Installer files from build outputs
-#Translations
-*.mo
+# JetBrains Rider
-#Mr Developer
-.mr.developer.cfg
+### VisualStudio Patch ###
+# Additional files built by Visual Studio
-# Mac crap
-.DS_Store
+# End of https://www.toptal.com/developers/gitignore/api/visualstudio,csharp
\ No newline at end of file
diff --git a/NeatoAPI.sln b/NeatoAPI.sln
deleted file mode 100644
index a002edc..0000000
--- a/NeatoAPI.sln
+++ /dev/null
@@ -1,54 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeatoAPI", "NeatoAPI\NeatoAPI.csproj", "{DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeatoTestApp", "NeatoTest\NeatoTestApp.csproj", "{02B71822-B1BB-47A7-990B-90AD90C8DC27}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeatoAPITest", "NeatoAPITest\NeatoAPITest.csproj", "{F25B1FB9-99F0-4950-B46F-A02E577AFDE2}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Release|Any CPU.Build.0 = Release|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}.Release|x86.ActiveCfg = Release|Any CPU
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Debug|Any CPU.ActiveCfg = Debug|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Debug|x86.ActiveCfg = Debug|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Debug|x86.Build.0 = Debug|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Release|Any CPU.ActiveCfg = Release|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Release|Mixed Platforms.Build.0 = Release|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Release|x86.ActiveCfg = Release|x86
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}.Release|x86.Build.0 = Release|x86
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Release|Any CPU.Build.0 = Release|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}.Release|x86.ActiveCfg = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/NeatoAPI/Commands/Command.cs b/NeatoAPI/Commands/Command.cs
index de26148..f623262 100644
--- a/NeatoAPI/Commands/Command.cs
+++ b/NeatoAPI/Commands/Command.cs
@@ -13,12 +13,12 @@ public class Command
///
public Command(Neato parent)
{
- this.Movement = new Movement(parent);
- this.GetInfo = new GetInfo(parent);
- this.Test = new Test(parent);
- this.Schedule = new Schedule(parent);
- this.System = new Sys(parent);
- this.Misc = new Misc(parent);
+ Movement = new Movement(parent);
+ GetInfo = new GetInfo(parent);
+ Test = new Test(parent);
+ Schedule = new Schedule(parent);
+ System = new Sys(parent);
+ Misc = new Misc(parent);
}
///
@@ -51,4 +51,4 @@ public Command(Neato parent)
///
public Misc Misc { get; private set; }
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Commands/GetInfo.cs b/NeatoAPI/Commands/GetInfo.cs
index 3f5e92f..e641940 100644
--- a/NeatoAPI/Commands/GetInfo.cs
+++ b/NeatoAPI/Commands/GetInfo.cs
@@ -11,7 +11,7 @@ public class GetInfo
/// Connection to the Neato.
///
private readonly Neato neato;
-
+
///
/// Initializes a new instance of the class.
///
@@ -20,7 +20,7 @@ public class GetInfo
///
public GetInfo(Neato parent)
{
- this.neato = parent;
+ neato = parent;
}
///
@@ -32,7 +32,7 @@ public GetInfo(Neato parent)
///
public Response GetAccel()
{
- return this.neato.Connection.SendCommand("GetAccel");
+ return neato.Connection.SendCommand("GetAccel");
}
///
@@ -42,7 +42,7 @@ public Response GetAccel()
/// Format: SensorName,Value.
public Response GetAnalogSensors()
{
- return this.neato.Connection.SendCommand("GetAnalogSensors");
+ return neato.Connection.SendCommand("GetAnalogSensors");
}
///
@@ -55,7 +55,7 @@ public Response GetAnalogSensors()
///
public Response GetAnalogSensors(AnalogSensorValues flag)
{
- return this.neato.Connection.SendCommand("GetAnalogSensors " + flag);
+ return neato.Connection.SendCommand("GetAnalogSensors " + flag);
}
///
@@ -67,7 +67,7 @@ public Response GetAnalogSensors(AnalogSensorValues flag)
///
public Response GetButtons()
{
- return this.neato.Connection.SendCommand("GetButtons");
+ return neato.Connection.SendCommand("GetButtons");
}
///
@@ -79,7 +79,7 @@ public Response GetButtons()
///
public Response GetCalInfo()
{
- return this.neato.Connection.SendCommand("GetCalInfo");
+ return neato.Connection.SendCommand("GetCalInfo");
}
///
@@ -91,7 +91,7 @@ public Response GetCalInfo()
///
public Response GetCharger()
{
- return this.neato.Connection.SendCommand("GetCharger");
+ return neato.Connection.SendCommand("GetCharger");
}
///
@@ -103,7 +103,7 @@ public Response GetCharger()
///
public Response GetDigitalSensors()
{
- return this.neato.Connection.SendCommand("GetDigitalSensors");
+ return neato.Connection.SendCommand("GetDigitalSensors");
}
///
@@ -115,7 +115,7 @@ public Response GetDigitalSensors()
///
public Response GetErr()
{
- return this.neato.Connection.SendCommand("GetErr");
+ return neato.Connection.SendCommand("GetErr");
}
///
@@ -126,7 +126,7 @@ public Response GetErr()
public void GetErr(ErrorFlag flag)
{
// TODO: Review and decide if useful or need to rewrite.
- this.neato.Connection.SendCommand("GetErr " + flag);
+ neato.Connection.SendCommand("GetErr " + flag);
}
///
@@ -138,7 +138,7 @@ public void GetErr(ErrorFlag flag)
///
public Response GetLDSScan()
{
- return this.neato.Connection.SendCommand("GETLDSSCAN");
+ return neato.Connection.SendCommand("GETLDSSCAN");
}
///
@@ -150,7 +150,7 @@ public Response GetLDSScan()
///
public Response GetMotors()
{
- return this.neato.Connection.SendCommand("GetMotors");
+ return neato.Connection.SendCommand("GetMotors");
}
///
@@ -163,7 +163,7 @@ public Response GetMotors()
///
public Response GetMotors(GetMotorMotor flag)
{
- return this.neato.Connection.SendCommand("GetMotors " + flag);
+ return neato.Connection.SendCommand("GetMotors " + flag);
}
///
@@ -175,7 +175,7 @@ public Response GetMotors(GetMotorMotor flag)
///
public Response GetSchedule()
{
- return this.neato.Connection.SendCommand("GetSchedule");
+ return neato.Connection.SendCommand("GetSchedule");
}
///
@@ -189,8 +189,8 @@ public Response GetSchedule()
public Response GetLifeStatLog()
{
throw new NotImplementedException("Disabled because of odd behaviour...");
-
- // return this.neato.Connection.SendCommand("GetLifeStatLog");
+
+ // return neato.Connection.SendCommand("GetLifeStatLog");
}
///
@@ -204,7 +204,7 @@ public Response GetLifeStatLog()
public Response GetSchedule(ScheduleDay flag)
{
// TODO: Implement. "GetSchedule Day 0" or "GetSchedule 0" ?
- return this.neato.Connection.SendCommand("GetSchedule " + (int)flag);
+ return neato.Connection.SendCommand("GetSchedule " + (int)flag);
}
///
@@ -216,7 +216,7 @@ public Response GetSchedule(ScheduleDay flag)
///
public Response GetSysLog()
{
- return this.neato.Connection.SendCommand("GetSysLog");
+ return neato.Connection.SendCommand("GetSysLog");
}
///
@@ -228,7 +228,7 @@ public Response GetSysLog()
///
public Response GetTime()
{
- return this.neato.Connection.SendCommand("GetTime");
+ return neato.Connection.SendCommand("GetTime");
}
///
@@ -240,7 +240,7 @@ public Response GetTime()
///
public Response GetVersion()
{
- return this.neato.Connection.SendCommand("GetVersion");
+ return neato.Connection.SendCommand("GetVersion");
}
///
@@ -252,7 +252,7 @@ public Response GetVersion()
///
public Response GetWarranty()
{
- return this.neato.Connection.SendCommand("GetWarranty");
+ return neato.Connection.SendCommand("GetWarranty");
}
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Commands/Misc.cs b/NeatoAPI/Commands/Misc.cs
index ba12578..441cd33 100644
--- a/NeatoAPI/Commands/Misc.cs
+++ b/NeatoAPI/Commands/Misc.cs
@@ -11,16 +11,16 @@ public class Misc
private readonly Neato neato;
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
///
/// TODO: Add description.
///
public Misc(Neato parent)
{
- this.neato = parent;
+ neato = parent;
}
-
+
#region Commands
///
@@ -29,7 +29,7 @@ public Misc(Neato parent)
///
public void Clean()
{
- this.neato.Connection.SendCommand("Clean", true);
+ neato.Connection.SendCommand("Clean", true);
}
///
@@ -39,7 +39,7 @@ public void Clean()
/// Clean action to be activated.
public void Clean(CleaningMode flag)
{
- this.neato.Connection.SendCommand("Clean " + flag, true);
+ neato.Connection.SendCommand("Clean " + flag, true);
}
///
@@ -53,14 +53,14 @@ public void PlaySound(Sounds flag)
{
if (flag.Equals(Sounds.Stop))
{
- this.neato.Connection.SendCommand("PlaySound STOP", true);
+ neato.Connection.SendCommand("PlaySound STOP", true);
}
else
{
- this.neato.Connection.SendCommand("PlaySound " + (int)flag, true);
+ neato.Connection.SendCommand("PlaySound " + (int)flag, true);
}
}
- #endregion
+ #endregion Commands
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Commands/Movement.cs b/NeatoAPI/Commands/Movement.cs
index f167d12..5b6054b 100644
--- a/NeatoAPI/Commands/Movement.cs
+++ b/NeatoAPI/Commands/Movement.cs
@@ -30,7 +30,7 @@ public class Movement
///
public Movement(Neato parent)
{
- this.neato = parent;
+ neato = parent;
}
#region Commands
@@ -43,7 +43,7 @@ public Movement(Neato parent)
///
public void LeftRotation(int speed)
{
- this.QuarterRotation(speed, true);
+ QuarterRotation(speed, true);
}
///
@@ -54,7 +54,7 @@ public void LeftRotation(int speed)
///
public void RightRotation(int speed)
{
- this.QuarterRotation(speed, false);
+ QuarterRotation(speed, false);
}
///
@@ -74,7 +74,7 @@ public void TurnAround(int speed, bool reverse)
distance *= -1;
}
- this.neato.Connection.SendCommand("SetMotor RWheelDist " + distance + " LWheelDist " + -distance + " Speed " + speed, true);
+ neato.Connection.SendCommand("SetMotor RWheelDist " + distance + " LWheelDist " + -distance + " Speed " + speed, true);
// Update Neato's angle.
int factor;
@@ -87,7 +87,7 @@ public void TurnAround(int speed, bool reverse)
factor = -1;
}
- this.neato.Angle += 180 * factor;
+ neato.Angle += 180 * factor;
}
///
@@ -96,11 +96,11 @@ public void TurnAround(int speed, bool reverse)
public void Stop()
{
// A somewhat ugly solution. TODO: Investigate if there is a better way.
- this.neato.Command.Test.TestMode(TestModeState.Off);
- this.neato.Command.Test.TestMode(TestModeState.On);
-
+ neato.Command.Test.TestMode(TestModeState.Off);
+ neato.Command.Test.TestMode(TestModeState.On);
+
// This will fuck up any spatial calculations :(
- this.neato.PositionalDataIntegrity = false;
+ neato.PositionalDataIntegrity = false;
}
///
@@ -117,16 +117,16 @@ public void BothWheels(int distance, int speed, bool reverse)
distance *= -1;
}
- this.neato.Connection.SendCommand("SetMotor LWheelDist " + distance + " RWheelDist " + distance + " Speed " + speed, true);
+ neato.Connection.SendCommand("SetMotor LWheelDist " + distance + " RWheelDist " + distance + " Speed " + speed, true);
// Update position (angle should be unchanged)
var movement = new System.Drawing.Point(0, 0)
- {
- X = (int)Math.Round(Math.Cos(this.neato.Angle) * distance),
- Y = (int)Math.Round(Math.Sin(this.neato.Angle) * distance)
- };
- var current = this.neato.Position;
- this.neato.Position = new System.Drawing.Point(movement.X + current.X, movement.Y + current.Y);
+ {
+ X = (int)Math.Round(Math.Cos(neato.Angle) * distance),
+ Y = (int)Math.Round(Math.Sin(neato.Angle) * distance)
+ };
+ var current = neato.Position;
+ neato.Position = new System.Drawing.Point(movement.X + current.X, movement.Y + current.Y);
}
///
@@ -148,7 +148,7 @@ public void LeftWheel(int distance, int speed, bool reverse)
distance *= -1;
}
- this.neato.Connection.SendCommand("SetMotor LWheelDist " + distance + " Speed " + speed, true);
+ neato.Connection.SendCommand("SetMotor LWheelDist " + distance + " Speed " + speed, true);
// Update angle (and position..?)
// TODO: Do the math :(
@@ -173,13 +173,13 @@ public void RightWheel(int distance, int speed, bool reverse)
distance *= -1;
}
- this.neato.Connection.SendCommand("SetMotor RWheelDist " + distance + " Speed " + speed, true);
+ neato.Connection.SendCommand("SetMotor RWheelDist " + distance + " Speed " + speed, true);
// Update angle (and position..?)
// TODO: Do the math :(
}
- #endregion
+ #endregion Commands
#region Private commands (~utility)
@@ -201,7 +201,7 @@ private void QuarterRotation(int speed, bool reverse)
distance *= -1;
}
- this.neato.Connection.SendCommand("SetMotor RWheelDist " + distance + " LWheelDist " + -distance + " Speed " + speed, true);
+ neato.Connection.SendCommand("SetMotor RWheelDist " + distance + " LWheelDist " + -distance + " Speed " + speed, true);
// Update angle (TODO: Figure out if position changes noticeable...)
int factor;
@@ -214,9 +214,9 @@ private void QuarterRotation(int speed, bool reverse)
factor = -1;
}
- this.neato.Angle += factor * 90;
+ neato.Angle += factor * 90;
}
- #endregion
+ #endregion Private commands (~utility)
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Commands/Schedule.cs b/NeatoAPI/Commands/Schedule.cs
index a8c354e..e3db93f 100644
--- a/NeatoAPI/Commands/Schedule.cs
+++ b/NeatoAPI/Commands/Schedule.cs
@@ -13,14 +13,14 @@ public class Schedule
private readonly Neato neato;
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
///
/// TODO: Add description.
///
public Schedule(Neato parent)
{
- this.neato = parent;
+ neato = parent;
}
#region Commands
@@ -31,7 +31,7 @@ public Schedule(Neato parent)
/// True for enabled, false for disabled.
public void ToggleSchedule(bool activated)
{
- this.neato.Connection.SendCommand(activated ? "SetSchedule ON" : "SetSchedule OFF", true);
+ neato.Connection.SendCommand(activated ? "SetSchedule ON" : "SetSchedule OFF", true);
}
///
@@ -40,7 +40,7 @@ public void ToggleSchedule(bool activated)
/// Day to clear cleaning from.
public void RemoveCleanSchedule(ScheduleDay day)
{
- this.neato.Connection.SendCommand("SetSchedule " + day + " 0 0 NONE");
+ neato.Connection.SendCommand("SetSchedule " + day + " 0 0 NONE");
}
///
@@ -65,9 +65,9 @@ public Response SetSchedule(ScheduleDay day, int hour, int minute)
throw new ArgumentOutOfRangeException("minute", minute, "Minutes set must be within range 0..59.");
}
- return this.neato.Connection.SendCommand("SetSchedule " + day + " " + hour + " " + minute + "HOUSE");
+ return neato.Connection.SendCommand("SetSchedule " + day + " " + hour + " " + minute + "HOUSE");
}
- #endregion
+ #endregion Commands
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Commands/Sys.cs b/NeatoAPI/Commands/Sys.cs
index 305b6cd..c1e7664 100644
--- a/NeatoAPI/Commands/Sys.cs
+++ b/NeatoAPI/Commands/Sys.cs
@@ -13,14 +13,14 @@ public class Sys
private readonly Neato neato;
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
///
/// TODO: Add description.
///
public Sys(Neato parent)
{
- this.neato = parent;
+ neato = parent;
}
#region Commands
@@ -31,7 +31,7 @@ public Sys(Neato parent)
///
public void RestoreDefaults()
{
- this.neato.Connection.SendCommand("RestoreDefaults", true);
+ neato.Connection.SendCommand("RestoreDefaults", true);
}
///
@@ -46,7 +46,7 @@ public void SetFuelGauge(int percent)
throw new ArgumentOutOfRangeException("percent", percent, "Fuel gauge percent must be within range 0..100.");
}
- this.neato.Connection.SendCommand("SetFuelGauge " + percent, true);
+ neato.Connection.SendCommand("SetFuelGauge " + percent, true);
}
///
@@ -73,8 +73,8 @@ public void SetTime(ScheduleDay day, int hour, int minute, int sec)
{
throw new ArgumentOutOfRangeException("sec", sec, "Seconds set must be within range 0..59.");
}
-
- this.neato.Connection.SendCommand("SetTime " + (int)day + " " + hour + " " + minute + " " + sec, true);
+
+ neato.Connection.SendCommand("SetTime " + (int)day + " " + hour + " " + minute + " " + sec, true);
}
///
@@ -85,7 +85,7 @@ public void SyncTime()
var now = DateTime.Now;
var day = (ScheduleDay)now.DayOfWeek;
- this.SetTime(day, now.Hour, now.Minute, now.Second);
+ SetTime(day, now.Hour, now.Minute, now.Second);
}
///
@@ -97,10 +97,10 @@ public void SyncTime()
///
public void SetWallFollower(WallFollowerState state)
{
- this.neato.Connection.SendCommand("SetWallFollower " + state, true);
+ neato.Connection.SendCommand("SetWallFollower " + state, true);
}
- #endregion
+ #endregion Commands
#region Unimplemented commands
@@ -128,6 +128,6 @@ public void Upload()
throw new NotImplementedException("Won't implement until I know what it does, could break stuff?");
}
- #endregion
+ #endregion Unimplemented commands
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Commands/Test.cs b/NeatoAPI/Commands/Test.cs
index 2ca0cd2..d7d31fb 100644
--- a/NeatoAPI/Commands/Test.cs
+++ b/NeatoAPI/Commands/Test.cs
@@ -20,7 +20,7 @@ public class Test
///
public Test(Neato parent)
{
- this.neato = parent;
+ neato = parent;
}
#region Commands
@@ -34,14 +34,14 @@ public void TestMode(TestModeState flag)
{
if (flag == TestModeState.On)
{
- this.neato.TestMode = true;
+ neato.TestMode = true;
}
else
{
- this.neato.TestMode = false;
+ neato.TestMode = false;
}
- this.neato.Connection.SendCommand("TESTMODE " + flag, true);
+ neato.Connection.SendCommand("TESTMODE " + flag, true);
}
///
@@ -50,11 +50,11 @@ public void TestMode(TestModeState flag)
///
public void DiagTest()
{
- if (!this.neato.TestMode)
+ if (!neato.TestMode)
{
throw new NotInTestModeException("DiagTest");
}
-
+
// TODO: Implement. NOTE: Has a million flags in funny combinations, read up!
throw new NotImplementedException();
}
@@ -65,11 +65,11 @@ public void DiagTest()
///
public void SetLCD()
{
- if (!this.neato.TestMode)
+ if (!neato.TestMode)
{
throw new NotInTestModeException("SetLCD");
}
-
+
// TODO: Implement. Note: Has a million flags, read up!
throw new NotImplementedException();
}
@@ -81,15 +81,15 @@ public void SetLCD()
/// TODO: describe state
public void SetLDSRotation(LDSRotation flag)
{
- if (!this.neato.TestMode)
+ if (!neato.TestMode)
{
throw new NotInTestModeException("SetLDSRotation");
}
- this.neato.Connection.SendCommand("SetLDSRotation " + flag);
-
+ neato.Connection.SendCommand("SetLDSRotation " + flag);
+
// Update Neato status!
- this.neato.LDSRotation = flag == LDSRotation.On;
+ neato.LDSRotation = flag == LDSRotation.On;
}
///
@@ -98,7 +98,7 @@ public void SetLDSRotation(LDSRotation flag)
///
public void SetLED()
{
- if (!this.neato.TestMode)
+ if (!neato.TestMode)
{
throw new NotInTestModeException("SetLED");
}
@@ -113,7 +113,7 @@ public void SetLED()
///
public void SetMotor()
{
- if (!this.neato.TestMode)
+ if (!neato.TestMode)
{
throw new NotInTestModeException("SetMotor");
}
@@ -129,12 +129,12 @@ public void SetMotor()
/// TODO: Describe parameter.
public void SetSystemMode(SystemMode mode)
{
- if (!this.neato.TestMode)
+ if (!neato.TestMode)
{
throw new NotInTestModeException("SetSystemMode");
}
- this.neato.Connection.SendCommand("SetSystemMode " + mode);
+ neato.Connection.SendCommand("SetSystemMode " + mode);
}
///
@@ -144,7 +144,7 @@ public void SetSystemMode(SystemMode mode)
/// True to enable, false to disable specified motor.
public void ToggleMotor(Motors motor, bool enable)
{
- if (!this.neato.TestMode)
+ if (!neato.TestMode)
{
throw new NotInTestModeException("ToggleMotor : SetMotor");
}
@@ -154,19 +154,21 @@ public void ToggleMotor(Motors motor, bool enable)
{
case Motors.Brush:
parameters = enable ? "BrushEnable" : "BrushDisable";
- this.neato.MotorBrushEnabled = enable;
+ neato.MotorBrushEnabled = enable;
break;
+
case Motors.LeftWheel:
parameters = enable ? "LWheelEnable" : "LWheelDisable";
- this.neato.MotorLWheelEnabled = enable;
+ neato.MotorLWheelEnabled = enable;
break;
+
case Motors.RightWheel:
parameters = enable ? "RWheelEnable" : "RWheelDisable";
- this.neato.MotorRWheelEnabled = enable;
+ neato.MotorRWheelEnabled = enable;
break;
}
- this.neato.Connection.SendCommand("SetMotor " + parameters, true);
+ neato.Connection.SendCommand("SetMotor " + parameters, true);
}
///
@@ -178,16 +180,16 @@ public void ToggleVacuum(bool enable, int powerlevel)
{
if (enable)
{
- this.neato.Connection.SendCommand("SetMotor VacuumOn VacuumSpeed " + powerlevel, true);
- this.neato.MotorVacuumEnabled = true;
+ neato.Connection.SendCommand("SetMotor VacuumOn VacuumSpeed " + powerlevel, true);
+ neato.MotorVacuumEnabled = true;
}
else
{
- this.neato.Connection.SendCommand("SetMotor VacuumOff", true);
- this.neato.MotorVacuumEnabled = false;
+ neato.Connection.SendCommand("SetMotor VacuumOff", true);
+ neato.MotorVacuumEnabled = false;
}
}
- #endregion
+ #endregion Commands
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Connection.cs b/NeatoAPI/Connection.cs
index cec964c..76ce1a9 100644
--- a/NeatoAPI/Connection.cs
+++ b/NeatoAPI/Connection.cs
@@ -19,7 +19,7 @@ public class Connection
/// The SerialPort object used to communicate with the Neato.
///
private readonly SerialPort neatoPort;
-
+
///
/// Initializes a new instance of the class.
///
@@ -29,14 +29,14 @@ public Connection(string comPort)
{
// Values are irrelevant, quote from Programmers guide:
// "The communication parameters (Baud, start/stop bits,parity, etc.) are unimportant. They apply only to a real com port."
- this.neatoPort = new SerialPort(comPort, 4711, Parity.None, 7, StopBits.One) { ReadTimeout = 500, WriteTimeout = 500 };
- this.Port = comPort;
+ neatoPort = new SerialPort(comPort, 4711, Parity.None, 7, StopBits.One) { ReadTimeout = 500, WriteTimeout = 500 };
+ Port = comPort;
// Connect to the COM-port.
- this.neatoPort.Open();
+ neatoPort.Open();
// Let's find out if we're connected to a Neato...
- if (!this.SendCommand("GetVersion").GetRaw().Contains("Component,Major,Minor,Build"))
+ if (!SendCommand("GetVersion").GetRaw().Contains("Component,Major,Minor,Build"))
{
throw new NotANeatoException("Response to GetVersion does not contain headers \"Component,Major,Minor,Build\".");
}
@@ -51,13 +51,13 @@ public Connection(string comPort)
/// If device does not respond to the GetVersion command, it's probably not a Neato.
public Connection(SerialPort comPort)
{
- this.neatoPort = comPort;
-
+ neatoPort = comPort;
+
// Connect to the COM-port.
- this.neatoPort.Open();
+ neatoPort.Open();
// Let's find out if we're connected to a Neato...
- if (!this.SendCommand("GetVersion").GetRaw().Contains("Component,Major,Minor,Build"))
+ if (!SendCommand("GetVersion").GetRaw().Contains("Component,Major,Minor,Build"))
{
throw new NotANeatoException("Response to GetVersion does not contain headers \"Component,Major,Minor,Build\".");
}
@@ -74,26 +74,26 @@ public Connection(SerialPort comPort)
/// True if connected to the Neato, false if not.
public bool IsConnected()
{
- if (this.neatoPort == null)
+ if (neatoPort == null)
{
return false;
}
- return this.neatoPort.IsOpen;
+ return neatoPort.IsOpen;
}
-
+
///
/// Disconnects from Neato.
///
public void Disconnect()
{
- if (this.neatoPort == null)
+ if (neatoPort == null)
{
// Don't have to close something that doesn't exist...
return;
}
-
- this.neatoPort.Close();
+
+ neatoPort.Close();
}
///
@@ -104,9 +104,9 @@ public void Disconnect()
/// Thrown if no connection to Neato has been established.
public Response SendCommand(string command)
{
- return this.SendCommand(command, false);
+ return SendCommand(command, false);
}
-
+
///
/// Sends a command to the Neato. Waiting for a response will delay this call by roughly 150 milliseconds.
///
@@ -117,16 +117,16 @@ public Response SendCommand(string command)
/// Thrown if command sent is unknown to Neato.
public Response SendCommand(string command, bool quick)
{
- if (!this.IsConnected())
+ if (!IsConnected())
{
throw new IOException("No connection to Neato established.");
}
// Empty anything lingering in the buffer.
- this.neatoPort.DiscardInBuffer();
+ neatoPort.DiscardInBuffer();
// Send command to Neato.
- this.neatoPort.WriteLine(command);
+ neatoPort.WriteLine(command);
if (quick)
{
@@ -136,7 +136,7 @@ public Response SendCommand(string command, bool quick)
// Wait a little bit for Neato's response.
Thread.Sleep(ResponseWait);
- string tmp = this.neatoPort.ReadExisting();
+ string tmp = neatoPort.ReadExisting();
// TODO: REMOVE THIS
@@ -144,13 +144,13 @@ public Response SendCommand(string command, bool quick)
File.AppendAllText("output.txt", "|*|");
// TODO: REMOVE THIS
-
+
if (tmp.Length == 0)
{
// No response received from command.
return new Response(string.Empty);
}
-
+
// Cut off first line, contains command sent.
tmp = tmp.Substring(tmp.IndexOf('\n'));
@@ -166,8 +166,8 @@ public Response SendCommand(string command, bool quick)
{
throw new ArgumentException(tmp);
}
-
+
return new Response(tmp);
}
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Enumerators.cs b/NeatoAPI/Enumerators.cs
index cff7ca6..009458f 100644
--- a/NeatoAPI/Enumerators.cs
+++ b/NeatoAPI/Enumerators.cs
@@ -122,7 +122,7 @@ public enum Motors
}
///
- /// Parameters available when using PlaySound command.
+ /// Parameters available when using PlaySound command.
///
public enum Sounds
{
@@ -330,4 +330,4 @@ public enum WallFollowerState
///
Disable
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Exceptions.cs b/NeatoAPI/Exceptions.cs
index ae1c30a..bc2382b 100644
--- a/NeatoAPI/Exceptions.cs
+++ b/NeatoAPI/Exceptions.cs
@@ -37,4 +37,4 @@ public NotInTestModeException(string additionalInformation)
{
}
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/Neato.cs b/NeatoAPI/Neato.cs
index 2b03e50..d9e531d 100644
--- a/NeatoAPI/Neato.cs
+++ b/NeatoAPI/Neato.cs
@@ -1,7 +1,6 @@
namespace NeatoAPI
{
using System.Drawing;
- using System.Globalization;
using System.IO;
using System.Text;
@@ -26,28 +25,28 @@ public Neato()
}
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
/// COM port used to connect to Neato.
public Neato(string neatoPort)
{
- this.Connection = new Connection(neatoPort);
- this.Command = new Command(this);
- this.SetDefaults();
+ Connection = new Connection(neatoPort);
+ Command = new Command(this);
+ SetDefaults();
}
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
/// Port to use when connecting to Neato.
public Neato(System.IO.Ports.SerialPort neatoPort)
{
- this.Connection = new Connection(neatoPort);
- this.Command = new Command(this);
- this.SetDefaults();
+ Connection = new Connection(neatoPort);
+ Command = new Command(this);
+ SetDefaults();
}
- #endregion
+ #endregion Constructors
#region Defining variables
@@ -60,7 +59,7 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
/// Gets or sets the Command object, which allows access to Neato commands.
///
public Command Command { get; set; }
-
+
#region Motors
#region Motors enabled/disabled
@@ -69,23 +68,23 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
/// Gets or sets a value indicating whether or not this Neato's brush motor is enabled or not.
///
public bool MotorBrushEnabled { get; set; }
-
+
///
/// Gets or sets a value indicating whether or not this Neato's vacuum motor is enabled or not.
///
public bool MotorVacuumEnabled { get; set; }
-
+
///
/// Gets or sets a value indicating whether or not this Neato's left wheel motor is enabled or not.
///
public bool MotorLWheelEnabled { get; set; }
-
+
///
/// Gets or sets a value indicating whether or not this Neato's right wheel motor is enabled or not.
///
public bool MotorRWheelEnabled { get; set; }
- #endregion
+ #endregion Motors enabled/disabled
#region GetMotor values
@@ -116,7 +115,7 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
///
public int BrushRPM { get; private set; }
- #endregion
+ #endregion Brush
#region Vacuum
@@ -145,7 +144,7 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
///
public int VacuumRPM { get; private set; }
- #endregion
+ #endregion Vacuum
#region Left Wheel
@@ -179,7 +178,7 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
///
public int LeftWheelRPM { get; private set; }
- #endregion
+ #endregion Left Wheel
#region Right Wheel
@@ -212,8 +211,8 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
/// Gets the right wheel rpm.
///
public int RightWheelRPM { get; private set; }
-
- #endregion
+
+ #endregion Right Wheel
#region Laser
@@ -242,7 +241,7 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
///
public int LaserRPM { get; private set; }
- #endregion
+ #endregion Laser
#region Charger
@@ -261,11 +260,11 @@ public Neato(System.IO.Ports.SerialPort neatoPort)
///
public int ChargerMilliAmpereHours { get; private set; }
- #endregion
+ #endregion Charger
- #endregion
+ #endregion GetMotor values
- #endregion
+ #endregion Motors
#region Misc
@@ -289,8 +288,8 @@ public bool IsConnected
/// Gets or sets a value indicating whether LDS is rotating or not.
///
public bool LDSRotation { get; set; }
-
- #endregion
+
+ #endregion Misc
#region Spatial information
@@ -301,12 +300,12 @@ public int Angle
{
get
{
- return this.angle;
+ return angle;
}
set
{
- this.angle = value % 360;
+ angle = value % 360;
}
}
@@ -320,7 +319,7 @@ public int Angle
///
public bool PositionalDataIntegrity { get; set; }
- #endregion
+ #endregion Spatial information
#region Battery & Power information
@@ -339,7 +338,7 @@ public int Angle
///
public bool ExternalPowerPresent { get; private set; }
- #endregion
+ #endregion Battery & Power information
#region Digital Sensors
@@ -347,7 +346,7 @@ public int Angle
/// Gets a value indicating whether DC jack is connected.
///
public bool IsDCJackConnected { get; private set; }
-
+
///
/// Gets a value indicating whether is dustbin present.
///
@@ -383,7 +382,7 @@ public int Angle
///
public bool IsRightSideBlocked { get; private set; }
- #endregion
+ #endregion Digital Sensors
#region Version info
@@ -497,7 +496,7 @@ public int Angle
///
public string UIPanelRevision { get; private set; }
- #endregion
+ #endregion Version info
#region Accelerometer information
@@ -531,9 +530,9 @@ public int Angle
///
public float SumInG { get; private set; }
- #endregion
+ #endregion Accelerometer information
- #endregion
+ #endregion Defining variables
///
/// Attempts to connect to a Neato on any serial port.
@@ -566,9 +565,9 @@ public bool ConnectToNeato()
if (result != null)
{
- this.Connection = result;
- this.SetDefaults();
- this.Command = new Command(this);
+ Connection = result;
+ SetDefaults();
+ Command = new Command(this);
return true;
}
}
@@ -582,16 +581,16 @@ public bool ConnectToNeato()
///
public void RefreshInformation()
{
- if (!this.IsConnected)
+ if (!IsConnected)
{
throw new IOException("Not connected to a Neato!");
}
- this.UpdateChargerInfo();
- this.UpdateDigitalSensor();
- this.UpdateVersionInfo();
- this.UpdateAccelerometer();
- this.UpdateGetMotors();
+ UpdateChargerInfo();
+ UpdateDigitalSensor();
+ UpdateVersionInfo();
+ UpdateAccelerometer();
+ UpdateGetMotors();
}
///
@@ -602,7 +601,7 @@ public override string ToString()
{
var res = new StringBuilder();
- if (!this.IsConnected)
+ if (!IsConnected)
{
res.AppendLine("Neato State - Not connected.");
}
@@ -611,29 +610,29 @@ public override string ToString()
res.AppendLine("Neato State - Connected on \"" + Connection.Port + "\".");
res.AppendLine();
res.AppendLine("* Motors *");
- res.AppendLine("Motor - Brush: " + this.MotorBrushEnabled);
- res.AppendLine("Motor - Vacuum: " + this.MotorVacuumEnabled);
- res.AppendLine("Motor - Left Wheel: " + this.MotorLWheelEnabled);
- res.AppendLine("Motor - Right Wheel: " + this.MotorRWheelEnabled);
+ res.AppendLine("Motor - Brush: " + MotorBrushEnabled);
+ res.AppendLine("Motor - Vacuum: " + MotorVacuumEnabled);
+ res.AppendLine("Motor - Left Wheel: " + MotorLWheelEnabled);
+ res.AppendLine("Motor - Right Wheel: " + MotorRWheelEnabled);
res.AppendLine();
res.AppendLine("* Modes *");
- res.AppendLine("Test Mode: " + this.TestMode);
- res.AppendLine("LDS rotation: " + this.LDSRotation);
+ res.AppendLine("Test Mode: " + TestMode);
+ res.AppendLine("LDS rotation: " + LDSRotation);
res.AppendLine();
res.AppendLine("* Positional data *");
- res.AppendLine("Positional data integrity: " + this.PositionalDataIntegrity);
- res.AppendLine("Position: (" + this.Position.X + "," + this.Position.Y + ")");
- res.AppendLine("Angle: " + this.angle + "°");
+ res.AppendLine("Positional data integrity: " + PositionalDataIntegrity);
+ res.AppendLine("Position: (" + Position.X + "," + Position.Y + ")");
+ res.AppendLine("Angle: " + angle + "°");
res.AppendLine();
res.AppendLine("* Digital Sensors *");
- res.AppendLine("DC Jack connected: " + this.IsDCJackConnected);
- res.AppendLine("Dustbin present: " + this.IsDustbinPresent);
- res.AppendLine("Left wheel extended: " + this.IsLeftWheelExtended);
- res.AppendLine("Right wheel extended: " + this.IsRightWheelExtended);
- res.AppendLine("Blocked: Left front bumper: " + this.IsFrontLeftBumperBlocked);
- res.AppendLine("Blocked: Right front bumper: " + this.IsFrontRightBumperBlocked);
- res.AppendLine("Blocked: Left side: " + this.IsLeftSideBlocked);
- res.AppendLine("Blocked: Right side: " + this.IsRightSideBlocked);
+ res.AppendLine("DC Jack connected: " + IsDCJackConnected);
+ res.AppendLine("Dustbin present: " + IsDustbinPresent);
+ res.AppendLine("Left wheel extended: " + IsLeftWheelExtended);
+ res.AppendLine("Right wheel extended: " + IsRightWheelExtended);
+ res.AppendLine("Blocked: Left front bumper: " + IsFrontLeftBumperBlocked);
+ res.AppendLine("Blocked: Right front bumper: " + IsFrontRightBumperBlocked);
+ res.AppendLine("Blocked: Left side: " + IsLeftSideBlocked);
+ res.AppendLine("Blocked: Right side: " + IsRightSideBlocked);
}
// TODO: Implement a proper ToString() for this class.
@@ -646,34 +645,34 @@ public override string ToString()
private void SetDefaults()
{
// Default values for motors:
- this.MotorBrushEnabled = false;
- this.MotorVacuumEnabled = false;
- this.MotorLWheelEnabled = true;
- this.MotorRWheelEnabled = true;
+ MotorBrushEnabled = false;
+ MotorVacuumEnabled = false;
+ MotorLWheelEnabled = true;
+ MotorRWheelEnabled = true;
// Default values for modes:
- this.TestMode = false;
- this.LDSRotation = false;
+ TestMode = false;
+ LDSRotation = false;
// Default values for spatial info:
- this.PositionalDataIntegrity = true;
- this.Angle = 0;
- this.Position = Point.Empty;
+ PositionalDataIntegrity = true;
+ Angle = 0;
+ Position = Point.Empty;
// Default values for battery & power:
- this.BatteryCharge = -1;
- this.IsCharging = false;
- this.ExternalPowerPresent = false;
+ BatteryCharge = -1;
+ IsCharging = false;
+ ExternalPowerPresent = false;
// Digital sensors:
- this.IsDCJackConnected = false;
- this.IsDustbinPresent = true;
- this.IsLeftWheelExtended = false;
- this.IsRightWheelExtended = false;
- this.IsLeftSideBlocked = false;
- this.IsRightSideBlocked = false;
- this.IsFrontLeftBumperBlocked = false;
- this.IsFrontRightBumperBlocked = false;
+ IsDCJackConnected = false;
+ IsDustbinPresent = true;
+ IsLeftWheelExtended = false;
+ IsRightWheelExtended = false;
+ IsLeftSideBlocked = false;
+ IsRightSideBlocked = false;
+ IsFrontLeftBumperBlocked = false;
+ IsFrontRightBumperBlocked = false;
}
#region Internal refresh functions
@@ -686,16 +685,16 @@ private void SetDefaults()
///
private void UpdateChargerInfo()
{
- if (!this.IsConnected)
+ if (!IsConnected)
{
throw new IOException("Not connected to a Neato!");
}
- var info = this.Command.GetInfo.GetCharger();
+ var info = Command.GetInfo.GetCharger();
- this.BatteryCharge = int.Parse(info.GetLine("FuelPercent")[0]);
- this.IsCharging = info.GetLine("ChargingActive")[0] == "1";
- this.ExternalPowerPresent = info.GetLine("ExtPwrPresent")[0] == "1";
+ BatteryCharge = int.TryParse(info.GetValueAt("FuelPercent", 0), out int intOutParameter) ? intOutParameter : 0;
+ IsCharging = info.GetValueAt("ChargingActive", 0) == "1";
+ ExternalPowerPresent = info.GetValueAt("ExtPwrPresent", 0) == "1";
}
///
@@ -706,21 +705,21 @@ private void UpdateChargerInfo()
///
private void UpdateDigitalSensor()
{
- if (!this.IsConnected)
+ if (!IsConnected)
{
throw new IOException("Not connected to a Neato!");
}
- var info = this.Command.GetInfo.GetDigitalSensors();
+ var info = Command.GetInfo.GetDigitalSensors();
- this.IsDCJackConnected = info.GetLine("SNSR_DC_JACK_CONNECT")[0] == "1";
- this.IsDustbinPresent = info.GetLine("SNSR_DUSTBIN_IS_IN")[0] == "1";
- this.IsLeftWheelExtended = info.GetLine("SNSR_LEFT_WHEEL_EXTENDED")[0] == "1";
- this.IsRightWheelExtended = info.GetLine("SNSR_RIGHT_WHEEL_EXTENDED")[0] == "1";
- this.IsLeftSideBlocked = info.GetLine("LSIDEBIT")[0] == "1";
- this.IsRightSideBlocked = info.GetLine("RSIDEBIT")[0] == "1";
- this.IsFrontLeftBumperBlocked = info.GetLine("LFRONTBIT")[0] == "1";
- this.IsFrontRightBumperBlocked = info.GetLine("RFRONTBIT")[0] == "1";
+ IsDCJackConnected = info.GetValueAt("SNSR_DC_JACK_CONNECT", 0) == "1";
+ IsDustbinPresent = info.GetValueAt("SNSR_DUSTBIN_IS_IN", 0) == "1";
+ IsLeftWheelExtended = info.GetValueAt("SNSR_LEFT_WHEEL_EXTENDED", 0) == "1";
+ IsRightWheelExtended = info.GetValueAt("SNSR_RIGHT_WHEEL_EXTENDED", 0) == "1";
+ IsLeftSideBlocked = info.GetValueAt("LSIDEBIT", 0) == "1";
+ IsRightSideBlocked = info.GetValueAt("RSIDEBIT", 0) == "1";
+ IsFrontLeftBumperBlocked = info.GetValueAt("LFRONTBIT", 0) == "1";
+ IsFrontRightBumperBlocked = info.GetValueAt("RFRONTBIT", 0) == "1";
}
///
@@ -731,35 +730,35 @@ private void UpdateDigitalSensor()
///
private void UpdateVersionInfo()
{
- if (!this.IsConnected)
+ if (!IsConnected)
{
throw new IOException("Not connected to a Neato!");
}
- var info = this.Command.GetInfo.GetVersion();
-
- this.ModelID = info.GetLine("ModelID")[1];
- this.ConfigID = info.GetLine("ConfigID")[0];
- this.SerialNumber = info.GetLine("Serial Number")[0] + '-' + info.GetLine("Serial Number")[1] + '-' + info.GetLine("Serial Number")[2];
- this.SoftwareVersion = info.GetLine("Software")[0] + '.' + info.GetLine("Software")[1] + '.' + info.GetLine("Software")[2];
- this.BatteryType = info.GetLine("BatteryType")[1];
- this.BlowerType = info.GetLine("BlowerType")[1];
- this.BrushSpeed = int.Parse(info.GetLine("BrushSpeed")[0]);
- this.BrushMotorType = info.GetLine("BrushMotorType")[1];
- this.SideBrushType = info.GetLine("SideBrushType")[1];
- this.WheelPodType = info.GetLine("WheelPodType")[1];
- this.DropSensorType = info.GetLine("DropSensorType")[1];
- this.MagSensorType = info.GetLine("MagSensorType")[1];
- this.WallSensorType = info.GetLine("WallSensorType")[1];
- this.Locale = info.GetLine("Locale")[1];
- this.LDSSoftwareVersion = info.GetLine("LDS Software")[0];
- this.LDSSerial = info.GetLine("LDS Serial")[0];
- this.LDSCPU = info.GetLine("LDS CPU")[0];
- this.MainboardVendorID = info.GetLine("MainBoard Vendor ID")[0];
- this.MainboardSerialNumber = info.GetLine("MainBoard Serial Number")[0];
- this.MainboardVersion = info.GetLine("MainBoard Version")[0] + '.' + info.GetLine("MainBoard Version")[1];
- this.ChassisRevision = info.GetLine("ChassisRev")[0];
- this.UIPanelRevision = info.GetLine("UIPanelRev")[0];
+ var info = Command.GetInfo.GetVersion();
+
+ ModelID = info.GetValueAt("ModelID", 1);
+ ConfigID = info.GetValueAt("ConfigID", 0);
+ SerialNumber = info.GetValueAt("Serial Number", 0) + '-' + info.GetValueAt("Serial Number", 1) + '-' + info.GetValueAt("Serial Number", 2);
+ SoftwareVersion = info.GetValueAt("Software", 0) + '.' + info.GetValueAt("Software", 1) + '.' + info.GetValueAt("Software", 2);
+ BatteryType = info.GetValueAt("BatteryType", 1);
+ BlowerType = info.GetValueAt("BlowerType", 1);
+ BrushSpeed = int.TryParse(info.GetValueAt("BrushSpeed", 0), out int intOutParameter) ? intOutParameter : 0;
+ BrushMotorType = info.GetValueAt("BrushMotorType", 1);
+ SideBrushType = info.GetValueAt("SideBrushType", 1);
+ WheelPodType = info.GetValueAt("WheelPodType", 1);
+ DropSensorType = info.GetValueAt("DropSensorType", 1);
+ MagSensorType = info.GetValueAt("MagSensorType", 1);
+ WallSensorType = info.GetValueAt("WallSensorType", 1);
+ Locale = info.GetValueAt("Locale", 1);
+ LDSSoftwareVersion = info.GetValueAt("LDS Software", 0);
+ LDSSerial = info.GetValueAt("LDS Serial", 0);
+ LDSCPU = info.GetValueAt("LDS CPU", 0);
+ MainboardVendorID = info.GetValueAt("MainBoard Vendor ID", 0);
+ MainboardSerialNumber = info.GetValueAt("MainBoard Serial Number", 0);
+ MainboardVersion = info.GetValueAt("MainBoard Version", 0) + '.' + info.GetValueAt("MainBoard Version", 1);
+ ChassisRevision = info.GetValueAt("ChassisRev", 0);
+ UIPanelRevision = info.GetValueAt("UIPanelRev", 0);
}
///
@@ -770,19 +769,19 @@ private void UpdateVersionInfo()
///
private void UpdateAccelerometer()
{
- if (!this.IsConnected)
+ if (!IsConnected)
{
throw new IOException("Not connected to a Neato!");
}
- var info = this.Command.GetInfo.GetAccel();
+ var info = Command.GetInfo.GetAccel();
- this.PitchInDegrees = float.Parse(info.GetLine("PitchInDegrees")[0], CultureInfo.GetCultureInfo(0x0409));
- this.RollInDegrees = float.Parse(info.GetLine("RollInDegrees")[0], CultureInfo.GetCultureInfo(0x0409));
- this.XInG = float.Parse(info.GetLine("XInG")[0], CultureInfo.GetCultureInfo(0x0409));
- this.YInG = float.Parse(info.GetLine("YInG")[0], CultureInfo.GetCultureInfo(0x0409));
- this.ZInG = float.Parse(info.GetLine("ZInG")[0], CultureInfo.GetCultureInfo(0x0409));
- this.SumInG = float.Parse(info.GetLine("SumInG")[0], CultureInfo.GetCultureInfo(0x0409));
+ this.PitchInDegrees = float.TryParse(info.GetValueAt("PitchInDegrees", 0), out float PitchInDegrees) ? PitchInDegrees : 0;
+ this.RollInDegrees = float.TryParse(info.GetValueAt("RollInDegrees", 0), out float RollInDegrees) ? RollInDegrees : 0;
+ this.XInG = float.TryParse(info.GetValueAt("XInG", 0), out float XInG) ? XInG : 0;
+ this.YInG = float.TryParse(info.GetValueAt("YInG", 0), out float YInG) ? YInG : 0;
+ this.ZInG = float.TryParse(info.GetValueAt("ZInG", 0), out float ZInG) ? ZInG : 0;
+ this.SumInG = float.TryParse(info.GetValueAt("SumInG", 0), out float SumInG) ? SumInG : 0;
}
///
@@ -793,50 +792,50 @@ private void UpdateAccelerometer()
///
private void UpdateGetMotors()
{
- if (!this.IsConnected)
+ if (!IsConnected)
{
throw new IOException("Not connected to a Neato!");
}
- var info = this.Command.GetInfo.GetMotors();
-
- this.BrushMaxPWM = int.Parse(info.GetLine("Brush_MaxPWM")[0]);
- this.BrushPWM = int.Parse(info.GetLine("Brush_PWM")[0]);
- this.BrushMilliVolts = int.Parse(info.GetLine("Brush_mVolts")[0]);
- this.BrushEncoder = int.Parse(info.GetLine("Brush_Encoder")[0]);
- this.BrushRPM = int.Parse(info.GetLine("Brush_RPM")[0]);
-
- this.VacuumMaxPWM = int.Parse(info.GetLine("Vacuum_MaxPWM")[0]);
- this.VacuumPWM = int.Parse(info.GetLine("Vacuum_PWM")[0]);
- this.VacuumCurrentInMilliAmpere = int.Parse(info.GetLine("Vacuum_CurrentInMA")[0]);
- this.VacuumEncoder = int.Parse(info.GetLine("Vacuum_Encoder")[0]);
- this.VacuumRPM = int.Parse(info.GetLine("Vacuum_RPM")[0]);
-
- this.LeftWheelMaxPWM = int.Parse(info.GetLine("LeftWheel_MaxPWM")[0]);
- this.LeftWheelPWM = int.Parse(info.GetLine("LeftWheel_PWM")[0]);
- this.LeftWheelMilliVolts = int.Parse(info.GetLine("LeftWheel_mVolts")[0]);
- this.LeftWheelEncoder = int.Parse(info.GetLine("LeftWheel_Encoder")[0]);
- this.LeftWheelPositionInMM = int.Parse(info.GetLine("LeftWheel_PositionInMM")[0]);
- this.LeftWheelRPM = int.Parse(info.GetLine("LeftWheel_RPM")[0]);
-
- this.RightWheelMaxPWM = int.Parse(info.GetLine("RightWheel_MaxPWM")[0]);
- this.RightWheelPWM = int.Parse(info.GetLine("RightWheel_PWM")[0]);
- this.RightWheelMilliVolts = int.Parse(info.GetLine("RightWheel_mVolts")[0]);
- this.RightWheelEncoder = int.Parse(info.GetLine("RightWheel_Encoder")[0]);
- this.RightWheelPositionInMM = int.Parse(info.GetLine("RightWheel_PositionInMM")[0]);
- this.RightWheelRPM = int.Parse(info.GetLine("RightWheel_RPM")[0]);
-
- this.LaserMaxPWM = int.Parse(info.GetLine("Laser_MaxPWM")[0]);
- this.LaserPWM = int.Parse(info.GetLine("Laser_PWM")[0]);
- this.LaserMilliVolts = int.Parse(info.GetLine("Laser_mVolts")[0]);
- this.LaserEncoder = int.Parse(info.GetLine("Laser_Encoder")[0]);
- this.LaserRPM = int.Parse(info.GetLine("Laser_RPM")[0]);
-
- this.ChargerMaxPWM = int.Parse(info.GetLine("Charger_MaxPWM")[0]);
- this.ChargerPWM = int.Parse(info.GetLine("Charger_PWM")[0]);
- this.ChargerMilliAmpereHours = int.Parse(info.GetLine("Charger_mAH")[0]);
+ var info = Command.GetInfo.GetMotors();
+
+ this.BrushMaxPWM = int.TryParse(info.GetValueAt("Brush_MaxPWM", 0), out int BrushMaxPWM) ? BrushMaxPWM : 0;
+ this.BrushPWM = int.TryParse(info.GetValueAt("Brush_PWM", 0), out int BrushPWM) ? BrushPWM : 0;
+ this.BrushMilliVolts = int.TryParse(info.GetValueAt("Brush_mVolts", 0), out int BrushMilliVolts) ? BrushMilliVolts : 0;
+ this.BrushEncoder = int.TryParse(info.GetValueAt("Brush_Encoder", 0), out int BrushEncoder) ? BrushEncoder : 0;
+ this.BrushRPM = int.TryParse(info.GetValueAt("Brush_RPM", 0), out int BrushRPM) ? BrushRPM : 0;
+
+ this.VacuumMaxPWM = int.TryParse(info.GetValueAt("Vacuum_MaxPWM", 0), out int VacuumMaxPWM) ? VacuumMaxPWM : 0;
+ this.VacuumPWM = int.TryParse(info.GetValueAt("Vacuum_PWM", 0), out int VacuumPWM) ? VacuumPWM : 0;
+ this.VacuumCurrentInMilliAmpere = int.TryParse(info.GetValueAt("Vacuum_CurrentInMA", 0), out int VacuumCurrentInMilliAmpere) ? VacuumCurrentInMilliAmpere : 0;
+ this.VacuumEncoder = int.TryParse(info.GetValueAt("Vacuum_Encoder", 0), out int VacuumEncoder) ? VacuumEncoder : 0;
+ this.VacuumRPM = int.TryParse(info.GetValueAt("Vacuum_RPM", 0), out int VacuumRPM) ? VacuumRPM : 0;
+
+ this.LeftWheelMaxPWM = int.TryParse(info.GetValueAt("LeftWheel_MaxPWM", 0), out int LeftWheelMaxPWM) ? LeftWheelMaxPWM : 0;
+ this.LeftWheelPWM = int.TryParse(info.GetValueAt("LeftWheel_PWM", 0), out int intOutParameter) ? intOutParameter : 0;
+ this.LeftWheelMilliVolts = int.TryParse(info.GetValueAt("LeftWheel_mVolts", 0), out int LeftWheelPWM) ? LeftWheelPWM : 0;
+ this.LeftWheelEncoder = int.TryParse(info.GetValueAt("LeftWheel_Encoder", 0), out int LeftWheelEncoder) ? LeftWheelEncoder : 0;
+ this.LeftWheelPositionInMM = int.TryParse(info.GetValueAt("LeftWheel_PositionInMM", 0), out int LeftWheelPositionInMM) ? LeftWheelPositionInMM : 0;
+ this.LeftWheelRPM = int.TryParse(info.GetValueAt("LeftWheel_RPM", 0), out int LeftWheelRPM) ? LeftWheelRPM : 0;
+
+ this.RightWheelMaxPWM = int.TryParse(info.GetValueAt("RightWheel_MaxPWM", 0), out int RightWheelMaxPWM) ? RightWheelMaxPWM : 0;
+ this.RightWheelPWM = int.TryParse(info.GetValueAt("RightWheel_PWM", 0), out int RightWheelPWM) ? RightWheelPWM : 0;
+ this.RightWheelMilliVolts = int.TryParse(info.GetValueAt("RightWheel_mVolts", 0), out int RightWheelMilliVolts) ? RightWheelMilliVolts : 0;
+ this.RightWheelEncoder = int.TryParse(info.GetValueAt("RightWheel_Encoder", 0), out int RightWheelEncoder) ? RightWheelEncoder : 0;
+ this.RightWheelPositionInMM = int.TryParse(info.GetValueAt("RightWheel_PositionInMM", 0), out int RightWheelPositionInMM) ? RightWheelPositionInMM : 0;
+ this.RightWheelRPM = int.TryParse(info.GetValueAt("RightWheel_RPM", 0), out int RightWheelRPM) ? RightWheelRPM : 0;
+
+ this.LaserMaxPWM = int.TryParse(info.GetValueAt("Laser_MaxPWM", 0), out int LaserMaxPWM) ? LaserMaxPWM : 0;
+ this.LaserPWM = int.TryParse(info.GetValueAt("Laser_PWM", 0), out int LaserPWM) ? LaserPWM : 0;
+ this.LaserMilliVolts = int.TryParse(info.GetValueAt("Laser_mVolts", 0), out int LaserMilliVolts) ? LaserMilliVolts : 0;
+ this.LaserEncoder = int.TryParse(info.GetValueAt("Laser_Encoder", 0), out int LaserEncoder) ? LaserEncoder : 0;
+ this.LaserRPM = int.TryParse(info.GetValueAt("Laser_RPM", 0), out int LaserRPM) ? LaserRPM : 0;
+
+ this.ChargerMaxPWM = int.TryParse(info.GetValueAt("Charger_MaxPWM", 0), out int ChargerMaxPWM) ? ChargerMaxPWM : 0;
+ this.ChargerPWM = int.TryParse(info.GetValueAt("Charger_PWM", 0), out int ChargerPWM) ? ChargerPWM : 0;
+ this.ChargerMilliAmpereHours = int.TryParse(info.GetValueAt("Charger_mAH", 0), out int ChargerMilliAmpereHours) ? ChargerMilliAmpereHours : 0;
}
- #endregion
+ #endregion Internal refresh functions
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPI/NeatoAPI.csproj b/NeatoAPI/NeatoAPI.csproj
index 45e4f41..33ceac2 100644
--- a/NeatoAPI/NeatoAPI.csproj
+++ b/NeatoAPI/NeatoAPI.csproj
@@ -1,67 +1,12 @@
-
-
+
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}
- Library
- Properties
- NeatoAPI
- NeatoAPI
- v4.0
- 512
+ net5.0
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
\ No newline at end of file
+
+
diff --git a/NeatoAPI/Properties/AssemblyInfo.cs b/NeatoAPI/Properties/AssemblyInfo.cs
deleted file mode 100644
index 49738fb..0000000
--- a/NeatoAPI/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("NeatoAPI")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Squid-Studios")]
-[assembly: AssemblyProduct("NeatoAPI")]
-[assembly: AssemblyCopyright("Copyright © Joel Ahlgren 2012")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("81d84b5f-0ec8-407e-8298-0f6a4589d216")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.1.*")]
-[assembly: AssemblyFileVersion("0.1.*")]
diff --git a/NeatoAPI/Response.cs b/NeatoAPI/Response.cs
index 632fdac..9e2558e 100644
--- a/NeatoAPI/Response.cs
+++ b/NeatoAPI/Response.cs
@@ -5,7 +5,7 @@
using System.Text;
///
- /// Represents a response from the Neato.
+ /// Represents a response from the Neato.
///
public class Response
{
@@ -27,11 +27,11 @@ public class Response
///
public Response(string response)
{
- // Find data headers (Assumed to be first line. TODO: Verify this.
+ // Find data headers (Assumed to be first line. TODO: Verify
var headers = response.Split('\n')[0].Trim().Split(',');
- this.raw = response;
- this.data = new Dictionary>();
+ raw = response;
+ data = new Dictionary>();
bool first = true;
@@ -45,14 +45,14 @@ public Response(string response)
var cut = line.Trim().Split(',');
- if (!this.data.ContainsKey(cut[0]))
+ if (!data.ContainsKey(cut[0]))
{
- this.data.Add(cut[0], new List());
+ data.Add(cut[0], new List());
}
for (var i = 1; i < cut.Length; i++)
{
- this.data[cut[0]].Add(cut[i]);
+ data[cut[0]].Add(cut[i]);
}
}
}
@@ -65,7 +65,7 @@ public Response(string response)
///
public string GetRaw()
{
- return this.raw;
+ return raw;
}
///
@@ -77,9 +77,26 @@ public string GetRaw()
///
/// The .
///
- public List GetLine(string identifier)
+ private List GetLine(string identifier)
{
- return this.data[identifier];
+ if (!data.ContainsKey(identifier))
+ {
+ return new List
+ {
+ string.Empty
+ };
+ }
+ return data[identifier];
+ }
+
+ public string GetValueAt(string identifier, int pos)
+ {
+ var value = GetLine(identifier);
+ if (value.Count >= (pos + 1))
+ {
+ return value[pos];
+ }
+ return string.Empty;
}
///
@@ -98,4 +115,4 @@ public override string ToString()
throw new NotImplementedException("Need to finalize parsed data structure first.");
}
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPITest/NeatoAPITest.csproj b/NeatoAPITest/NeatoAPITest.csproj
index 62973ff..9da2ce1 100644
--- a/NeatoAPITest/NeatoAPITest.csproj
+++ b/NeatoAPITest/NeatoAPITest.csproj
@@ -1,72 +1,16 @@
-
-
+
+
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {F25B1FB9-99F0-4950-B46F-A02E577AFDE2}
- Library
- Properties
- NeatoAPITest
- NeatoAPITest
- v4.0
- 512
+ net5.0
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll
-
-
- ..\packages\NUnit.2.6.1\lib\nunit.framework.dll
-
-
-
-
-
-
-
-
-
-
-
- Component
-
-
-
-
+
-
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}
- NeatoAPI
-
+
+
+
-
+
-
-
-
\ No newline at end of file
+
+
diff --git a/NeatoAPITest/NeatoMockPort.cs b/NeatoAPITest/NeatoMockPort.cs
index ede786f..0d78a82 100644
--- a/NeatoAPITest/NeatoMockPort.cs
+++ b/NeatoAPITest/NeatoMockPort.cs
@@ -24,10 +24,10 @@ public class NeatoMockPort : System.IO.Ports.SerialPort
///
public NeatoMockPort()
{
- this.CanConnectToNeato = true;
- this.isOpen = false;
- this.buffer = string.Empty;
- this.AddNoReplyCommands();
+ CanConnectToNeato = true;
+ isOpen = false;
+ buffer = string.Empty;
+ AddNoReplyCommands();
}
///
@@ -40,19 +40,19 @@ public NeatoMockPort()
///
public new void Open()
{
- if (!this.CanConnectToNeato)
+ if (!CanConnectToNeato)
{
throw new IOException();
}
else
{
- if (this.isOpen)
+ if (isOpen)
{
throw new InvalidOperationException("Port is already open!");
}
else
{
- this.isOpen = true;
+ isOpen = true;
}
}
}
@@ -62,8 +62,8 @@ public NeatoMockPort()
///
public new void Close()
{
- this.isOpen = false;
- this.buffer = string.Empty;
+ isOpen = false;
+ buffer = string.Empty;
}
///
@@ -74,7 +74,7 @@ public NeatoMockPort()
///
public new bool IsOpen()
{
- return this.isOpen;
+ return isOpen;
}
///
@@ -83,7 +83,7 @@ public NeatoMockPort()
public new void DiscardInBuffer()
{
// TODO: Find out if this needs to do anything else...
- this.buffer = string.Empty;
+ buffer = string.Empty;
}
///
@@ -94,13 +94,13 @@ public NeatoMockPort()
///
public new string ReadExisting()
{
- if (!this.isOpen)
+ if (!isOpen)
{
throw new InvalidOperationException("Port is not open!");
}
- var result = this.buffer;
- this.buffer = string.Empty;
+ var result = buffer;
+ buffer = string.Empty;
return result;
}
@@ -115,16 +115,16 @@ public NeatoMockPort()
/// Thrown if is null.
public new void WriteLine(string command)
{
- if (!this.isOpen)
+ if (!isOpen)
{
throw new InvalidOperationException("Port is not open!");
}
-
+
if (command == null)
{
throw new ArgumentNullException("command");
}
-
+
if (noReplyCommands.Contains(command))
{
return;
@@ -133,22 +133,27 @@ public NeatoMockPort()
switch (command)
{
case "GetVersion":
- this.buffer += this.replyGetVersion;
+ buffer += replyGetVersion;
break;
+
case "GetAccel":
- this.buffer += this.replyGetAccel;
+ buffer += replyGetAccel;
break;
+
case "GetMotors":
- this.buffer += this.replyGetMotors;
+ buffer += replyGetMotors;
break;
+
case "GetDigitalSensors":
- this.buffer += this.replyGetDigitalSensors;
+ buffer += replyGetDigitalSensors;
break;
+
case "GetCharger":
- this.buffer += this.replyGetCharger;
+ buffer += replyGetCharger;
break;
+
default:
- this.buffer = "Unknown Cmd: '" + command + "'";
+ buffer = "Unknown Cmd: '" + command + "'";
break;
}
}
@@ -163,7 +168,7 @@ public NeatoMockPort()
private void AddNoReplyCommands()
{
string[] list = { "TestMode", "TestMode On", "TestMode Off" };
- foreach(var word in list)
+ foreach (var word in list)
{
noReplyCommands.Add(word);
}
@@ -229,6 +234,6 @@ private void AddNoReplyCommands()
///
private string replyGetLDSScan = "GETLDSSCAN\n\rAngleInDegrees,DistInMM,Intensity,ErrorCodeHEX\n\r0,640,609,0\n\r1,639,612,0\n\r2,639,615,0\n\r3,639,580,0\n\r4,640,604,0\n\r5,641,588,0\n\r6,641,588,0\n\r7,642,610,0\n\r8,643,586,0\n\r9,644,576,0\n\r10,646,556,0\n\r11,648,565,0\n\r12,650,539,0\n\r13,652,572,0\n\r14,655,565,0\n\r15,658,510,0\n\r16,661,494,0\n\r17,664,497,0\n\r18,667,492,0\n\r19,671,507,0\n\r20,674,522,0\n\r21,679,491,0\n\r22,684,491,0\n\r23,687,459,0\n\r24,693,451,0\n\r25,698,479,0\n\r26,0,479,8021\n\r27,708,399,0\n\r28,709,224,0\n\r29,706,17,0\n\r30,0,0,8035\n\r31,0,0,8035\n\r32,0,0,8035\n\r33,0,0,8035\n\r34,774,88,0\n\r35,772,237,0\n\r36,782,335,0\n\r37,796,249,0\n\r38,810,171,0\n\r39,823,66,0\n\r40,0,0,8035\n\r41,0,0,8035\n\r42,0,0,8035\n\r43,844,18,0\n\r44,860,118,0\n\r45,744,42,0\n\r46,756,229,0\n\r47,0,0,8035\n\r48,0,0,8035\n\r49,801,211,0\n\r50,846,309,0\n\r51,846,292,0\n\r52,833,186,0\n\r53,807,218,0\n\r54,786,204,0\n\r55,772,274,0\n\r56,766,275,0\n\r57,0,0,8035\n\r58,532,380,0\n\r59,526,407,0\n\r60,521,388,0\n\r61,517,427,0\n\r62,513,479,0\n\r63,508,446,0\n\r64,530,195,0\n\r65,553,191,0\n\r66,0,0,8035\n\r67,0,0,8035\n\r68,0,0,8002\n\r69,0,0,8002\n\r70,901,57,0\n\r71,951,41,0\n\r72,999,56,0\n\r73,1047,57,0\n\r74,1314,93,0\n\r75,1338,146,0\n\r76,1191,125,0\n\r77,1178,165,0\n\r78,1164,181,0\n\r79,1180,80,0\n\r80,1209,17,0\n\r81,0,0,8035\n\r82,0,0,8035\n\r83,0,0,8035\n\r84,0,0,8035\n\r85,0,0,8035\n\r86,0,0,8035\n\r87,1306,54,0\n\r88,1289,135,0\n\r89,1283,114,0\n\r90,1284,91,0\n\r91,1284,64,0\n\r92,1283,28,0\n\r93,1284,6,0\n\r94,0,0,8035\n\r95,0,0,8035\n\r96,0,0,8035\n\r97,1286,31,0\n\r98,1287,41,0\n\r99,1287,69,0\n\r100,1289,39,0\n\r101,0,0,8002\n\r102,0,0,8002\n\r103,16558,93,0\n\r104,16559,127,0\n\r105,174,174,0\n\r106,16558,155,0\n\r107,16559,110,0\n\r108,16555,41,0\n\r109,1367,27,0\n\r110,1371,83,0\n\r111,1375,110,0\n\r112,1382,104,0\n\r113,1394,74,0\n\r114,1398,32,0\n\r115,0,0,8035\n\r116,0,0,8035\n\r117,0,0,8035\n\r118,0,0,8035\n\r119,0,0,8035\n\r120,1460,54,0\n\r121,1478,93,0\n\r122,1505,111,0\n\r123,1521,152,0\n\r124,1540,150,0\n\r125,1558,141,0\n\r126,1578,150,0\n\r127,1597,147,0\n\r128,1617,124,0\n\r129,1644,125,0\n\r130,1666,25,0\n\r131,0,0,8035\n\r132,0,0,8035\n\r133,0,0,8035\n\r134,0,0,8035\n\r135,352,164,0\n\r136,344,289,0\n\r137,343,284,0\n\r138,351,181,0\n\r139,365,423,0\n\r140,357,236,0\n\r141,349,430,0\n\r142,345,274,0\n\r143,318,320,0\n\r144,313,496,0\n\r145,311,490,0\n\r146,310,391,0\n\r147,308,355,0\n\r148,306,332,0\n\r149,306,345,0\n\r150,306,275,0\n\r151,323,296,0\n\r152,330,253,0\n\r153,326,287,0\n\r154,329,477,0\n\r155,0,0,8002\n\r156,523,114,0\n\r157,540,127,0\n\r158,558,56,0\n\r159,0,0,8035\n\r160,0,0,8035\n\r161,0,0,8035\n\r162,0,0,8035\n\r163,0,0,8035\n\r164,0,0,8035\n\r165,0,0,8035\n\r166,0,0,8035\n\r167,0,0,8035\n\r168,0,0,8035\n\r169,0,0,8035\n\r170,0,0,8035\n\r171,0,0,8035\n\r172,0,0,8035\n\r173,1759,12,0\n\r174,1763,31,0\n\r175,1765,22,0\n\r176,2170,14,0\n\r177,2173,21,0\n\r178,1834,11,0\n\r179,1819,15,0\n\r180,1754,14,0\n\r181,1760,58,0\n\r182,0,0,8035\n\r183,1081,40,0\n\r184,1073,322,0\n\r185,1075,313,0\n\r186,1077,305,0\n\r187,1080,297,0\n\r188,1081,294,0\n\r189,1085,261,0\n\r190,1094,24,0\n\r191,0,0,8035\n\r192,0,0,8035\n\r193,0,0,8035\n\r194,0,0,8021\n\r195,0,0,8035\n\r196,0,0,8035\n\r197,0,0,8035\n\r198,0,0,8035\n\r199,0,0,8035\n\r200,0,0,8035\n\r201,0,0,8035\n\r202,0,0,8035\n\r203,16521,62,0\n\r204,0,0,8035\n\r205,0,0,8003\n\r206,0,0,8003\n\r207,0,0,8003\n\r208,0,0,8003\n\r209,134,436,0\n\r210,0,0,8035\n\r211,0,0,8035\n\r212,0,0,8035\n\r213,0,0,8035\n\r214,0,0,8035\n\r215,0,0,8035\n\r216,16521,83,0\n\r217,139,574,0\n\r218,142,1099,0\n\r219,146,1482,0\n\r220,148,1449,0\n\r221,150,1516,0\n\r222,152,1469,0\n\r223,155,1451,0\n\r224,157,1423,0\n\r225,159,1336,0\n\r226,162,1338,0\n\r227,165,1284,0\n\r228,168,1270,0\n\r229,171,1213,0\n\r230,174,1197,0\n\r231,178,1145,0\n\r232,181,1066,0\n\r233,185,1009,0\n\r234,190,988,0\n\r235,194,946,0\n\r236,199,896,0\n\r237,204,878,0\n\r238,209,821,0\n\r239,215,782,0\n\r240,222,766,0\n\r241,228,717,0\n\r242,0,717,8021\n\r243,243,619,0\n\r244,251,612,0\n\r245,261,550,0\n\r246,271,490,0\n\r247,282,412,0\n\r248,292,275,0\n\r249,16685,45,0\n\r250,0,0,8035\n\r251,0,0,8035\n\r252,0,0,8035\n\r253,0,0,8035\n\r254,0,0,8035\n\r255,0,0,8035\n\r256,0,0,8035\n\r257,0,0,8035\n\r258,0,0,8035\n\r259,803,25,0\n\r260,873,29,0\n\r261,952,27,0\n\r262,0,0,8035\n\r263,0,0,8035\n\r264,0,0,8035\n\r265,0,0,8035\n\r266,0,0,8035\n\r267,0,0,8035\n\r268,2077,11,0\n\r269,2277,66,0\n\r270,2267,140,0\n\r271,2024,24,0\n\r272,2040,11,0\n\r273,2094,8,0\n\r274,2167,11,0\n\r275,2202,50,0\n\r276,2222,40,0\n\r277,2244,38,0\n\r278,2246,41,0\n\r279,2223,41,0\n\r280,2204,18,0\n\r281,2197,15,0\n\r282,0,0,8035\n\r283,0,0,8035\n\r284,0,0,8035\n\r285,0,0,8035\n\r286,0,0,8035\n\r287,0,0,8035\n\r288,1778,24,0\n\r289,1845,60,0\n\r290,1890,49,0\n\r291,1934,111,0\n\r292,1951,89,0\n\r293,1930,49,0\n\r294,1899,60,0\n\r295,1858,93,0\n\r296,1784,60,0\n\r297,1728,72,0\n\r298,1670,77,0\n\r299,1617,90,0\n\r300,1567,88,0\n\r301,1522,30,0\n\r302,955,66,0\n\r303,887,239,0\n\r304,878,252,0\n\r305,869,280,0\n\r306,861,84,0\n\r307,714,163,0\n\r308,700,350,0\n\r309,699,372,0\n\r10,701,340,0\n\r311,709,325,0\n\r312,720,300,0\n\r313,741,212,0\n\r314,751,158,0\n\r315,742,160,0\n\r316,771,163,0\n\r317,759,156,0\n\r318,780,157,0\n\r319,817,180,0\n\r320,838,268,0\n\r321,839,307,0\n\r322,827,322,0\n\r323,817,334,0\n\r324,806,312,0\n\r325,788,89,0\n\r326,0,0,8035\n\r327,0,0,8035\n\r328,0,0,8035\n\r329,0,0,8035\n\r330,0,0,8035\n\r331,0,0,8035\n\r332,745,154,0\n\r333,730,365,0\n\r334,723,413,0\n\r335,719,380,0\n\r336,716,295,0\n\r337,713,231,0\n\r338,710,156,0\n\r339,706,75,0\n\r340,0,0,8035\n\r341,667,57,0\n\r342,666,159,0\n\r343,666,277,0\n\r344,667,369,0\n\r345,667,475,0\n\r346,664,506,0\n\r347,661,521,0\n\r348,658,527,0\n\r349,655,529,0\n\r350,652,544,0\n\r351,650,546,0\n\r352,648,572,0\n\r353,647,537,0\n\r354,644,567,0\n\r355,644,571,0\n\r356,642,564,0\n\r357,641,571,0\n\r358,640,609,0\n\r359,640,611,0\n\rROTATION_SPEED,4.99\n\r" + (char)26;
- #endregion
+ #endregion Command replies
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPITest/NeatoTest.cs b/NeatoAPITest/NeatoTest.cs
index b0adf43..1000ba8 100644
--- a/NeatoAPITest/NeatoTest.cs
+++ b/NeatoAPITest/NeatoTest.cs
@@ -1,6 +1,5 @@
namespace NeatoAPITest
{
- using Moq;
using NeatoAPI;
using NUnit.Framework;
@@ -15,20 +14,20 @@ public class NeatoTest
[SetUp]
public void SetUp()
{
- this.Robot = new Neato(new NeatoMockPort());
+ Robot = new Neato(new NeatoMockPort());
}
-
+
[TearDown]
public void TearDown()
{
- this.Robot = null;
+ Robot = null;
}
[Test]
public void BatteryChargeLevelTest()
{
- this.Robot.RefreshInformation();
- var response = this.Robot.Command.GetInfo.GetTime();
+ Robot.RefreshInformation();
+ var response = Robot.Command.GetInfo.GetTime();
}
}
-}
+}
\ No newline at end of file
diff --git a/NeatoAPITest/Properties/AssemblyInfo.cs b/NeatoAPITest/Properties/AssemblyInfo.cs
deleted file mode 100644
index a0fd07d..0000000
--- a/NeatoAPITest/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("NeatoAPITest")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("NeatoAPITest")]
-[assembly: AssemblyCopyright("Copyright © 2012")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("37bf771a-a0da-4aae-a7a3-c44100f4ed42")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/NeatoAPITest/packages.config b/NeatoAPITest/packages.config
deleted file mode 100644
index 34b086f..0000000
--- a/NeatoAPITest/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/NeatoControl.sln b/NeatoControl.sln
new file mode 100644
index 0000000..e7f4a48
--- /dev/null
+++ b/NeatoControl.sln
@@ -0,0 +1,37 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31410.357
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeatoApi", "NeatoApi\NeatoApi.csproj", "{AC037E8A-4E5A-4CBB-BFE2-A9F97E6A943D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeatoAPITest", "NeatoAPITest\NeatoAPITest.csproj", "{25BA08B6-5A46-4F8F-9367-45BAF19FD643}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeatoControl", "NeatoControl\NeatoControl.csproj", "{F3700D0E-D080-4DC7-BF9E-AD1BE0CFABE1}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {AC037E8A-4E5A-4CBB-BFE2-A9F97E6A943D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AC037E8A-4E5A-4CBB-BFE2-A9F97E6A943D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AC037E8A-4E5A-4CBB-BFE2-A9F97E6A943D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AC037E8A-4E5A-4CBB-BFE2-A9F97E6A943D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {25BA08B6-5A46-4F8F-9367-45BAF19FD643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {25BA08B6-5A46-4F8F-9367-45BAF19FD643}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {25BA08B6-5A46-4F8F-9367-45BAF19FD643}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {25BA08B6-5A46-4F8F-9367-45BAF19FD643}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F3700D0E-D080-4DC7-BF9E-AD1BE0CFABE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F3700D0E-D080-4DC7-BF9E-AD1BE0CFABE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F3700D0E-D080-4DC7-BF9E-AD1BE0CFABE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F3700D0E-D080-4DC7-BF9E-AD1BE0CFABE1}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {CBA4865C-4E39-4E99-B7CB-30472F9729A9}
+ EndGlobalSection
+EndGlobal
diff --git a/NeatoControl/MainWindow.Designer.cs b/NeatoControl/MainWindow.Designer.cs
new file mode 100644
index 0000000..c5c9279
--- /dev/null
+++ b/NeatoControl/MainWindow.Designer.cs
@@ -0,0 +1,966 @@
+namespace NeatoTest
+{
+ partial class MainWindow
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ button1 = new System.Windows.Forms.Button();
+ button2 = new System.Windows.Forms.Button();
+ groupBox1 = new System.Windows.Forms.GroupBox();
+ labelNeatoConnected = new System.Windows.Forms.Label();
+ comboBoxSound = new System.Windows.Forms.ComboBox();
+ groupBoxPlaySound = new System.Windows.Forms.GroupBox();
+ label2 = new System.Windows.Forms.Label();
+ groupBoxTestMode = new System.Windows.Forms.GroupBox();
+ labelTestStatus = new System.Windows.Forms.Label();
+ label3 = new System.Windows.Forms.Label();
+ buttonTestToggle = new System.Windows.Forms.Button();
+ textBoxFromNeato = new System.Windows.Forms.TextBox();
+ label5 = new System.Windows.Forms.Label();
+ buttonGetAccel = new System.Windows.Forms.Button();
+ buttonGetAnalog = new System.Windows.Forms.Button();
+ buttonGetButtons = new System.Windows.Forms.Button();
+ button4 = new System.Windows.Forms.Button();
+ button5 = new System.Windows.Forms.Button();
+ button6 = new System.Windows.Forms.Button();
+ button7 = new System.Windows.Forms.Button();
+ button8 = new System.Windows.Forms.Button();
+ button9 = new System.Windows.Forms.Button();
+ button10 = new System.Windows.Forms.Button();
+ button11 = new System.Windows.Forms.Button();
+ button12 = new System.Windows.Forms.Button();
+ button13 = new System.Windows.Forms.Button();
+ button14 = new System.Windows.Forms.Button();
+ button15 = new System.Windows.Forms.Button();
+ groupBoxGetFunctions = new System.Windows.Forms.GroupBox();
+ groupBoxTestFunctions = new System.Windows.Forms.GroupBox();
+ comboBoxSysMode = new System.Windows.Forms.ComboBox();
+ buttonSysMode = new System.Windows.Forms.Button();
+ groupBox3 = new System.Windows.Forms.GroupBox();
+ labelVacuumState = new System.Windows.Forms.Label();
+ buttonVacuum = new System.Windows.Forms.Button();
+ label9 = new System.Windows.Forms.Label();
+ labelVacuumPower = new System.Windows.Forms.Label();
+ trackBarVacuum = new System.Windows.Forms.TrackBar();
+ groupBox2 = new System.Windows.Forms.GroupBox();
+ textBoxMoveDistance = new System.Windows.Forms.TextBox();
+ label7 = new System.Windows.Forms.Label();
+ buttonMoveStop = new System.Windows.Forms.Button();
+ textBoxMoveSpeed = new System.Windows.Forms.TextBox();
+ label6 = new System.Windows.Forms.Label();
+ checkBoxMoveReverse = new System.Windows.Forms.CheckBox();
+ buttonMove180 = new System.Windows.Forms.Button();
+ buttonMoveRight = new System.Windows.Forms.Button();
+ buttonMoveLeft = new System.Windows.Forms.Button();
+ buttonMoveRightRotate = new System.Windows.Forms.Button();
+ buttonMoveForward = new System.Windows.Forms.Button();
+ buttonMoveLeftRotate = new System.Windows.Forms.Button();
+ groupBox6 = new System.Windows.Forms.GroupBox();
+ button19 = new System.Windows.Forms.Button();
+ buttonMotorRWheel = new System.Windows.Forms.Button();
+ buttonMotorLWheel = new System.Windows.Forms.Button();
+ buttonMotorBrush = new System.Windows.Forms.Button();
+ button17 = new System.Windows.Forms.Button();
+ button16 = new System.Windows.Forms.Button();
+ groupBoxStatus = new System.Windows.Forms.GroupBox();
+ buttonSyncTime = new System.Windows.Forms.Button();
+ labelBatteryCharge = new System.Windows.Forms.Label();
+ buttonRefresh = new System.Windows.Forms.Button();
+ progressBarBatteryBar = new System.Windows.Forms.ProgressBar();
+ label4 = new System.Windows.Forms.Label();
+ backgroundReader = new System.ComponentModel.BackgroundWorker();
+ groupBox1.SuspendLayout();
+ groupBoxPlaySound.SuspendLayout();
+ groupBoxTestMode.SuspendLayout();
+ groupBoxGetFunctions.SuspendLayout();
+ groupBoxTestFunctions.SuspendLayout();
+ groupBox3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(trackBarVacuum)).BeginInit();
+ groupBox2.SuspendLayout();
+ groupBox6.SuspendLayout();
+ groupBoxStatus.SuspendLayout();
+ SuspendLayout();
+ //
+ // button1
+ //
+ button1.Location = new System.Drawing.Point(8, 23);
+ button1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button1.Name = "button1";
+ button1.Size = new System.Drawing.Size(113, 27);
+ button1.TabIndex = 0;
+ button1.Text = "Connect Neato";
+ button1.UseVisualStyleBackColor = true;
+ button1.Click += new System.EventHandler(Button1Click);
+ //
+ // button2
+ //
+ button2.Location = new System.Drawing.Point(7, 78);
+ button2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button2.Name = "button2";
+ button2.Size = new System.Drawing.Size(176, 27);
+ button2.TabIndex = 1;
+ button2.Text = "PlaySound";
+ button2.UseVisualStyleBackColor = true;
+ button2.Click += new System.EventHandler(Button2Click);
+ //
+ // groupBox1
+ //
+ groupBox1.Controls.Add(labelNeatoConnected);
+ groupBox1.Controls.Add(button1);
+ groupBox1.Location = new System.Drawing.Point(346, 17);
+ groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox1.Name = "groupBox1";
+ groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox1.Size = new System.Drawing.Size(242, 72);
+ groupBox1.TabIndex = 3;
+ groupBox1.TabStop = false;
+ groupBox1.Text = "Neato Connection";
+ //
+ // labelNeatoConnected
+ //
+ labelNeatoConnected.AutoSize = true;
+ labelNeatoConnected.BackColor = System.Drawing.Color.LightCoral;
+ labelNeatoConnected.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ labelNeatoConnected.Location = new System.Drawing.Point(129, 29);
+ labelNeatoConnected.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ labelNeatoConnected.Name = "labelNeatoConnected";
+ labelNeatoConnected.Size = new System.Drawing.Size(81, 17);
+ labelNeatoConnected.TabIndex = 9;
+ labelNeatoConnected.Text = "Disconnected";
+ //
+ // comboBoxSound
+ //
+ comboBoxSound.FormattingEnabled = true;
+ comboBoxSound.Location = new System.Drawing.Point(7, 45);
+ comboBoxSound.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ comboBoxSound.Name = "comboBoxSound";
+ comboBoxSound.Size = new System.Drawing.Size(176, 23);
+ comboBoxSound.TabIndex = 6;
+ //
+ // groupBoxPlaySound
+ //
+ groupBoxPlaySound.Controls.Add(label2);
+ groupBoxPlaySound.Controls.Add(comboBoxSound);
+ groupBoxPlaySound.Controls.Add(button2);
+ groupBoxPlaySound.Location = new System.Drawing.Point(8, 285);
+ groupBoxPlaySound.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxPlaySound.Name = "groupBoxPlaySound";
+ groupBoxPlaySound.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxPlaySound.Size = new System.Drawing.Size(233, 118);
+ groupBoxPlaySound.TabIndex = 7;
+ groupBoxPlaySound.TabStop = false;
+ groupBoxPlaySound.Text = "Play Sound";
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.Location = new System.Drawing.Point(8, 23);
+ label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ label2.Name = "label2";
+ label2.Size = new System.Drawing.Size(41, 15);
+ label2.TabIndex = 7;
+ label2.Text = "Sound";
+ //
+ // groupBoxTestMode
+ //
+ groupBoxTestMode.Controls.Add(labelTestStatus);
+ groupBoxTestMode.Controls.Add(label3);
+ groupBoxTestMode.Controls.Add(buttonTestToggle);
+ groupBoxTestMode.Location = new System.Drawing.Point(596, 17);
+ groupBoxTestMode.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxTestMode.Name = "groupBoxTestMode";
+ groupBoxTestMode.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxTestMode.Size = new System.Drawing.Size(250, 72);
+ groupBoxTestMode.TabIndex = 8;
+ groupBoxTestMode.TabStop = false;
+ groupBoxTestMode.Text = "Test Mode";
+ //
+ // labelTestStatus
+ //
+ labelTestStatus.AutoSize = true;
+ labelTestStatus.BackColor = System.Drawing.Color.LightCoral;
+ labelTestStatus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ labelTestStatus.Location = new System.Drawing.Point(182, 33);
+ labelTestStatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ labelTestStatus.Name = "labelTestStatus";
+ labelTestStatus.Size = new System.Drawing.Size(50, 17);
+ labelTestStatus.TabIndex = 2;
+ labelTestStatus.Text = "Inactive";
+ //
+ // label3
+ //
+ label3.AutoSize = true;
+ label3.Location = new System.Drawing.Point(102, 33);
+ label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ label3.Name = "label3";
+ label3.Size = new System.Drawing.Size(78, 15);
+ label3.TabIndex = 1;
+ label3.Text = "Test mode is: ";
+ //
+ // buttonTestToggle
+ //
+ buttonTestToggle.Location = new System.Drawing.Point(8, 28);
+ buttonTestToggle.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonTestToggle.Name = "buttonTestToggle";
+ buttonTestToggle.Size = new System.Drawing.Size(88, 27);
+ buttonTestToggle.TabIndex = 0;
+ buttonTestToggle.Text = "Toggle";
+ buttonTestToggle.UseVisualStyleBackColor = true;
+ buttonTestToggle.Click += new System.EventHandler(ButtonTestToggleClick);
+ //
+ // textBoxFromNeato
+ //
+ textBoxFromNeato.HideSelection = false;
+ textBoxFromNeato.Location = new System.Drawing.Point(14, 32);
+ textBoxFromNeato.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ textBoxFromNeato.Multiline = true;
+ textBoxFromNeato.Name = "textBoxFromNeato";
+ textBoxFromNeato.ScrollBars = System.Windows.Forms.ScrollBars.Both;
+ textBoxFromNeato.Size = new System.Drawing.Size(324, 490);
+ textBoxFromNeato.TabIndex = 10;
+ //
+ // label5
+ //
+ label5.AutoSize = true;
+ label5.Location = new System.Drawing.Point(13, 14);
+ label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ label5.Name = "label5";
+ label5.Size = new System.Drawing.Size(92, 15);
+ label5.TabIndex = 12;
+ label5.Text = "Text from Neato";
+ //
+ // buttonGetAccel
+ //
+ buttonGetAccel.Location = new System.Drawing.Point(7, 22);
+ buttonGetAccel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonGetAccel.Name = "buttonGetAccel";
+ buttonGetAccel.Size = new System.Drawing.Size(130, 27);
+ buttonGetAccel.TabIndex = 13;
+ buttonGetAccel.Text = "GetAccel()";
+ buttonGetAccel.UseVisualStyleBackColor = true;
+ buttonGetAccel.Click += new System.EventHandler(ButtonGetAccelClick);
+ //
+ // buttonGetAnalog
+ //
+ buttonGetAnalog.Location = new System.Drawing.Point(7, 55);
+ buttonGetAnalog.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonGetAnalog.Name = "buttonGetAnalog";
+ buttonGetAnalog.Size = new System.Drawing.Size(130, 27);
+ buttonGetAnalog.TabIndex = 14;
+ buttonGetAnalog.Text = "GetAnalogSensors()";
+ buttonGetAnalog.UseVisualStyleBackColor = true;
+ buttonGetAnalog.Click += new System.EventHandler(ButtonGetAnalogClick);
+ //
+ // buttonGetButtons
+ //
+ buttonGetButtons.Location = new System.Drawing.Point(7, 89);
+ buttonGetButtons.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonGetButtons.Name = "buttonGetButtons";
+ buttonGetButtons.Size = new System.Drawing.Size(130, 27);
+ buttonGetButtons.TabIndex = 15;
+ buttonGetButtons.Text = "GetButtons()";
+ buttonGetButtons.UseVisualStyleBackColor = true;
+ buttonGetButtons.Click += new System.EventHandler(ButtonGetButtonsClick);
+ //
+ // button4
+ //
+ button4.Location = new System.Drawing.Point(7, 122);
+ button4.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button4.Name = "button4";
+ button4.Size = new System.Drawing.Size(130, 27);
+ button4.TabIndex = 16;
+ button4.Text = "GetCalInfo()";
+ button4.UseVisualStyleBackColor = true;
+ button4.Click += new System.EventHandler(Button4Click);
+ //
+ // button5
+ //
+ button5.Location = new System.Drawing.Point(7, 156);
+ button5.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button5.Name = "button5";
+ button5.Size = new System.Drawing.Size(130, 27);
+ button5.TabIndex = 17;
+ button5.Text = "GetCharger()";
+ button5.UseVisualStyleBackColor = true;
+ button5.Click += new System.EventHandler(Button5Click);
+ //
+ // button6
+ //
+ button6.Location = new System.Drawing.Point(7, 189);
+ button6.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button6.Name = "button6";
+ button6.Size = new System.Drawing.Size(130, 27);
+ button6.TabIndex = 18;
+ button6.Text = "GetDigitalSensors()";
+ button6.UseVisualStyleBackColor = true;
+ button6.Click += new System.EventHandler(Button6Click);
+ //
+ // button7
+ //
+ button7.Location = new System.Drawing.Point(7, 223);
+ button7.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button7.Name = "button7";
+ button7.Size = new System.Drawing.Size(130, 27);
+ button7.TabIndex = 19;
+ button7.Text = "GetErr()";
+ button7.UseVisualStyleBackColor = true;
+ button7.Click += new System.EventHandler(Button7Click);
+ //
+ // button8
+ //
+ button8.Location = new System.Drawing.Point(7, 256);
+ button8.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button8.Name = "button8";
+ button8.Size = new System.Drawing.Size(266, 27);
+ button8.TabIndex = 20;
+ button8.Text = "GetLDSScan()";
+ button8.UseVisualStyleBackColor = true;
+ button8.Click += new System.EventHandler(Button8Click);
+ //
+ // button9
+ //
+ button9.Location = new System.Drawing.Point(144, 22);
+ button9.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button9.Name = "button9";
+ button9.Size = new System.Drawing.Size(130, 27);
+ button9.TabIndex = 21;
+ button9.Text = "GetLifeStatLog()";
+ button9.UseVisualStyleBackColor = true;
+ button9.Click += new System.EventHandler(Button9Click);
+ //
+ // button10
+ //
+ button10.Location = new System.Drawing.Point(144, 55);
+ button10.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button10.Name = "button10";
+ button10.Size = new System.Drawing.Size(130, 27);
+ button10.TabIndex = 22;
+ button10.Text = "GetMotors()";
+ button10.UseVisualStyleBackColor = true;
+ button10.Click += new System.EventHandler(Button10Click);
+ //
+ // button11
+ //
+ button11.Location = new System.Drawing.Point(144, 89);
+ button11.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button11.Name = "button11";
+ button11.Size = new System.Drawing.Size(130, 27);
+ button11.TabIndex = 23;
+ button11.Text = "GetSchedule()";
+ button11.UseVisualStyleBackColor = true;
+ button11.Click += new System.EventHandler(Button11Click);
+ //
+ // button12
+ //
+ button12.Location = new System.Drawing.Point(144, 122);
+ button12.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button12.Name = "button12";
+ button12.Size = new System.Drawing.Size(130, 27);
+ button12.TabIndex = 24;
+ button12.Text = "GetSysLog()";
+ button12.UseVisualStyleBackColor = true;
+ button12.Click += new System.EventHandler(Button12Click);
+ //
+ // button13
+ //
+ button13.Location = new System.Drawing.Point(144, 156);
+ button13.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button13.Name = "button13";
+ button13.Size = new System.Drawing.Size(130, 27);
+ button13.TabIndex = 25;
+ button13.Text = "GetTime()";
+ button13.UseVisualStyleBackColor = true;
+ button13.Click += new System.EventHandler(Button13Click);
+ //
+ // button14
+ //
+ button14.Location = new System.Drawing.Point(144, 189);
+ button14.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button14.Name = "button14";
+ button14.Size = new System.Drawing.Size(130, 27);
+ button14.TabIndex = 26;
+ button14.Text = "GetVersion()";
+ button14.UseVisualStyleBackColor = true;
+ button14.Click += new System.EventHandler(Button14Click);
+ //
+ // button15
+ //
+ button15.Location = new System.Drawing.Point(144, 223);
+ button15.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button15.Name = "button15";
+ button15.Size = new System.Drawing.Size(130, 27);
+ button15.TabIndex = 27;
+ button15.Text = "GetWarranty()";
+ button15.UseVisualStyleBackColor = true;
+ button15.Click += new System.EventHandler(Button15Click);
+ //
+ // groupBoxGetFunctions
+ //
+ groupBoxGetFunctions.Controls.Add(button15);
+ groupBoxGetFunctions.Controls.Add(button14);
+ groupBoxGetFunctions.Controls.Add(button13);
+ groupBoxGetFunctions.Controls.Add(button12);
+ groupBoxGetFunctions.Controls.Add(button11);
+ groupBoxGetFunctions.Controls.Add(button10);
+ groupBoxGetFunctions.Controls.Add(button9);
+ groupBoxGetFunctions.Controls.Add(button8);
+ groupBoxGetFunctions.Controls.Add(button7);
+ groupBoxGetFunctions.Controls.Add(button6);
+ groupBoxGetFunctions.Controls.Add(button5);
+ groupBoxGetFunctions.Controls.Add(button4);
+ groupBoxGetFunctions.Controls.Add(buttonGetButtons);
+ groupBoxGetFunctions.Controls.Add(buttonGetAnalog);
+ groupBoxGetFunctions.Controls.Add(buttonGetAccel);
+ groupBoxGetFunctions.Location = new System.Drawing.Point(854, 188);
+ groupBoxGetFunctions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxGetFunctions.Name = "groupBoxGetFunctions";
+ groupBoxGetFunctions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxGetFunctions.Size = new System.Drawing.Size(282, 334);
+ groupBoxGetFunctions.TabIndex = 28;
+ groupBoxGetFunctions.TabStop = false;
+ groupBoxGetFunctions.Text = "Get functions";
+ //
+ // groupBoxTestFunctions
+ //
+ groupBoxTestFunctions.Controls.Add(comboBoxSysMode);
+ groupBoxTestFunctions.Controls.Add(buttonSysMode);
+ groupBoxTestFunctions.Controls.Add(groupBox3);
+ groupBoxTestFunctions.Controls.Add(groupBox2);
+ groupBoxTestFunctions.Controls.Add(groupBox6);
+ groupBoxTestFunctions.Controls.Add(groupBoxPlaySound);
+ groupBoxTestFunctions.Controls.Add(button17);
+ groupBoxTestFunctions.Controls.Add(button16);
+ groupBoxTestFunctions.Enabled = false;
+ groupBoxTestFunctions.Location = new System.Drawing.Point(346, 92);
+ groupBoxTestFunctions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxTestFunctions.Name = "groupBoxTestFunctions";
+ groupBoxTestFunctions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxTestFunctions.Size = new System.Drawing.Size(500, 430);
+ groupBoxTestFunctions.TabIndex = 30;
+ groupBoxTestFunctions.TabStop = false;
+ groupBoxTestFunctions.Text = "Test functions";
+ //
+ // comboBoxSysMode
+ //
+ comboBoxSysMode.FormattingEnabled = true;
+ comboBoxSysMode.Location = new System.Drawing.Point(123, 100);
+ comboBoxSysMode.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ comboBoxSysMode.Name = "comboBoxSysMode";
+ comboBoxSysMode.Size = new System.Drawing.Size(118, 23);
+ comboBoxSysMode.TabIndex = 14;
+ //
+ // buttonSysMode
+ //
+ buttonSysMode.Location = new System.Drawing.Point(7, 96);
+ buttonSysMode.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonSysMode.Name = "buttonSysMode";
+ buttonSysMode.Size = new System.Drawing.Size(108, 27);
+ buttonSysMode.TabIndex = 13;
+ buttonSysMode.Text = "SystemMode";
+ buttonSysMode.UseVisualStyleBackColor = true;
+ buttonSysMode.Click += new System.EventHandler(buttonSysMode_Click);
+ //
+ // groupBox3
+ //
+ groupBox3.Controls.Add(labelVacuumState);
+ groupBox3.Controls.Add(buttonVacuum);
+ groupBox3.Controls.Add(label9);
+ groupBox3.Controls.Add(labelVacuumPower);
+ groupBox3.Controls.Add(trackBarVacuum);
+ groupBox3.Location = new System.Drawing.Point(8, 141);
+ groupBox3.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox3.Name = "groupBox3";
+ groupBox3.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox3.Size = new System.Drawing.Size(233, 119);
+ groupBox3.TabIndex = 12;
+ groupBox3.TabStop = false;
+ groupBox3.Text = "Vacuum";
+ //
+ // labelVacuumState
+ //
+ labelVacuumState.AutoSize = true;
+ labelVacuumState.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ labelVacuumState.Location = new System.Drawing.Point(146, 27);
+ labelVacuumState.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ labelVacuumState.Name = "labelVacuumState";
+ labelVacuumState.Size = new System.Drawing.Size(26, 17);
+ labelVacuumState.TabIndex = 4;
+ labelVacuumState.Text = "Off";
+ //
+ // buttonVacuum
+ //
+ buttonVacuum.Location = new System.Drawing.Point(7, 22);
+ buttonVacuum.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonVacuum.Name = "buttonVacuum";
+ buttonVacuum.Size = new System.Drawing.Size(113, 27);
+ buttonVacuum.TabIndex = 3;
+ buttonVacuum.Text = "Toggle vacuum";
+ buttonVacuum.UseVisualStyleBackColor = true;
+ buttonVacuum.Click += new System.EventHandler(buttonVacuum_Click);
+ //
+ // label9
+ //
+ label9.AutoSize = true;
+ label9.Location = new System.Drawing.Point(7, 92);
+ label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ label9.Name = "label9";
+ label9.Size = new System.Drawing.Size(128, 15);
+ label9.TabIndex = 2;
+ label9.Text = "Vacuum motor power: ";
+ //
+ // labelVacuumPower
+ //
+ labelVacuumPower.AutoSize = true;
+ labelVacuumPower.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ labelVacuumPower.Location = new System.Drawing.Point(146, 92);
+ labelVacuumPower.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ labelVacuumPower.Name = "labelVacuumPower";
+ labelVacuumPower.Size = new System.Drawing.Size(31, 17);
+ labelVacuumPower.TabIndex = 1;
+ labelVacuumPower.Text = "90%";
+ //
+ // trackBarVacuum
+ //
+ trackBarVacuum.Location = new System.Drawing.Point(0, 48);
+ trackBarVacuum.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ trackBarVacuum.Maximum = 100;
+ trackBarVacuum.Name = "trackBarVacuum";
+ trackBarVacuum.Size = new System.Drawing.Size(233, 45);
+ trackBarVacuum.TabIndex = 0;
+ trackBarVacuum.TickFrequency = 10;
+ trackBarVacuum.Value = 90;
+ trackBarVacuum.ValueChanged += new System.EventHandler(trackBarVacuum_ValueChanged);
+ //
+ // groupBox2
+ //
+ groupBox2.Controls.Add(textBoxMoveDistance);
+ groupBox2.Controls.Add(label7);
+ groupBox2.Controls.Add(buttonMoveStop);
+ groupBox2.Controls.Add(textBoxMoveSpeed);
+ groupBox2.Controls.Add(label6);
+ groupBox2.Controls.Add(checkBoxMoveReverse);
+ groupBox2.Controls.Add(buttonMove180);
+ groupBox2.Controls.Add(buttonMoveRight);
+ groupBox2.Controls.Add(buttonMoveLeft);
+ groupBox2.Controls.Add(buttonMoveRightRotate);
+ groupBox2.Controls.Add(buttonMoveForward);
+ groupBox2.Controls.Add(buttonMoveLeftRotate);
+ groupBox2.Location = new System.Drawing.Point(260, 12);
+ groupBox2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox2.Name = "groupBox2";
+ groupBox2.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox2.Size = new System.Drawing.Size(233, 167);
+ groupBox2.TabIndex = 11;
+ groupBox2.TabStop = false;
+ groupBox2.Text = "Movement";
+ //
+ // textBoxMoveDistance
+ //
+ textBoxMoveDistance.Location = new System.Drawing.Point(145, 129);
+ textBoxMoveDistance.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ textBoxMoveDistance.Name = "textBoxMoveDistance";
+ textBoxMoveDistance.Size = new System.Drawing.Size(80, 23);
+ textBoxMoveDistance.TabIndex = 15;
+ textBoxMoveDistance.Text = "50";
+ //
+ // label7
+ //
+ label7.AutoSize = true;
+ label7.Location = new System.Drawing.Point(141, 110);
+ label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ label7.Name = "label7";
+ label7.Size = new System.Drawing.Size(85, 15);
+ label7.TabIndex = 14;
+ label7.Text = "Distance (mm)";
+ //
+ // buttonMoveStop
+ //
+ buttonMoveStop.BackColor = System.Drawing.Color.Red;
+ buttonMoveStop.Location = new System.Drawing.Point(51, 66);
+ buttonMoveStop.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMoveStop.Name = "buttonMoveStop";
+ buttonMoveStop.Size = new System.Drawing.Size(37, 37);
+ buttonMoveStop.TabIndex = 13;
+ buttonMoveStop.Text = "S";
+ buttonMoveStop.UseVisualStyleBackColor = false;
+ buttonMoveStop.Click += new System.EventHandler(buttonMoveStop_Click);
+ //
+ // textBoxMoveSpeed
+ //
+ textBoxMoveSpeed.Location = new System.Drawing.Point(145, 70);
+ textBoxMoveSpeed.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ textBoxMoveSpeed.Name = "textBoxMoveSpeed";
+ textBoxMoveSpeed.Size = new System.Drawing.Size(80, 23);
+ textBoxMoveSpeed.TabIndex = 12;
+ textBoxMoveSpeed.Text = "50";
+ //
+ // label6
+ //
+ label6.AutoSize = true;
+ label6.Location = new System.Drawing.Point(141, 51);
+ label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ label6.Name = "label6";
+ label6.Size = new System.Drawing.Size(82, 15);
+ label6.TabIndex = 11;
+ label6.Text = "Speed (mm/s)";
+ //
+ // checkBoxMoveReverse
+ //
+ checkBoxMoveReverse.AutoSize = true;
+ checkBoxMoveReverse.Location = new System.Drawing.Point(141, 23);
+ checkBoxMoveReverse.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ checkBoxMoveReverse.Name = "checkBoxMoveReverse";
+ checkBoxMoveReverse.Size = new System.Drawing.Size(71, 19);
+ checkBoxMoveReverse.TabIndex = 10;
+ checkBoxMoveReverse.Text = "Reverse?";
+ checkBoxMoveReverse.UseVisualStyleBackColor = true;
+ //
+ // buttonMove180
+ //
+ buttonMove180.Location = new System.Drawing.Point(7, 121);
+ buttonMove180.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMove180.Name = "buttonMove180";
+ buttonMove180.Size = new System.Drawing.Size(124, 37);
+ buttonMove180.TabIndex = 9;
+ buttonMove180.Tag = "";
+ buttonMove180.Text = "180";
+ buttonMove180.UseVisualStyleBackColor = true;
+ buttonMove180.Click += new System.EventHandler(buttonMove180_Click);
+ //
+ // buttonMoveRight
+ //
+ buttonMoveRight.Location = new System.Drawing.Point(96, 66);
+ buttonMoveRight.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMoveRight.Name = "buttonMoveRight";
+ buttonMoveRight.Size = new System.Drawing.Size(37, 37);
+ buttonMoveRight.TabIndex = 7;
+ buttonMoveRight.Text = "R";
+ buttonMoveRight.UseVisualStyleBackColor = true;
+ buttonMoveRight.Click += new System.EventHandler(buttonMoveRight_Click);
+ //
+ // buttonMoveLeft
+ //
+ buttonMoveLeft.Location = new System.Drawing.Point(7, 66);
+ buttonMoveLeft.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMoveLeft.Name = "buttonMoveLeft";
+ buttonMoveLeft.Size = new System.Drawing.Size(37, 37);
+ buttonMoveLeft.TabIndex = 5;
+ buttonMoveLeft.Text = "L";
+ buttonMoveLeft.UseVisualStyleBackColor = true;
+ buttonMoveLeft.Click += new System.EventHandler(buttonMoveLeft_Click);
+ //
+ // buttonMoveRightRotate
+ //
+ buttonMoveRightRotate.Location = new System.Drawing.Point(96, 22);
+ buttonMoveRightRotate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMoveRightRotate.Name = "buttonMoveRightRotate";
+ buttonMoveRightRotate.Size = new System.Drawing.Size(37, 37);
+ buttonMoveRightRotate.TabIndex = 4;
+ buttonMoveRightRotate.Text = "/";
+ buttonMoveRightRotate.UseVisualStyleBackColor = true;
+ buttonMoveRightRotate.Click += new System.EventHandler(buttonMoveRightRotate_Click);
+ //
+ // buttonMoveForward
+ //
+ buttonMoveForward.Location = new System.Drawing.Point(51, 22);
+ buttonMoveForward.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMoveForward.Name = "buttonMoveForward";
+ buttonMoveForward.Size = new System.Drawing.Size(37, 37);
+ buttonMoveForward.TabIndex = 3;
+ buttonMoveForward.Text = "B";
+ buttonMoveForward.UseVisualStyleBackColor = true;
+ buttonMoveForward.Click += new System.EventHandler(buttonMoveForward_Click);
+ //
+ // buttonMoveLeftRotate
+ //
+ buttonMoveLeftRotate.Location = new System.Drawing.Point(7, 22);
+ buttonMoveLeftRotate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMoveLeftRotate.Name = "buttonMoveLeftRotate";
+ buttonMoveLeftRotate.Size = new System.Drawing.Size(37, 37);
+ buttonMoveLeftRotate.TabIndex = 2;
+ buttonMoveLeftRotate.Text = "\\";
+ buttonMoveLeftRotate.UseVisualStyleBackColor = true;
+ buttonMoveLeftRotate.Click += new System.EventHandler(buttonMoveLeftRotate_Click);
+ //
+ // groupBox6
+ //
+ groupBox6.Controls.Add(button19);
+ groupBox6.Controls.Add(buttonMotorRWheel);
+ groupBox6.Controls.Add(buttonMotorLWheel);
+ groupBox6.Controls.Add(buttonMotorBrush);
+ groupBox6.Location = new System.Drawing.Point(259, 186);
+ groupBox6.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox6.Name = "groupBox6";
+ groupBox6.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBox6.Size = new System.Drawing.Size(234, 147);
+ groupBox6.TabIndex = 10;
+ groupBox6.TabStop = false;
+ groupBox6.Text = "Toggle Motors";
+ //
+ // button19
+ //
+ button19.Location = new System.Drawing.Point(73, 99);
+ button19.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button19.Name = "button19";
+ button19.Size = new System.Drawing.Size(88, 27);
+ button19.TabIndex = 4;
+ button19.Text = "Lidar";
+ button19.UseVisualStyleBackColor = true;
+ button19.Click += new System.EventHandler(button19_Click);
+ //
+ // buttonMotorRWheel
+ //
+ buttonMotorRWheel.Location = new System.Drawing.Point(136, 58);
+ buttonMotorRWheel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMotorRWheel.Name = "buttonMotorRWheel";
+ buttonMotorRWheel.Size = new System.Drawing.Size(88, 27);
+ buttonMotorRWheel.TabIndex = 3;
+ buttonMotorRWheel.Text = "Right Wheel";
+ buttonMotorRWheel.UseVisualStyleBackColor = true;
+ buttonMotorRWheel.Click += new System.EventHandler(buttonMotorRWheel_Click);
+ //
+ // buttonMotorLWheel
+ //
+ buttonMotorLWheel.Location = new System.Drawing.Point(7, 58);
+ buttonMotorLWheel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMotorLWheel.Name = "buttonMotorLWheel";
+ buttonMotorLWheel.Size = new System.Drawing.Size(88, 27);
+ buttonMotorLWheel.TabIndex = 2;
+ buttonMotorLWheel.Text = "Left Wheel";
+ buttonMotorLWheel.UseVisualStyleBackColor = true;
+ buttonMotorLWheel.Click += new System.EventHandler(buttonMotorLWheel_Click);
+ //
+ // buttonMotorBrush
+ //
+ buttonMotorBrush.Location = new System.Drawing.Point(73, 22);
+ buttonMotorBrush.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonMotorBrush.Name = "buttonMotorBrush";
+ buttonMotorBrush.Size = new System.Drawing.Size(88, 27);
+ buttonMotorBrush.TabIndex = 0;
+ buttonMotorBrush.Text = "Brush";
+ buttonMotorBrush.UseVisualStyleBackColor = true;
+ buttonMotorBrush.Click += new System.EventHandler(buttonMotorBrush_Click);
+ //
+ // button17
+ //
+ button17.Location = new System.Drawing.Point(7, 55);
+ button17.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button17.Name = "button17";
+ button17.Size = new System.Drawing.Size(108, 27);
+ button17.TabIndex = 4;
+ button17.Text = "SetLCD()";
+ button17.UseVisualStyleBackColor = true;
+ //
+ // button16
+ //
+ button16.Location = new System.Drawing.Point(7, 22);
+ button16.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ button16.Name = "button16";
+ button16.Size = new System.Drawing.Size(108, 27);
+ button16.TabIndex = 3;
+ button16.Text = "DiagTest()";
+ button16.UseVisualStyleBackColor = true;
+ button16.Click += new System.EventHandler(Button16Click);
+ //
+ // groupBoxStatus
+ //
+ groupBoxStatus.Controls.Add(buttonSyncTime);
+ groupBoxStatus.Controls.Add(labelBatteryCharge);
+ groupBoxStatus.Controls.Add(buttonRefresh);
+ groupBoxStatus.Controls.Add(progressBarBatteryBar);
+ groupBoxStatus.Controls.Add(label4);
+ groupBoxStatus.Location = new System.Drawing.Point(854, 14);
+ groupBoxStatus.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxStatus.Name = "groupBoxStatus";
+ groupBoxStatus.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ groupBoxStatus.Size = new System.Drawing.Size(282, 168);
+ groupBoxStatus.TabIndex = 31;
+ groupBoxStatus.TabStop = false;
+ groupBoxStatus.Text = "Neato Status";
+ //
+ // buttonSyncTime
+ //
+ buttonSyncTime.Location = new System.Drawing.Point(97, 123);
+ buttonSyncTime.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonSyncTime.Name = "buttonSyncTime";
+ buttonSyncTime.Size = new System.Drawing.Size(88, 27);
+ buttonSyncTime.TabIndex = 32;
+ buttonSyncTime.Text = "SyncTime()";
+ buttonSyncTime.UseVisualStyleBackColor = true;
+ buttonSyncTime.Click += new System.EventHandler(buttonSyncTime_Click);
+ //
+ // labelBatteryCharge
+ //
+ labelBatteryCharge.AutoSize = true;
+ labelBatteryCharge.Location = new System.Drawing.Point(93, 62);
+ labelBatteryCharge.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ labelBatteryCharge.Name = "labelBatteryCharge";
+ labelBatteryCharge.Size = new System.Drawing.Size(41, 15);
+ labelBatteryCharge.TabIndex = 3;
+ labelBatteryCharge.Text = "NaN%";
+ //
+ // buttonRefresh
+ //
+ buttonRefresh.Location = new System.Drawing.Point(8, 23);
+ buttonRefresh.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ buttonRefresh.Name = "buttonRefresh";
+ buttonRefresh.Size = new System.Drawing.Size(265, 27);
+ buttonRefresh.TabIndex = 2;
+ buttonRefresh.Text = "Refresh";
+ buttonRefresh.UseVisualStyleBackColor = true;
+ buttonRefresh.Click += new System.EventHandler(buttonRefresh_Click);
+ //
+ // progressBarBatteryBar
+ //
+ progressBarBatteryBar.Location = new System.Drawing.Point(6, 81);
+ progressBarBatteryBar.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ progressBarBatteryBar.MarqueeAnimationSpeed = 0;
+ progressBarBatteryBar.Name = "progressBarBatteryBar";
+ progressBarBatteryBar.Size = new System.Drawing.Size(267, 25);
+ progressBarBatteryBar.Step = 5;
+ progressBarBatteryBar.TabIndex = 1;
+ //
+ // label4
+ //
+ label4.AutoSize = true;
+ label4.Location = new System.Drawing.Point(7, 62);
+ label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ label4.Name = "label4";
+ label4.Size = new System.Drawing.Size(74, 15);
+ label4.TabIndex = 0;
+ label4.Text = "Battery level:";
+ //
+ // backgroundReader
+ //
+ backgroundReader.WorkerSupportsCancellation = true;
+ //
+ // MainWindow
+ //
+ AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ ClientSize = new System.Drawing.Size(1145, 531);
+ Controls.Add(groupBoxStatus);
+ Controls.Add(groupBoxTestFunctions);
+ Controls.Add(groupBoxGetFunctions);
+ Controls.Add(label5);
+ Controls.Add(textBoxFromNeato);
+ Controls.Add(groupBoxTestMode);
+ Controls.Add(groupBox1);
+ Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ Name = "MainWindow";
+ Text = "Neato API Test application";
+ groupBox1.ResumeLayout(false);
+ groupBox1.PerformLayout();
+ groupBoxPlaySound.ResumeLayout(false);
+ groupBoxPlaySound.PerformLayout();
+ groupBoxTestMode.ResumeLayout(false);
+ groupBoxTestMode.PerformLayout();
+ groupBoxGetFunctions.ResumeLayout(false);
+ groupBoxTestFunctions.ResumeLayout(false);
+ groupBox3.ResumeLayout(false);
+ groupBox3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(trackBarVacuum)).EndInit();
+ groupBox2.ResumeLayout(false);
+ groupBox2.PerformLayout();
+ groupBox6.ResumeLayout(false);
+ groupBoxStatus.ResumeLayout(false);
+ groupBoxStatus.PerformLayout();
+ ResumeLayout(false);
+ PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.ComboBox comboBoxSound;
+ private System.Windows.Forms.GroupBox groupBoxPlaySound;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.GroupBox groupBoxTestMode;
+ private System.Windows.Forms.Label labelTestStatus;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Button buttonTestToggle;
+ private System.Windows.Forms.TextBox textBoxFromNeato;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Button buttonGetAccel;
+ private System.Windows.Forms.Label labelNeatoConnected;
+ private System.Windows.Forms.Button buttonGetAnalog;
+ private System.Windows.Forms.Button buttonGetButtons;
+ private System.Windows.Forms.Button button4;
+ private System.Windows.Forms.Button button5;
+ private System.Windows.Forms.Button button6;
+ private System.Windows.Forms.Button button7;
+ private System.Windows.Forms.Button button8;
+ private System.Windows.Forms.Button button9;
+ private System.Windows.Forms.Button button10;
+ private System.Windows.Forms.Button button11;
+ private System.Windows.Forms.Button button12;
+ private System.Windows.Forms.Button button13;
+ private System.Windows.Forms.Button button14;
+ private System.Windows.Forms.Button button15;
+ private System.Windows.Forms.GroupBox groupBoxGetFunctions;
+ private System.Windows.Forms.GroupBox groupBoxTestFunctions;
+ private System.Windows.Forms.Button button16;
+ private System.Windows.Forms.Button button17;
+ private System.Windows.Forms.GroupBox groupBox6;
+ private System.Windows.Forms.Button buttonMotorBrush;
+ private System.Windows.Forms.GroupBox groupBoxStatus;
+ private System.Windows.Forms.Button buttonRefresh;
+ private System.Windows.Forms.ProgressBar progressBarBatteryBar;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label labelBatteryCharge;
+ private System.Windows.Forms.Button buttonSyncTime;
+ private System.Windows.Forms.Button buttonMotorRWheel;
+ private System.Windows.Forms.Button buttonMotorLWheel;
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.Button buttonMove180;
+ private System.Windows.Forms.Button buttonMoveRight;
+ private System.Windows.Forms.Button buttonMoveLeft;
+ private System.Windows.Forms.Button buttonMoveRightRotate;
+ private System.Windows.Forms.Button buttonMoveForward;
+ private System.Windows.Forms.Button buttonMoveLeftRotate;
+ private System.Windows.Forms.TextBox textBoxMoveSpeed;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.CheckBox checkBoxMoveReverse;
+ private System.Windows.Forms.Button buttonMoveStop;
+ private System.Windows.Forms.TextBox textBoxMoveDistance;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.GroupBox groupBox3;
+ private System.Windows.Forms.Label label9;
+ private System.Windows.Forms.Label labelVacuumPower;
+ private System.Windows.Forms.TrackBar trackBarVacuum;
+ private System.Windows.Forms.Button buttonVacuum;
+ private System.Windows.Forms.Label labelVacuumState;
+ private System.Windows.Forms.ComboBox comboBoxSysMode;
+ private System.Windows.Forms.Button buttonSysMode;
+ private System.ComponentModel.BackgroundWorker backgroundReader;
+ private System.Windows.Forms.Button button19;
+ }
+}
+
diff --git a/NeatoControl/MainWindow.cs b/NeatoControl/MainWindow.cs
new file mode 100644
index 0000000..c82a0ad
--- /dev/null
+++ b/NeatoControl/MainWindow.cs
@@ -0,0 +1,375 @@
+namespace NeatoTest
+{
+ using NeatoAPI;
+ using System;
+ using System.ComponentModel;
+ using System.Drawing;
+ using System.Threading;
+ using System.Windows.Forms;
+
+ public partial class MainWindow : Form
+ {
+ private Neato robot;
+
+ private bool sensorReadStarted = false;
+
+ private bool leftMotorStart = false;
+ private bool rigthMotorStart = false;
+ private bool brushMotorStart = false;
+ private bool lidarMotorStart = false;
+ private bool connectedToRobot = false;
+
+ private const string Analog = "Analog";
+ private const string Digital = "Digital";
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ comboBoxSound.DataSource = Enum.GetValues(typeof(Sounds));
+ comboBoxSysMode.DataSource = Enum.GetValues(typeof(SystemMode));
+ robot = new Neato();
+ CheckIfConnected();
+ backgroundReader.DoWork += new System.ComponentModel.DoWorkEventHandler(backgroundReader_DoWork);
+ }
+
+ private void Button1Click(object sender, EventArgs e)
+ {
+ if (connectedToRobot)
+ {
+ robot.Connection.Disconnect();
+ button1.Text = "Connect";
+ }
+ else
+ {
+ if (!robot.ConnectToNeato())
+ {
+ MessageBox.Show(
+ this,
+ "Could not find any COM ports connected to a Neato.",
+ "Connection failed",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
+ else
+ {
+ CheckTestModeGUI();
+ button1.Text = "Disconnect";
+ }
+ }
+ CheckIfConnected();
+ connectedToRobot = !connectedToRobot;
+ }
+
+ private void Button2Click(object sender, EventArgs e)
+ {
+ var flag = (Sounds)comboBoxSound.SelectedValue;
+
+ robot.Command.Misc.PlaySound(flag);
+ }
+
+ private void ButtonTestToggleClick(object sender, EventArgs e)
+ {
+ if (robot.TestMode)
+ {
+ robot.Command.Test.TestMode(TestModeState.Off);
+ }
+ else
+ {
+ robot.Command.Test.TestMode(TestModeState.On);
+ }
+
+ CheckTestModeGUI();
+ }
+
+ private void CheckTestModeGUI()
+ {
+ if (!robot.TestMode)
+ {
+ labelTestStatus.Text = "Inactive";
+ labelTestStatus.BackColor = Color.LightCoral;
+ groupBoxTestFunctions.Enabled = false;
+ }
+ else
+ {
+ labelTestStatus.Text = "Active";
+ labelTestStatus.BackColor = Color.LawnGreen;
+ groupBoxTestFunctions.Enabled = true;
+ }
+ }
+
+ private void ButtonGetAccelClick(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetAccel().GetRaw();
+ }
+
+ private void CheckIfConnected()
+ {
+ if (robot?.Connection == null || !robot.IsConnected)
+ {
+ groupBoxGetFunctions.Enabled = false;
+ groupBoxPlaySound.Enabled = false;
+ groupBoxTestMode.Enabled = false;
+ groupBoxStatus.Enabled = false;
+ if (robot?.Connection != null)
+ {
+ labelNeatoConnected.Text = "Disconnected";
+ labelNeatoConnected.BackColor = Color.LightCoral;
+ }
+ return;
+ }
+ labelNeatoConnected.Text = "Connected";
+ labelNeatoConnected.BackColor = Color.LawnGreen;
+ groupBoxGetFunctions.Enabled = true;
+ groupBoxPlaySound.Enabled = true;
+ groupBoxTestMode.Enabled = true;
+ groupBoxStatus.Enabled = true;
+ buttonRefresh.PerformClick();
+ }
+
+ private void ButtonGetAnalogClick(object sender, EventArgs e)
+ {
+ if (sensorReadStarted)
+ {
+ backgroundReader.CancelAsync();
+ buttonGetAnalog.Text = "GetAnalogSensors()";
+ }
+ else
+ {
+ if (backgroundReader.IsBusy)
+ {
+ backgroundReader.CancelAsync();
+ }
+ backgroundReader.RunWorkerAsync(Analog);
+ buttonGetAnalog.Text = "Stop!";
+ }
+ sensorReadStarted = !sensorReadStarted;
+ }
+
+ private void backgroundReader_DoWork(object sender, DoWorkEventArgs e)
+ {
+ while (!backgroundReader.CancellationPending)
+ {
+ switch (e.Argument)
+ {
+ case Analog:
+ textBoxFromNeato.Invoke((MethodInvoker)delegate
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetAnalogSensors().GetRaw();
+ });
+ break;
+
+ case Digital:
+ textBoxFromNeato.Invoke((MethodInvoker)delegate
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetDigitalSensors().GetRaw();
+ });
+ break;
+ }
+ Thread.Sleep(500);
+ }
+ }
+
+ private void ButtonGetButtonsClick(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetButtons().GetRaw();
+ }
+
+ private void Button4Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetCalInfo().GetRaw();
+ }
+
+ private void Button5Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetCharger().GetRaw();
+ }
+
+ private void Button6Click(object sender, EventArgs e)
+ {
+ if (sensorReadStarted)
+ {
+ backgroundReader.CancelAsync();
+ button6.Text = "GetDigitalSensors()";
+ }
+ else
+ {
+ if (backgroundReader.IsBusy)
+ {
+ backgroundReader.CancelAsync();
+ }
+ backgroundReader.RunWorkerAsync(Digital);
+ button6.Text = "Stop!";
+ }
+ sensorReadStarted = !sensorReadStarted;
+ }
+
+ private void Button7Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetErr().GetRaw();
+ }
+
+ private void Button8Click(object sender, EventArgs e)
+ {
+ Response res = robot.Command.GetInfo.GetLDSScan();
+ textBoxFromNeato.Text = res.GetRaw();
+ }
+
+ private void Button9Click(object sender, EventArgs e)
+ {
+ //textBoxFromNeato.Text = robot.Command.GetInfo.GetLifeStatLog().GetRaw();
+ }
+
+ private void Button10Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetMotors().GetRaw();
+ }
+
+ private void Button11Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetSchedule().GetRaw();
+ }
+
+ private void Button12Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetSysLog().GetRaw();
+ }
+
+ private void Button13Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetTime().GetRaw();
+ }
+
+ private void Button14Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetVersion().GetRaw();
+ }
+
+ private void Button15Click(object sender, EventArgs e)
+ {
+ textBoxFromNeato.Text = robot.Command.GetInfo.GetWarranty().GetRaw();
+ }
+
+ private void Button16Click(object sender, EventArgs e)
+ {
+ robot.Command.Test.DiagTest();
+ }
+
+ #region Neato Status
+
+ private void buttonRefresh_Click(object sender, EventArgs e)
+ {
+ robot.RefreshInformation();
+
+ progressBarBatteryBar.Value = robot.BatteryCharge;
+ labelBatteryCharge.Text = progressBarBatteryBar.Value + "%";
+
+ textBoxFromNeato.Text = robot.ToString();
+ }
+
+ #endregion Neato Status
+
+ private void buttonSyncTime_Click(object sender, EventArgs e)
+ {
+ robot.Command.System.SyncTime();
+ }
+
+ #region Motors
+
+ private void buttonMotorBrush_Click(object sender, EventArgs e)
+ {
+ brushMotorStart = !brushMotorStart;
+ robot.Command.Test.ToggleMotor(Motors.Brush, brushMotorStart);
+ }
+
+ private void buttonMotorLWheel_Click(object sender, EventArgs e)
+ {
+ leftMotorStart = !leftMotorStart;
+ robot.Command.Test.ToggleMotor(Motors.LeftWheel, leftMotorStart);
+ }
+
+ private void buttonMotorRWheel_Click(object sender, EventArgs e)
+ {
+ rigthMotorStart = !rigthMotorStart;
+ robot.Command.Test.ToggleMotor(Motors.RightWheel, rigthMotorStart);
+ }
+
+ #endregion Motors
+
+ #region Movement
+
+ private void buttonMoveLeftRotate_Click(object sender, EventArgs e)
+ {
+ robot.Command.Movement.LeftRotation(int.Parse(textBoxMoveSpeed.Text));
+ textBoxFromNeato.Text = robot.ToString();
+ }
+
+ private void buttonMoveRightRotate_Click(object sender, EventArgs e)
+ {
+ robot.Command.Movement.RightRotation(int.Parse(textBoxMoveSpeed.Text));
+ textBoxFromNeato.Text = robot.ToString();
+ }
+
+ private void buttonMoveForward_Click(object sender, EventArgs e)
+ {
+ robot.Command.Movement.BothWheels(int.Parse(textBoxMoveDistance.Text), int.Parse(textBoxMoveSpeed.Text), checkBoxMoveReverse.Checked);
+ textBoxFromNeato.Text = robot.ToString();
+ }
+
+ private void buttonMoveLeft_Click(object sender, EventArgs e)
+ {
+ robot.Command.Movement.LeftWheel(int.Parse(textBoxMoveDistance.Text), int.Parse(textBoxMoveSpeed.Text), checkBoxMoveReverse.Checked);
+ textBoxFromNeato.Text = robot.ToString();
+ }
+
+ private void buttonMoveRight_Click(object sender, EventArgs e)
+ {
+ robot.Command.Movement.RightWheel(int.Parse(textBoxMoveDistance.Text), int.Parse(textBoxMoveSpeed.Text), checkBoxMoveReverse.Checked);
+ textBoxFromNeato.Text = robot.ToString();
+ }
+
+ private void buttonMove180_Click(object sender, EventArgs e)
+ {
+ robot.Command.Movement.TurnAround(int.Parse(textBoxMoveSpeed.Text), checkBoxMoveReverse.Checked);
+ textBoxFromNeato.Text = robot.ToString();
+ }
+
+ private void buttonMoveStop_Click(object sender, EventArgs e)
+ {
+ robot.Command.Movement.Stop();
+ }
+
+ #endregion Movement
+
+ private void trackBarVacuum_ValueChanged(object sender, EventArgs e)
+ {
+ labelVacuumPower.Text = trackBarVacuum.Value + "%";
+ }
+
+ private void buttonVacuum_Click(object sender, EventArgs e)
+ {
+ if (labelVacuumState.Text == "Off")
+ {
+ robot.Command.Test.ToggleVacuum(true, trackBarVacuum.Value);
+ labelVacuumState.Text = "On";
+ }
+ else
+ {
+ robot.Command.Test.ToggleVacuum(false, 0);
+ labelVacuumState.Text = "Off";
+ }
+ }
+
+ private void buttonSysMode_Click(object sender, EventArgs e)
+ {
+ var flag = (SystemMode)comboBoxSysMode.SelectedValue;
+
+ robot.Command.Test.SetSystemMode(flag);
+ }
+
+ private void button19_Click(object sender, EventArgs e)
+ {
+ lidarMotorStart = !lidarMotorStart;
+ robot.Command.Test.SetLDSRotation(lidarMotorStart ? LDSRotation.On : LDSRotation.Off);
+ }
+ }
+}
\ No newline at end of file
diff --git a/NeatoControl/MainWindow.resx b/NeatoControl/MainWindow.resx
new file mode 100644
index 0000000..22d46fb
--- /dev/null
+++ b/NeatoControl/MainWindow.resx
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/NeatoControl/NeatoControl.csproj b/NeatoControl/NeatoControl.csproj
new file mode 100644
index 0000000..aad64cd
--- /dev/null
+++ b/NeatoControl/NeatoControl.csproj
@@ -0,0 +1,13 @@
+
+
+
+ WinExe
+ net5.0-windows
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NeatoTest/Program.cs b/NeatoControl/Program.cs
similarity index 73%
rename from NeatoTest/Program.cs
rename to NeatoControl/Program.cs
index 63b6c96..85f0c29 100644
--- a/NeatoTest/Program.cs
+++ b/NeatoControl/Program.cs
@@ -3,17 +3,17 @@
namespace NeatoTest
{
- static class Program
+ internal static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
- static void Main()
+ private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
+ Application.Run(new MainWindow());
}
}
-}
+}
\ No newline at end of file
diff --git a/NeatoTest/Form1.Designer.cs b/NeatoTest/Form1.Designer.cs
deleted file mode 100644
index 581c154..0000000
--- a/NeatoTest/Form1.Designer.cs
+++ /dev/null
@@ -1,956 +0,0 @@
-namespace NeatoTest
-{
- partial class Form1
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (this.components != null))
- {
- this.components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.labelNeatoConnected = new System.Windows.Forms.Label();
- this.comboBoxSound = new System.Windows.Forms.ComboBox();
- this.groupBoxPlaySound = new System.Windows.Forms.GroupBox();
- this.label2 = new System.Windows.Forms.Label();
- this.groupBoxTestMode = new System.Windows.Forms.GroupBox();
- this.labelTestStatus = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.buttonTestToggle = new System.Windows.Forms.Button();
- this.textBoxFromNeato = new System.Windows.Forms.TextBox();
- this.label5 = new System.Windows.Forms.Label();
- this.buttonGetAccel = new System.Windows.Forms.Button();
- this.buttonGetAnalog = new System.Windows.Forms.Button();
- this.buttonGetButtons = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.button6 = new System.Windows.Forms.Button();
- this.button7 = new System.Windows.Forms.Button();
- this.button8 = new System.Windows.Forms.Button();
- this.button9 = new System.Windows.Forms.Button();
- this.button10 = new System.Windows.Forms.Button();
- this.button11 = new System.Windows.Forms.Button();
- this.button12 = new System.Windows.Forms.Button();
- this.button13 = new System.Windows.Forms.Button();
- this.button14 = new System.Windows.Forms.Button();
- this.button15 = new System.Windows.Forms.Button();
- this.groupBoxGetFunctions = new System.Windows.Forms.GroupBox();
- this.groupBoxTestFunctions = new System.Windows.Forms.GroupBox();
- this.comboBoxSysMode = new System.Windows.Forms.ComboBox();
- this.buttonSysMode = new System.Windows.Forms.Button();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.labelVacuumState = new System.Windows.Forms.Label();
- this.buttonVacuum = new System.Windows.Forms.Button();
- this.label9 = new System.Windows.Forms.Label();
- this.labelVacuumPower = new System.Windows.Forms.Label();
- this.trackBarVacuum = new System.Windows.Forms.TrackBar();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.textBoxMoveDistance = new System.Windows.Forms.TextBox();
- this.label7 = new System.Windows.Forms.Label();
- this.buttonMoveStop = new System.Windows.Forms.Button();
- this.textBoxMoveSpeed = new System.Windows.Forms.TextBox();
- this.label6 = new System.Windows.Forms.Label();
- this.checkBoxMoveReverse = new System.Windows.Forms.CheckBox();
- this.buttonMove180 = new System.Windows.Forms.Button();
- this.buttonMoveRight = new System.Windows.Forms.Button();
- this.buttonMoveLeft = new System.Windows.Forms.Button();
- this.buttonMoveRightRotate = new System.Windows.Forms.Button();
- this.buttonMoveForward = new System.Windows.Forms.Button();
- this.buttonMoveLeftRotate = new System.Windows.Forms.Button();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.checkBoxMotorRWheel = new System.Windows.Forms.CheckBox();
- this.checkBoxMotorLWheel = new System.Windows.Forms.CheckBox();
- this.checkBoxMotorBrush = new System.Windows.Forms.CheckBox();
- this.buttonMotorRWheel = new System.Windows.Forms.Button();
- this.buttonMotorLWheel = new System.Windows.Forms.Button();
- this.buttonMotorBrush = new System.Windows.Forms.Button();
- this.comboBoxLDSRotationFlag = new System.Windows.Forms.ComboBox();
- this.button18 = new System.Windows.Forms.Button();
- this.button17 = new System.Windows.Forms.Button();
- this.button16 = new System.Windows.Forms.Button();
- this.groupBoxStatus = new System.Windows.Forms.GroupBox();
- this.buttonSyncTime = new System.Windows.Forms.Button();
- this.labelBatteryCharge = new System.Windows.Forms.Label();
- this.buttonRefresh = new System.Windows.Forms.Button();
- this.progressBarBatteryBar = new System.Windows.Forms.ProgressBar();
- this.label4 = new System.Windows.Forms.Label();
- this.groupBox1.SuspendLayout();
- this.groupBoxPlaySound.SuspendLayout();
- this.groupBoxTestMode.SuspendLayout();
- this.groupBoxGetFunctions.SuspendLayout();
- this.groupBoxTestFunctions.SuspendLayout();
- this.groupBox3.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBarVacuum)).BeginInit();
- this.groupBox2.SuspendLayout();
- this.groupBox6.SuspendLayout();
- this.groupBoxStatus.SuspendLayout();
- this.SuspendLayout();
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(6, 42);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(97, 23);
- this.button1.TabIndex = 0;
- this.button1.Text = "Connect Neato";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.Button1Click);
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(6, 68);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(151, 23);
- this.button2.TabIndex = 1;
- this.button2.Text = "PlaySound";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.Button2Click);
- //
- // button3
- //
- this.button3.Enabled = false;
- this.button3.Location = new System.Drawing.Point(6, 71);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(97, 23);
- this.button3.TabIndex = 2;
- this.button3.Text = "Disconnect";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.Button3Click);
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.labelNeatoConnected);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Controls.Add(this.button3);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(109, 100);
- this.groupBox1.TabIndex = 3;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "Neato Connection";
- //
- // labelNeatoConnected
- //
- this.labelNeatoConnected.AutoSize = true;
- this.labelNeatoConnected.BackColor = System.Drawing.Color.LightCoral;
- this.labelNeatoConnected.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.labelNeatoConnected.Location = new System.Drawing.Point(8, 18);
- this.labelNeatoConnected.Name = "labelNeatoConnected";
- this.labelNeatoConnected.Size = new System.Drawing.Size(75, 15);
- this.labelNeatoConnected.TabIndex = 9;
- this.labelNeatoConnected.Text = "Disconnected";
- //
- // comboBoxSound
- //
- this.comboBoxSound.FormattingEnabled = true;
- this.comboBoxSound.Location = new System.Drawing.Point(6, 39);
- this.comboBoxSound.Name = "comboBoxSound";
- this.comboBoxSound.Size = new System.Drawing.Size(151, 21);
- this.comboBoxSound.TabIndex = 6;
- //
- // groupBoxPlaySound
- //
- this.groupBoxPlaySound.Controls.Add(this.label2);
- this.groupBoxPlaySound.Controls.Add(this.comboBoxSound);
- this.groupBoxPlaySound.Controls.Add(this.button2);
- this.groupBoxPlaySound.Location = new System.Drawing.Point(127, 12);
- this.groupBoxPlaySound.Name = "groupBoxPlaySound";
- this.groupBoxPlaySound.Size = new System.Drawing.Size(163, 100);
- this.groupBoxPlaySound.TabIndex = 7;
- this.groupBoxPlaySound.TabStop = false;
- this.groupBoxPlaySound.Text = "Play Sound";
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(7, 20);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(38, 13);
- this.label2.TabIndex = 7;
- this.label2.Text = "Sound";
- //
- // groupBoxTestMode
- //
- this.groupBoxTestMode.Controls.Add(this.labelTestStatus);
- this.groupBoxTestMode.Controls.Add(this.label3);
- this.groupBoxTestMode.Controls.Add(this.buttonTestToggle);
- this.groupBoxTestMode.Location = new System.Drawing.Point(296, 12);
- this.groupBoxTestMode.Name = "groupBoxTestMode";
- this.groupBoxTestMode.Size = new System.Drawing.Size(214, 62);
- this.groupBoxTestMode.TabIndex = 8;
- this.groupBoxTestMode.TabStop = false;
- this.groupBoxTestMode.Text = "Test Mode";
- //
- // labelTestStatus
- //
- this.labelTestStatus.AutoSize = true;
- this.labelTestStatus.BackColor = System.Drawing.Color.LightCoral;
- this.labelTestStatus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.labelTestStatus.Location = new System.Drawing.Point(156, 29);
- this.labelTestStatus.Name = "labelTestStatus";
- this.labelTestStatus.Size = new System.Drawing.Size(47, 15);
- this.labelTestStatus.TabIndex = 2;
- this.labelTestStatus.Text = "Inactive";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(87, 29);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(73, 13);
- this.label3.TabIndex = 1;
- this.label3.Text = "Test mode is: ";
- //
- // buttonTestToggle
- //
- this.buttonTestToggle.Location = new System.Drawing.Point(7, 24);
- this.buttonTestToggle.Name = "buttonTestToggle";
- this.buttonTestToggle.Size = new System.Drawing.Size(75, 23);
- this.buttonTestToggle.TabIndex = 0;
- this.buttonTestToggle.Text = "Toggle";
- this.buttonTestToggle.UseVisualStyleBackColor = true;
- this.buttonTestToggle.Click += new System.EventHandler(this.ButtonTestToggleClick);
- //
- // textBoxFromNeato
- //
- this.textBoxFromNeato.Enabled = false;
- this.textBoxFromNeato.Location = new System.Drawing.Point(12, 131);
- this.textBoxFromNeato.Multiline = true;
- this.textBoxFromNeato.Name = "textBoxFromNeato";
- this.textBoxFromNeato.Size = new System.Drawing.Size(278, 322);
- this.textBoxFromNeato.TabIndex = 10;
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(12, 115);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(83, 13);
- this.label5.TabIndex = 12;
- this.label5.Text = "Text from Neato";
- //
- // buttonGetAccel
- //
- this.buttonGetAccel.Location = new System.Drawing.Point(6, 19);
- this.buttonGetAccel.Name = "buttonGetAccel";
- this.buttonGetAccel.Size = new System.Drawing.Size(111, 23);
- this.buttonGetAccel.TabIndex = 13;
- this.buttonGetAccel.Text = "GetAccel()";
- this.buttonGetAccel.UseVisualStyleBackColor = true;
- this.buttonGetAccel.Click += new System.EventHandler(this.ButtonGetAccelClick);
- //
- // buttonGetAnalog
- //
- this.buttonGetAnalog.Location = new System.Drawing.Point(6, 48);
- this.buttonGetAnalog.Name = "buttonGetAnalog";
- this.buttonGetAnalog.Size = new System.Drawing.Size(111, 23);
- this.buttonGetAnalog.TabIndex = 14;
- this.buttonGetAnalog.Text = "GetAnalogSensors()";
- this.buttonGetAnalog.UseVisualStyleBackColor = true;
- this.buttonGetAnalog.Click += new System.EventHandler(this.ButtonGetAnalogClick);
- //
- // buttonGetButtons
- //
- this.buttonGetButtons.Location = new System.Drawing.Point(6, 77);
- this.buttonGetButtons.Name = "buttonGetButtons";
- this.buttonGetButtons.Size = new System.Drawing.Size(111, 23);
- this.buttonGetButtons.TabIndex = 15;
- this.buttonGetButtons.Text = "GetButtons()";
- this.buttonGetButtons.UseVisualStyleBackColor = true;
- this.buttonGetButtons.Click += new System.EventHandler(this.ButtonGetButtonsClick);
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(6, 106);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(111, 23);
- this.button4.TabIndex = 16;
- this.button4.Text = "GetCalInfo()";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.Button4Click);
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(6, 135);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(111, 23);
- this.button5.TabIndex = 17;
- this.button5.Text = "GetCharger()";
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.Button5Click);
- //
- // button6
- //
- this.button6.Location = new System.Drawing.Point(6, 164);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(111, 23);
- this.button6.TabIndex = 18;
- this.button6.Text = "GetDigitalSensors()";
- this.button6.UseVisualStyleBackColor = true;
- this.button6.Click += new System.EventHandler(this.Button6Click);
- //
- // button7
- //
- this.button7.Location = new System.Drawing.Point(6, 193);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(111, 23);
- this.button7.TabIndex = 19;
- this.button7.Text = "GetErr()";
- this.button7.UseVisualStyleBackColor = true;
- this.button7.Click += new System.EventHandler(this.Button7Click);
- //
- // button8
- //
- this.button8.Location = new System.Drawing.Point(6, 222);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(228, 23);
- this.button8.TabIndex = 20;
- this.button8.Text = "GetLDSScan()";
- this.button8.UseVisualStyleBackColor = true;
- this.button8.Click += new System.EventHandler(this.Button8Click);
- //
- // button9
- //
- this.button9.Location = new System.Drawing.Point(123, 19);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(111, 23);
- this.button9.TabIndex = 21;
- this.button9.Text = "GetLifeStatLog()";
- this.button9.UseVisualStyleBackColor = true;
- this.button9.Click += new System.EventHandler(this.Button9Click);
- //
- // button10
- //
- this.button10.Location = new System.Drawing.Point(123, 48);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(111, 23);
- this.button10.TabIndex = 22;
- this.button10.Text = "GetMotors()";
- this.button10.UseVisualStyleBackColor = true;
- this.button10.Click += new System.EventHandler(this.Button10Click);
- //
- // button11
- //
- this.button11.Location = new System.Drawing.Point(123, 77);
- this.button11.Name = "button11";
- this.button11.Size = new System.Drawing.Size(111, 23);
- this.button11.TabIndex = 23;
- this.button11.Text = "GetSchedule()";
- this.button11.UseVisualStyleBackColor = true;
- this.button11.Click += new System.EventHandler(this.Button11Click);
- //
- // button12
- //
- this.button12.Location = new System.Drawing.Point(123, 106);
- this.button12.Name = "button12";
- this.button12.Size = new System.Drawing.Size(111, 23);
- this.button12.TabIndex = 24;
- this.button12.Text = "GetSysLog()";
- this.button12.UseVisualStyleBackColor = true;
- this.button12.Click += new System.EventHandler(this.Button12Click);
- //
- // button13
- //
- this.button13.Location = new System.Drawing.Point(123, 135);
- this.button13.Name = "button13";
- this.button13.Size = new System.Drawing.Size(111, 23);
- this.button13.TabIndex = 25;
- this.button13.Text = "GetTime()";
- this.button13.UseVisualStyleBackColor = true;
- this.button13.Click += new System.EventHandler(this.Button13Click);
- //
- // button14
- //
- this.button14.Location = new System.Drawing.Point(123, 164);
- this.button14.Name = "button14";
- this.button14.Size = new System.Drawing.Size(111, 23);
- this.button14.TabIndex = 26;
- this.button14.Text = "GetVersion()";
- this.button14.UseVisualStyleBackColor = true;
- this.button14.Click += new System.EventHandler(this.Button14Click);
- //
- // button15
- //
- this.button15.Location = new System.Drawing.Point(123, 193);
- this.button15.Name = "button15";
- this.button15.Size = new System.Drawing.Size(111, 23);
- this.button15.TabIndex = 27;
- this.button15.Text = "GetWarranty()";
- this.button15.UseVisualStyleBackColor = true;
- this.button15.Click += new System.EventHandler(this.Button15Click);
- //
- // groupBoxGetFunctions
- //
- this.groupBoxGetFunctions.Controls.Add(this.button15);
- this.groupBoxGetFunctions.Controls.Add(this.button14);
- this.groupBoxGetFunctions.Controls.Add(this.button13);
- this.groupBoxGetFunctions.Controls.Add(this.button12);
- this.groupBoxGetFunctions.Controls.Add(this.button11);
- this.groupBoxGetFunctions.Controls.Add(this.button10);
- this.groupBoxGetFunctions.Controls.Add(this.button9);
- this.groupBoxGetFunctions.Controls.Add(this.button8);
- this.groupBoxGetFunctions.Controls.Add(this.button7);
- this.groupBoxGetFunctions.Controls.Add(this.button6);
- this.groupBoxGetFunctions.Controls.Add(this.button5);
- this.groupBoxGetFunctions.Controls.Add(this.button4);
- this.groupBoxGetFunctions.Controls.Add(this.buttonGetButtons);
- this.groupBoxGetFunctions.Controls.Add(this.buttonGetAnalog);
- this.groupBoxGetFunctions.Controls.Add(this.buttonGetAccel);
- this.groupBoxGetFunctions.Location = new System.Drawing.Point(764, 164);
- this.groupBoxGetFunctions.Name = "groupBoxGetFunctions";
- this.groupBoxGetFunctions.Size = new System.Drawing.Size(242, 252);
- this.groupBoxGetFunctions.TabIndex = 28;
- this.groupBoxGetFunctions.TabStop = false;
- this.groupBoxGetFunctions.Text = "Get functions";
- //
- // groupBoxTestFunctions
- //
- this.groupBoxTestFunctions.Controls.Add(this.comboBoxSysMode);
- this.groupBoxTestFunctions.Controls.Add(this.buttonSysMode);
- this.groupBoxTestFunctions.Controls.Add(this.groupBox3);
- this.groupBoxTestFunctions.Controls.Add(this.groupBox2);
- this.groupBoxTestFunctions.Controls.Add(this.groupBox6);
- this.groupBoxTestFunctions.Controls.Add(this.comboBoxLDSRotationFlag);
- this.groupBoxTestFunctions.Controls.Add(this.button18);
- this.groupBoxTestFunctions.Controls.Add(this.button17);
- this.groupBoxTestFunctions.Controls.Add(this.button16);
- this.groupBoxTestFunctions.Enabled = false;
- this.groupBoxTestFunctions.Location = new System.Drawing.Point(297, 80);
- this.groupBoxTestFunctions.Name = "groupBoxTestFunctions";
- this.groupBoxTestFunctions.Size = new System.Drawing.Size(429, 373);
- this.groupBoxTestFunctions.TabIndex = 30;
- this.groupBoxTestFunctions.TabStop = false;
- this.groupBoxTestFunctions.Text = "Test functions";
- //
- // comboBoxSysMode
- //
- this.comboBoxSysMode.FormattingEnabled = true;
- this.comboBoxSysMode.Location = new System.Drawing.Point(105, 106);
- this.comboBoxSysMode.Name = "comboBoxSysMode";
- this.comboBoxSysMode.Size = new System.Drawing.Size(102, 21);
- this.comboBoxSysMode.TabIndex = 14;
- //
- // buttonSysMode
- //
- this.buttonSysMode.Location = new System.Drawing.Point(6, 106);
- this.buttonSysMode.Name = "buttonSysMode";
- this.buttonSysMode.Size = new System.Drawing.Size(93, 23);
- this.buttonSysMode.TabIndex = 13;
- this.buttonSysMode.Text = "SystemMode";
- this.buttonSysMode.UseVisualStyleBackColor = true;
- this.buttonSysMode.Click += new System.EventHandler(this.buttonSysMode_Click);
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.labelVacuumState);
- this.groupBox3.Controls.Add(this.buttonVacuum);
- this.groupBox3.Controls.Add(this.label9);
- this.groupBox3.Controls.Add(this.labelVacuumPower);
- this.groupBox3.Controls.Add(this.trackBarVacuum);
- this.groupBox3.Location = new System.Drawing.Point(7, 154);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(200, 103);
- this.groupBox3.TabIndex = 12;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "Vacuum";
- //
- // labelVacuumState
- //
- this.labelVacuumState.AutoSize = true;
- this.labelVacuumState.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.labelVacuumState.Location = new System.Drawing.Point(125, 23);
- this.labelVacuumState.Name = "labelVacuumState";
- this.labelVacuumState.Size = new System.Drawing.Size(23, 15);
- this.labelVacuumState.TabIndex = 4;
- this.labelVacuumState.Text = "Off";
- //
- // buttonVacuum
- //
- this.buttonVacuum.Location = new System.Drawing.Point(6, 19);
- this.buttonVacuum.Name = "buttonVacuum";
- this.buttonVacuum.Size = new System.Drawing.Size(97, 23);
- this.buttonVacuum.TabIndex = 3;
- this.buttonVacuum.Text = "Toggle vacuum";
- this.buttonVacuum.UseVisualStyleBackColor = true;
- this.buttonVacuum.Click += new System.EventHandler(this.buttonVacuum_Click);
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(6, 80);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(113, 13);
- this.label9.TabIndex = 2;
- this.label9.Text = "Vacuum motor power: ";
- //
- // labelVacuumPower
- //
- this.labelVacuumPower.AutoSize = true;
- this.labelVacuumPower.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.labelVacuumPower.Location = new System.Drawing.Point(125, 80);
- this.labelVacuumPower.Name = "labelVacuumPower";
- this.labelVacuumPower.Size = new System.Drawing.Size(29, 15);
- this.labelVacuumPower.TabIndex = 1;
- this.labelVacuumPower.Text = "90%";
- //
- // trackBarVacuum
- //
- this.trackBarVacuum.Location = new System.Drawing.Point(0, 42);
- this.trackBarVacuum.Maximum = 100;
- this.trackBarVacuum.Name = "trackBarVacuum";
- this.trackBarVacuum.Size = new System.Drawing.Size(200, 45);
- this.trackBarVacuum.TabIndex = 0;
- this.trackBarVacuum.TickFrequency = 10;
- this.trackBarVacuum.Value = 90;
- this.trackBarVacuum.ValueChanged += new System.EventHandler(this.trackBarVacuum_ValueChanged);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.textBoxMoveDistance);
- this.groupBox2.Controls.Add(this.label7);
- this.groupBox2.Controls.Add(this.buttonMoveStop);
- this.groupBox2.Controls.Add(this.textBoxMoveSpeed);
- this.groupBox2.Controls.Add(this.label6);
- this.groupBox2.Controls.Add(this.checkBoxMoveReverse);
- this.groupBox2.Controls.Add(this.buttonMove180);
- this.groupBox2.Controls.Add(this.buttonMoveRight);
- this.groupBox2.Controls.Add(this.buttonMoveLeft);
- this.groupBox2.Controls.Add(this.buttonMoveRightRotate);
- this.groupBox2.Controls.Add(this.buttonMoveForward);
- this.groupBox2.Controls.Add(this.buttonMoveLeftRotate);
- this.groupBox2.Location = new System.Drawing.Point(223, 10);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(200, 145);
- this.groupBox2.TabIndex = 11;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "Movement";
- //
- // textBoxMoveDistance
- //
- this.textBoxMoveDistance.Location = new System.Drawing.Point(124, 112);
- this.textBoxMoveDistance.Name = "textBoxMoveDistance";
- this.textBoxMoveDistance.Size = new System.Drawing.Size(69, 20);
- this.textBoxMoveDistance.TabIndex = 15;
- this.textBoxMoveDistance.Text = "50";
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(121, 95);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(74, 13);
- this.label7.TabIndex = 14;
- this.label7.Text = "Distance (mm)";
- //
- // buttonMoveStop
- //
- this.buttonMoveStop.BackColor = System.Drawing.Color.Red;
- this.buttonMoveStop.Location = new System.Drawing.Point(44, 57);
- this.buttonMoveStop.Name = "buttonMoveStop";
- this.buttonMoveStop.Size = new System.Drawing.Size(32, 32);
- this.buttonMoveStop.TabIndex = 13;
- this.buttonMoveStop.Text = "S";
- this.buttonMoveStop.UseVisualStyleBackColor = false;
- this.buttonMoveStop.Click += new System.EventHandler(this.buttonMoveStop_Click);
- //
- // textBoxMoveSpeed
- //
- this.textBoxMoveSpeed.Location = new System.Drawing.Point(124, 61);
- this.textBoxMoveSpeed.Name = "textBoxMoveSpeed";
- this.textBoxMoveSpeed.Size = new System.Drawing.Size(69, 20);
- this.textBoxMoveSpeed.TabIndex = 12;
- this.textBoxMoveSpeed.Text = "50";
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(121, 44);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(73, 13);
- this.label6.TabIndex = 11;
- this.label6.Text = "Speed (mm/s)";
- //
- // checkBoxMoveReverse
- //
- this.checkBoxMoveReverse.AutoSize = true;
- this.checkBoxMoveReverse.Location = new System.Drawing.Point(121, 20);
- this.checkBoxMoveReverse.Name = "checkBoxMoveReverse";
- this.checkBoxMoveReverse.Size = new System.Drawing.Size(72, 17);
- this.checkBoxMoveReverse.TabIndex = 10;
- this.checkBoxMoveReverse.Text = "Reverse?";
- this.checkBoxMoveReverse.UseVisualStyleBackColor = true;
- //
- // buttonMove180
- //
- this.buttonMove180.Location = new System.Drawing.Point(6, 105);
- this.buttonMove180.Name = "buttonMove180";
- this.buttonMove180.Size = new System.Drawing.Size(106, 32);
- this.buttonMove180.TabIndex = 9;
- this.buttonMove180.Tag = "";
- this.buttonMove180.Text = "180";
- this.buttonMove180.UseVisualStyleBackColor = true;
- this.buttonMove180.Click += new System.EventHandler(this.buttonMove180_Click);
- //
- // buttonMoveRight
- //
- this.buttonMoveRight.Location = new System.Drawing.Point(82, 57);
- this.buttonMoveRight.Name = "buttonMoveRight";
- this.buttonMoveRight.Size = new System.Drawing.Size(32, 32);
- this.buttonMoveRight.TabIndex = 7;
- this.buttonMoveRight.Text = "R";
- this.buttonMoveRight.UseVisualStyleBackColor = true;
- this.buttonMoveRight.Click += new System.EventHandler(this.buttonMoveRight_Click);
- //
- // buttonMoveLeft
- //
- this.buttonMoveLeft.Location = new System.Drawing.Point(6, 57);
- this.buttonMoveLeft.Name = "buttonMoveLeft";
- this.buttonMoveLeft.Size = new System.Drawing.Size(32, 32);
- this.buttonMoveLeft.TabIndex = 5;
- this.buttonMoveLeft.Text = "L";
- this.buttonMoveLeft.UseVisualStyleBackColor = true;
- this.buttonMoveLeft.Click += new System.EventHandler(this.buttonMoveLeft_Click);
- //
- // buttonMoveRightRotate
- //
- this.buttonMoveRightRotate.Location = new System.Drawing.Point(82, 19);
- this.buttonMoveRightRotate.Name = "buttonMoveRightRotate";
- this.buttonMoveRightRotate.Size = new System.Drawing.Size(32, 32);
- this.buttonMoveRightRotate.TabIndex = 4;
- this.buttonMoveRightRotate.Text = "/";
- this.buttonMoveRightRotate.UseVisualStyleBackColor = true;
- this.buttonMoveRightRotate.Click += new System.EventHandler(this.buttonMoveRightRotate_Click);
- //
- // buttonMoveForward
- //
- this.buttonMoveForward.Location = new System.Drawing.Point(44, 19);
- this.buttonMoveForward.Name = "buttonMoveForward";
- this.buttonMoveForward.Size = new System.Drawing.Size(32, 32);
- this.buttonMoveForward.TabIndex = 3;
- this.buttonMoveForward.Text = "B";
- this.buttonMoveForward.UseVisualStyleBackColor = true;
- this.buttonMoveForward.Click += new System.EventHandler(this.buttonMoveForward_Click);
- //
- // buttonMoveLeftRotate
- //
- this.buttonMoveLeftRotate.Location = new System.Drawing.Point(6, 19);
- this.buttonMoveLeftRotate.Name = "buttonMoveLeftRotate";
- this.buttonMoveLeftRotate.Size = new System.Drawing.Size(32, 32);
- this.buttonMoveLeftRotate.TabIndex = 2;
- this.buttonMoveLeftRotate.Text = "\\";
- this.buttonMoveLeftRotate.UseVisualStyleBackColor = true;
- this.buttonMoveLeftRotate.Click += new System.EventHandler(this.buttonMoveLeftRotate_Click);
- //
- // groupBox6
- //
- this.groupBox6.Controls.Add(this.checkBoxMotorRWheel);
- this.groupBox6.Controls.Add(this.checkBoxMotorLWheel);
- this.groupBox6.Controls.Add(this.checkBoxMotorBrush);
- this.groupBox6.Controls.Add(this.buttonMotorRWheel);
- this.groupBox6.Controls.Add(this.buttonMotorLWheel);
- this.groupBox6.Controls.Add(this.buttonMotorBrush);
- this.groupBox6.Location = new System.Drawing.Point(222, 161);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(113, 107);
- this.groupBox6.TabIndex = 10;
- this.groupBox6.TabStop = false;
- this.groupBox6.Text = "Toggle Motors";
- //
- // checkBoxMotorRWheel
- //
- this.checkBoxMotorRWheel.AutoSize = true;
- this.checkBoxMotorRWheel.Checked = true;
- this.checkBoxMotorRWheel.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBoxMotorRWheel.Enabled = false;
- this.checkBoxMotorRWheel.Location = new System.Drawing.Point(87, 82);
- this.checkBoxMotorRWheel.Name = "checkBoxMotorRWheel";
- this.checkBoxMotorRWheel.Size = new System.Drawing.Size(15, 14);
- this.checkBoxMotorRWheel.TabIndex = 7;
- this.checkBoxMotorRWheel.UseVisualStyleBackColor = true;
- //
- // checkBoxMotorLWheel
- //
- this.checkBoxMotorLWheel.AutoSize = true;
- this.checkBoxMotorLWheel.Checked = true;
- this.checkBoxMotorLWheel.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBoxMotorLWheel.Enabled = false;
- this.checkBoxMotorLWheel.Location = new System.Drawing.Point(87, 53);
- this.checkBoxMotorLWheel.Name = "checkBoxMotorLWheel";
- this.checkBoxMotorLWheel.Size = new System.Drawing.Size(15, 14);
- this.checkBoxMotorLWheel.TabIndex = 6;
- this.checkBoxMotorLWheel.UseVisualStyleBackColor = true;
- //
- // checkBoxMotorBrush
- //
- this.checkBoxMotorBrush.AutoSize = true;
- this.checkBoxMotorBrush.Checked = true;
- this.checkBoxMotorBrush.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBoxMotorBrush.Enabled = false;
- this.checkBoxMotorBrush.Location = new System.Drawing.Point(88, 24);
- this.checkBoxMotorBrush.Name = "checkBoxMotorBrush";
- this.checkBoxMotorBrush.Size = new System.Drawing.Size(15, 14);
- this.checkBoxMotorBrush.TabIndex = 4;
- this.checkBoxMotorBrush.UseVisualStyleBackColor = true;
- //
- // buttonMotorRWheel
- //
- this.buttonMotorRWheel.Location = new System.Drawing.Point(6, 77);
- this.buttonMotorRWheel.Name = "buttonMotorRWheel";
- this.buttonMotorRWheel.Size = new System.Drawing.Size(75, 23);
- this.buttonMotorRWheel.TabIndex = 3;
- this.buttonMotorRWheel.Text = "Right Wheel";
- this.buttonMotorRWheel.UseVisualStyleBackColor = true;
- this.buttonMotorRWheel.Click += new System.EventHandler(this.buttonMotorRWheel_Click);
- //
- // buttonMotorLWheel
- //
- this.buttonMotorLWheel.Location = new System.Drawing.Point(6, 48);
- this.buttonMotorLWheel.Name = "buttonMotorLWheel";
- this.buttonMotorLWheel.Size = new System.Drawing.Size(75, 23);
- this.buttonMotorLWheel.TabIndex = 2;
- this.buttonMotorLWheel.Text = "Left Wheel";
- this.buttonMotorLWheel.UseVisualStyleBackColor = true;
- this.buttonMotorLWheel.Click += new System.EventHandler(this.buttonMotorLWheel_Click);
- //
- // buttonMotorBrush
- //
- this.buttonMotorBrush.Location = new System.Drawing.Point(7, 19);
- this.buttonMotorBrush.Name = "buttonMotorBrush";
- this.buttonMotorBrush.Size = new System.Drawing.Size(75, 23);
- this.buttonMotorBrush.TabIndex = 0;
- this.buttonMotorBrush.Text = "Brush";
- this.buttonMotorBrush.UseVisualStyleBackColor = true;
- this.buttonMotorBrush.Click += new System.EventHandler(this.buttonMotorBrush_Click);
- //
- // comboBoxLDSRotationFlag
- //
- this.comboBoxLDSRotationFlag.FormattingEnabled = true;
- this.comboBoxLDSRotationFlag.Location = new System.Drawing.Point(105, 77);
- this.comboBoxLDSRotationFlag.Name = "comboBoxLDSRotationFlag";
- this.comboBoxLDSRotationFlag.Size = new System.Drawing.Size(102, 21);
- this.comboBoxLDSRotationFlag.TabIndex = 9;
- //
- // button18
- //
- this.button18.Location = new System.Drawing.Point(6, 77);
- this.button18.Name = "button18";
- this.button18.Size = new System.Drawing.Size(93, 23);
- this.button18.TabIndex = 3;
- this.button18.Text = "SetLDSRotation";
- this.button18.UseVisualStyleBackColor = true;
- this.button18.Click += new System.EventHandler(this.Button18Click);
- //
- // button17
- //
- this.button17.Location = new System.Drawing.Point(6, 48);
- this.button17.Name = "button17";
- this.button17.Size = new System.Drawing.Size(93, 23);
- this.button17.TabIndex = 4;
- this.button17.Text = "SetLCD()";
- this.button17.UseVisualStyleBackColor = true;
- //
- // button16
- //
- this.button16.Location = new System.Drawing.Point(6, 19);
- this.button16.Name = "button16";
- this.button16.Size = new System.Drawing.Size(93, 23);
- this.button16.TabIndex = 3;
- this.button16.Text = "DiagTest()";
- this.button16.UseVisualStyleBackColor = true;
- this.button16.Click += new System.EventHandler(this.Button16Click);
- //
- // groupBoxStatus
- //
- this.groupBoxStatus.Controls.Add(this.buttonSyncTime);
- this.groupBoxStatus.Controls.Add(this.labelBatteryCharge);
- this.groupBoxStatus.Controls.Add(this.buttonRefresh);
- this.groupBoxStatus.Controls.Add(this.progressBarBatteryBar);
- this.groupBoxStatus.Controls.Add(this.label4);
- this.groupBoxStatus.Location = new System.Drawing.Point(764, 12);
- this.groupBoxStatus.Name = "groupBoxStatus";
- this.groupBoxStatus.Size = new System.Drawing.Size(242, 146);
- this.groupBoxStatus.TabIndex = 31;
- this.groupBoxStatus.TabStop = false;
- this.groupBoxStatus.Text = "Neato Status";
- //
- // buttonSyncTime
- //
- this.buttonSyncTime.Location = new System.Drawing.Point(83, 107);
- this.buttonSyncTime.Name = "buttonSyncTime";
- this.buttonSyncTime.Size = new System.Drawing.Size(75, 23);
- this.buttonSyncTime.TabIndex = 32;
- this.buttonSyncTime.Text = "SyncTime()";
- this.buttonSyncTime.UseVisualStyleBackColor = true;
- this.buttonSyncTime.Click += new System.EventHandler(this.buttonSyncTime_Click);
- //
- // labelBatteryCharge
- //
- this.labelBatteryCharge.AutoSize = true;
- this.labelBatteryCharge.Location = new System.Drawing.Point(80, 54);
- this.labelBatteryCharge.Name = "labelBatteryCharge";
- this.labelBatteryCharge.Size = new System.Drawing.Size(37, 13);
- this.labelBatteryCharge.TabIndex = 3;
- this.labelBatteryCharge.Text = "NaN%";
- //
- // buttonRefresh
- //
- this.buttonRefresh.Location = new System.Drawing.Point(7, 20);
- this.buttonRefresh.Name = "buttonRefresh";
- this.buttonRefresh.Size = new System.Drawing.Size(227, 23);
- this.buttonRefresh.TabIndex = 2;
- this.buttonRefresh.Text = "Refresh";
- this.buttonRefresh.UseVisualStyleBackColor = true;
- this.buttonRefresh.Click += new System.EventHandler(this.buttonRefresh_Click);
- //
- // progressBarBatteryBar
- //
- this.progressBarBatteryBar.Location = new System.Drawing.Point(5, 70);
- this.progressBarBatteryBar.MarqueeAnimationSpeed = 50;
- this.progressBarBatteryBar.Name = "progressBarBatteryBar";
- this.progressBarBatteryBar.Size = new System.Drawing.Size(229, 22);
- this.progressBarBatteryBar.Step = 5;
- this.progressBarBatteryBar.TabIndex = 1;
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(6, 54);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(68, 13);
- this.label4.TabIndex = 0;
- this.label4.Text = "Battery level:";
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1139, 608);
- this.Controls.Add(this.groupBoxStatus);
- this.Controls.Add(this.groupBoxTestFunctions);
- this.Controls.Add(this.groupBoxGetFunctions);
- this.Controls.Add(this.label5);
- this.Controls.Add(this.textBoxFromNeato);
- this.Controls.Add(this.groupBoxTestMode);
- this.Controls.Add(this.groupBoxPlaySound);
- this.Controls.Add(this.groupBox1);
- this.Name = "Form1";
- this.Text = "Neato API Test application";
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBoxPlaySound.ResumeLayout(false);
- this.groupBoxPlaySound.PerformLayout();
- this.groupBoxTestMode.ResumeLayout(false);
- this.groupBoxTestMode.PerformLayout();
- this.groupBoxGetFunctions.ResumeLayout(false);
- this.groupBoxTestFunctions.ResumeLayout(false);
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBarVacuum)).EndInit();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.groupBox6.ResumeLayout(false);
- this.groupBox6.PerformLayout();
- this.groupBoxStatus.ResumeLayout(false);
- this.groupBoxStatus.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.ComboBox comboBoxSound;
- private System.Windows.Forms.GroupBox groupBoxPlaySound;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.GroupBox groupBoxTestMode;
- private System.Windows.Forms.Label labelTestStatus;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Button buttonTestToggle;
- private System.Windows.Forms.TextBox textBoxFromNeato;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Button buttonGetAccel;
- private System.Windows.Forms.Label labelNeatoConnected;
- private System.Windows.Forms.Button buttonGetAnalog;
- private System.Windows.Forms.Button buttonGetButtons;
- private System.Windows.Forms.Button button4;
- private System.Windows.Forms.Button button5;
- private System.Windows.Forms.Button button6;
- private System.Windows.Forms.Button button7;
- private System.Windows.Forms.Button button8;
- private System.Windows.Forms.Button button9;
- private System.Windows.Forms.Button button10;
- private System.Windows.Forms.Button button11;
- private System.Windows.Forms.Button button12;
- private System.Windows.Forms.Button button13;
- private System.Windows.Forms.Button button14;
- private System.Windows.Forms.Button button15;
- private System.Windows.Forms.GroupBox groupBoxGetFunctions;
- private System.Windows.Forms.GroupBox groupBoxTestFunctions;
- private System.Windows.Forms.Button button16;
- private System.Windows.Forms.Button button17;
- private System.Windows.Forms.ComboBox comboBoxLDSRotationFlag;
- private System.Windows.Forms.Button button18;
- private System.Windows.Forms.GroupBox groupBox6;
- private System.Windows.Forms.Button buttonMotorBrush;
- private System.Windows.Forms.GroupBox groupBoxStatus;
- private System.Windows.Forms.Button buttonRefresh;
- private System.Windows.Forms.ProgressBar progressBarBatteryBar;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label labelBatteryCharge;
- private System.Windows.Forms.Button buttonSyncTime;
- private System.Windows.Forms.CheckBox checkBoxMotorRWheel;
- private System.Windows.Forms.CheckBox checkBoxMotorLWheel;
- private System.Windows.Forms.CheckBox checkBoxMotorBrush;
- private System.Windows.Forms.Button buttonMotorRWheel;
- private System.Windows.Forms.Button buttonMotorLWheel;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.Button buttonMove180;
- private System.Windows.Forms.Button buttonMoveRight;
- private System.Windows.Forms.Button buttonMoveLeft;
- private System.Windows.Forms.Button buttonMoveRightRotate;
- private System.Windows.Forms.Button buttonMoveForward;
- private System.Windows.Forms.Button buttonMoveLeftRotate;
- private System.Windows.Forms.TextBox textBoxMoveSpeed;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.CheckBox checkBoxMoveReverse;
- private System.Windows.Forms.Button buttonMoveStop;
- private System.Windows.Forms.TextBox textBoxMoveDistance;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.GroupBox groupBox3;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.Label labelVacuumPower;
- private System.Windows.Forms.TrackBar trackBarVacuum;
- private System.Windows.Forms.Button buttonVacuum;
- private System.Windows.Forms.Label labelVacuumState;
- private System.Windows.Forms.ComboBox comboBoxSysMode;
- private System.Windows.Forms.Button buttonSysMode;
- }
-}
-
diff --git a/NeatoTest/Form1.cs b/NeatoTest/Form1.cs
deleted file mode 100644
index dc487fe..0000000
--- a/NeatoTest/Form1.cs
+++ /dev/null
@@ -1,351 +0,0 @@
-namespace NeatoTest
-{
- using System;
- using System.Drawing;
- using System.Windows.Forms;
- using NeatoAPI;
-
- public partial class Form1 : Form
- {
- private Neato robot;
-
- public Form1()
- {
- this.InitializeComponent();
- this.comboBoxSound.DataSource = Enum.GetValues(typeof(Sounds));
- this.comboBoxLDSRotationFlag.DataSource = Enum.GetValues(typeof(LDSRotation));
- this.comboBoxSysMode.DataSource = Enum.GetValues(typeof(SystemMode));
- this.robot = new Neato();
- this.CheckIfConnected();
- }
-
- private void Button1Click(object sender, EventArgs e)
- {
- if (!this.robot.ConnectToNeato())
- {
- MessageBox.Show(
- this,
- "Could not find any COM ports connected to a Neato.",
- "Connection failed",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error);
- }
-
- this.CheckIfConnected();
- this.CheckTestModeGUI();
- }
-
- private void Button2Click(object sender, EventArgs e)
- {
- var flag = (Sounds)this.comboBoxSound.SelectedValue;
-
- this.robot.Command.Misc.PlaySound(flag);
- }
-
- private void Button3Click(object sender, EventArgs e)
- {
- this.robot.Connection.Disconnect();
- this.CheckIfConnected();
- }
-
- private void ButtonTestToggleClick(object sender, EventArgs e)
- {
- if (this.robot.TestMode)
- {
- this.robot.Command.Test.TestMode(TestModeState.Off);
- }
- else
- {
- this.robot.Command.Test.TestMode(TestModeState.On);
- }
-
- this.CheckTestModeGUI();
- }
-
- private void CheckTestModeGUI()
- {
- if (!this.robot.TestMode)
- {
- this.labelTestStatus.Text = "Inactive";
- this.labelTestStatus.BackColor = Color.LightCoral;
- this.groupBoxTestFunctions.Enabled = false;
- }
- else
- {
- this.labelTestStatus.Text = "Active";
- this.labelTestStatus.BackColor = Color.LawnGreen;
- this.groupBoxTestFunctions.Enabled = true;
- }
- }
-
- void ButtonGetAccelClick(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetAccel().GetRaw();
- }
-
- private void CheckIfConnected()
- {
- if (this.robot == null)
- {
- this.IsNotConnected();
- return;
- }
-
- if (this.robot.Connection == null)
- {
- this.IsNotConnected();
- return;
- }
-
- if (this.robot.IsConnected)
- {
- labelNeatoConnected.Text = "Connected";
- labelNeatoConnected.BackColor = Color.LawnGreen;
- IsConnected();
- buttonRefresh.PerformClick();
- }
- else
- {
- labelNeatoConnected.Text = "Disonnected";
- labelNeatoConnected.BackColor = Color.LightCoral;
- IsNotConnected();
- }
- }
-
- private void IsConnected()
- {
- this.button1.Enabled = false;
- this.button3.Enabled = true;
- this.groupBoxGetFunctions.Enabled = true;
- this.groupBoxPlaySound.Enabled = true;
- this.groupBoxTestMode.Enabled = true;
- this.groupBoxStatus.Enabled = true;
- }
- private void IsNotConnected()
- {
- this.button1.Enabled = true;
- this.button3.Enabled = false;
- this.groupBoxGetFunctions.Enabled = false;
- this.groupBoxPlaySound.Enabled = false;
- this.groupBoxTestMode.Enabled = false;
- this.groupBoxStatus.Enabled = false;
- }
-
- private void ButtonGetAnalogClick(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetAnalogSensors().GetRaw();
- }
-
- private void ButtonGetButtonsClick(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetButtons().GetRaw();
- }
-
- private void Button4Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetCalInfo().GetRaw();
- }
-
- private void Button5Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetCharger().GetRaw();
- }
-
- private void Button6Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetDigitalSensors().GetRaw();
- }
-
- private void Button7Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetErr().GetRaw();
- }
-
- private void Button8Click(object sender, EventArgs e)
- {
- Response res = this.robot.Command.GetInfo.GetLDSScan();
- this.textBoxFromNeato.Text = res.GetRaw();
- }
-
- private void Button9Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetLifeStatLog().GetRaw();
- }
-
- private void Button10Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetMotors().GetRaw();
- }
-
- private void Button11Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetSchedule().GetRaw();
- }
-
- private void Button12Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetSysLog().GetRaw();
- }
-
- private void Button13Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetTime().GetRaw();
- }
-
- private void Button14Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetVersion().GetRaw();
- }
-
- private void Button15Click(object sender, EventArgs e)
- {
- this.textBoxFromNeato.Text = this.robot.Command.GetInfo.GetWarranty().GetRaw();
- }
-
- private void Button16Click(object sender, EventArgs e)
- {
- this.robot.Command.Test.DiagTest();
- }
-
- private void Button18Click(object sender, EventArgs e)
- {
- var flag = (LDSRotation)this.comboBoxLDSRotationFlag.SelectedValue;
- this.robot.Command.Test.SetLDSRotation(flag);
- }
-
- #region Neato Status
-
- private void buttonRefresh_Click(object sender, EventArgs e)
- {
- this.robot.RefreshInformation();
-
- this.progressBarBatteryBar.Value = this.robot.BatteryCharge;
- this.labelBatteryCharge.Text = this.progressBarBatteryBar.Value + "%";
-
- this.textBoxFromNeato.Text = this.robot.ToString();
- }
-
- #endregion
-
- private void buttonSyncTime_Click(object sender, EventArgs e)
- {
- this.robot.Command.System.SyncTime();
- }
-
- #region Motors
-
- private void buttonMotorBrush_Click(object sender, EventArgs e)
- {
- if (this.checkBoxMotorBrush.Checked)
- {
- this.robot.Command.Test.ToggleMotor(Motors.Brush, false);
- this.checkBoxMotorBrush.Checked = false;
- }
- else
- {
- this.robot.Command.Test.ToggleMotor(Motors.Brush, true);
- this.checkBoxMotorBrush.Checked = true;
- }
- }
-
- private void buttonMotorLWheel_Click(object sender, EventArgs e)
- {
- if (this.checkBoxMotorLWheel.Checked)
- {
- this.robot.Command.Test.ToggleMotor(Motors.LeftWheel, false);
- this.checkBoxMotorLWheel.Checked = false;
- }
- else
- {
- this.robot.Command.Test.ToggleMotor(Motors.LeftWheel, true);
- checkBoxMotorLWheel.Checked = true;
- }
- }
-
- private void buttonMotorRWheel_Click(object sender, EventArgs e)
- {
- if (this.checkBoxMotorRWheel.Checked)
- {
- this.robot.Command.Test.ToggleMotor(Motors.RightWheel, false);
- this.checkBoxMotorRWheel.Checked = false;
- }
- else
- {
- this.robot.Command.Test.ToggleMotor(Motors.RightWheel, true);
- this.checkBoxMotorRWheel.Checked = true;
- }
- }
-
- #endregion
-
- #region Movement
- private void buttonMoveLeftRotate_Click(object sender, EventArgs e)
- {
- this.robot.Command.Movement.LeftRotation(int.Parse(this.textBoxMoveSpeed.Text));
- this.textBoxFromNeato.Text = this.robot.ToString();
- }
-
- private void buttonMoveRightRotate_Click(object sender, EventArgs e)
- {
- this.robot.Command.Movement.RightRotation(int.Parse(this.textBoxMoveSpeed.Text));
- this.textBoxFromNeato.Text = this.robot.ToString();
- }
-
- private void buttonMoveForward_Click(object sender, EventArgs e)
- {
- this.robot.Command.Movement.BothWheels(int.Parse(this.textBoxMoveDistance.Text), int.Parse(this.textBoxMoveSpeed.Text), this.checkBoxMoveReverse.Checked);
- this.textBoxFromNeato.Text = this.robot.ToString();
- }
-
- private void buttonMoveLeft_Click(object sender, EventArgs e)
- {
- this.robot.Command.Movement.LeftWheel(int.Parse(this.textBoxMoveDistance.Text), int.Parse(this.textBoxMoveSpeed.Text), this.checkBoxMoveReverse.Checked);
- this.textBoxFromNeato.Text = this.robot.ToString();
- }
-
- private void buttonMoveRight_Click(object sender, EventArgs e)
- {
- this.robot.Command.Movement.RightWheel(int.Parse(this.textBoxMoveDistance.Text), int.Parse(this.textBoxMoveSpeed.Text), this.checkBoxMoveReverse.Checked);
- this.textBoxFromNeato.Text = this.robot.ToString();
- }
-
- private void buttonMove180_Click(object sender, EventArgs e)
- {
- this.robot.Command.Movement.TurnAround(int.Parse(this.textBoxMoveSpeed.Text), this.checkBoxMoveReverse.Checked);
- this.textBoxFromNeato.Text = this.robot.ToString();
- }
-
- private void buttonMoveStop_Click(object sender, EventArgs e)
- {
- this.robot.Command.Movement.Stop();
- }
-
- #endregion
-
- private void trackBarVacuum_ValueChanged(object sender, EventArgs e)
- {
- this.labelVacuumPower.Text = this.trackBarVacuum.Value + "%";
- }
-
- private void buttonVacuum_Click(object sender, EventArgs e)
- {
- if (this.labelVacuumState.Text == "Off")
- {
- this.robot.Command.Test.ToggleVacuum(true, trackBarVacuum.Value);
- this.labelVacuumState.Text = "On";
- }
- else
- {
- this.robot.Command.Test.ToggleVacuum(false, 0);
- this.labelVacuumState.Text = "Off";
- }
- }
-
- private void buttonSysMode_Click(object sender, EventArgs e)
- {
- var flag = (SystemMode)this.comboBoxSysMode.SelectedValue;
-
- this.robot.Command.Test.SetSystemMode(flag);
- }
- }
-}
diff --git a/NeatoTest/Form1.resx b/NeatoTest/Form1.resx
deleted file mode 100644
index 1af7de1..0000000
--- a/NeatoTest/Form1.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/NeatoTest/NeatoTestApp.csproj b/NeatoTest/NeatoTestApp.csproj
deleted file mode 100644
index 10e5649..0000000
--- a/NeatoTest/NeatoTestApp.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
- Debug
- x86
- 8.0.30703
- 2.0
- {02B71822-B1BB-47A7-990B-90AD90C8DC27}
- WinExe
- Properties
- NeatoTest
- NeatoTest
- v4.0
- Client
- 512
-
-
- x86
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- x86
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Form
-
-
- Form1.cs
-
-
-
-
- Form1.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
- {DE9AB03D-6A44-4EAF-90F4-98CE21259AF5}
- NeatoAPI
-
-
-
-
-
\ No newline at end of file
diff --git a/NeatoTest/Properties/AssemblyInfo.cs b/NeatoTest/Properties/AssemblyInfo.cs
deleted file mode 100644
index 42548f8..0000000
--- a/NeatoTest/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// No Copyright is claimed, this is a free project.
-//
-//
-// AssemblyInfo.cs
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("NeatoTest")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("N/A")]
-[assembly: AssemblyProduct("NeatoTest")]
-[assembly: AssemblyCopyright("N/A")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("dbef3212-21bc-4b67-8c34-4745b74a6b84")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.1.*")]
-[assembly: AssemblyFileVersion("0.1.*")]
diff --git a/NeatoTest/Properties/Resources.Designer.cs b/NeatoTest/Properties/Resources.Designer.cs
deleted file mode 100644
index 164255f..0000000
--- a/NeatoTest/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.269
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace NeatoTest.Properties
-{
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NeatoTest.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/NeatoTest/Properties/Resources.resx b/NeatoTest/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/NeatoTest/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/NeatoTest/Properties/Settings.Designer.cs b/NeatoTest/Properties/Settings.Designer.cs
deleted file mode 100644
index 25d5f2c..0000000
--- a/NeatoTest/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.269
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace NeatoTest.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/NeatoTest/Properties/Settings.settings b/NeatoTest/Properties/Settings.settings
deleted file mode 100644
index 3964565..0000000
--- a/NeatoTest/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/README.md b/README.md
deleted file mode 100644
index eb6c3b8..0000000
--- a/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Neato API
-Interface that communicates with a Neato XV-15 through USB COM serial port.
-
-Should implement most of the methods outlined in the Programmer’s Manual (http://www.neatorobotics.com/programmers-manual) from Neato Robotics.
-Unless otherwise noted, will use methods outlined for Neato firmware version 2.6.
-
-## Setup
-In order to access the Neato through this API, you will need to have installed the drivers available from Neato Robotics (used for their firmware upgrade tool). Once installed these will provide a COM port access to the Neato XV-15.
\ No newline at end of file
diff --git a/packages/Moq.4.0.10827/License.txt b/packages/Moq.4.0.10827/License.txt
deleted file mode 100644
index fb36f92..0000000
--- a/packages/Moq.4.0.10827/License.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Copyright (c) 2007. Clarius Consulting, Manas Technology Solutions, InSTEDD
-http://code.google.com/p/moq/
-All rights reserved.
-
-Redistribution and use in source and binary forms,
-with or without modification, are permitted provided
-that the following conditions are met:
-
- * Redistributions of source code must retain the
- above copyright notice, this list of conditions and
- the following disclaimer.
-
- * Redistributions in binary form must reproduce
- the above copyright notice, this list of conditions
- and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- * Neither the name of Clarius Consulting, Manas Technology Solutions or InSTEDD nor the
- names of its contributors may be used to endorse
- or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-[This is the BSD license, see
- http://www.opensource.org/licenses/bsd-license.php]
\ No newline at end of file
diff --git a/packages/Moq.4.0.10827/Moq.4.0.10827.nupkg b/packages/Moq.4.0.10827/Moq.4.0.10827.nupkg
deleted file mode 100644
index 91e88a4..0000000
Binary files a/packages/Moq.4.0.10827/Moq.4.0.10827.nupkg and /dev/null differ
diff --git a/packages/Moq.4.0.10827/Moq.chm b/packages/Moq.4.0.10827/Moq.chm
deleted file mode 100644
index f5779bb..0000000
Binary files a/packages/Moq.4.0.10827/Moq.chm and /dev/null differ
diff --git a/packages/Moq.4.0.10827/lib/NET35/Moq.dll b/packages/Moq.4.0.10827/lib/NET35/Moq.dll
deleted file mode 100644
index 3d3b8cc..0000000
Binary files a/packages/Moq.4.0.10827/lib/NET35/Moq.dll and /dev/null differ
diff --git a/packages/Moq.4.0.10827/lib/NET35/Moq.xml b/packages/Moq.4.0.10827/lib/NET35/Moq.xml
deleted file mode 100644
index a0be31c..0000000
--- a/packages/Moq.4.0.10827/lib/NET35/Moq.xml
+++ /dev/null
@@ -1,5768 +0,0 @@
-
-
-
- Moq
-
-
-
-
- Implements the fluent API.
-
-
-
-
- The expectation will be considered only in the former condition.
-
-
-
-
-
-
- The expectation will be considered only in the former condition.
-
-
-
-
-
-
-
- Setups the get.
-
- The type of the property.
- The expression.
-
-
-
-
- Setups the set.
-
- The type of the property.
- The setter expression.
-
-
-
-
- Setups the set.
-
- The setter expression.
-
-
-
-
- Defines the Callback verb and overloads.
-
-
-
-
- Helper interface used to hide the base
- members from the fluent API to make it much cleaner
- in Visual Studio intellisense.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Specifies a callback to invoke when the method is called.
-
- The callback method to invoke.
-
- The following example specifies a callback to set a boolean
- value that can be used later:
-
- var called = false;
- mock.Setup(x => x.Execute())
- .Callback(() => called = true);
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The argument type of the invoked method.
- The callback method to invoke.
-
- Invokes the given callback with the concrete invocation argument value.
-
- Notice how the specific string argument is retrieved by simply declaring
- it as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Callback((string command) => Console.WriteLine(command));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
-
-
-
-
-
- Defines the Callback verb and overloads for callbacks on
- setups that return a value.
-
- Mocked type.
- Type of the return value of the setup.
-
-
-
- Specifies a callback to invoke when the method is called.
-
- The callback method to invoke.
-
- The following example specifies a callback to set a boolean value that can be used later:
-
- var called = false;
- mock.Setup(x => x.Execute())
- .Callback(() => called = true)
- .Returns(true);
-
- Note that in the case of value-returning methods, after the Callback
- call you can still specify the return value.
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the argument of the invoked method.
- Callback method to invoke.
-
- Invokes the given callback with the concrete invocation argument value.
-
- Notice how the specific string argument is retrieved by simply declaring
- it as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Callback(command => Console.WriteLine(command))
- .Returns(true);
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
-
-
-
-
-
- Defines the Raises verb.
-
-
-
-
- Specifies the event that will be raised
- when the setup is met.
-
- An expression that represents an event attach or detach action.
- The event arguments to pass for the raised event.
-
- The following example shows how to raise an event when
- the setup is met:
-
- var mock = new Mock<IContainer>();
-
- mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>()))
- .Raises(add => add.Added += null, EventArgs.Empty);
-
-
-
-
-
- Specifies the event that will be raised
- when the setup is matched.
-
- An expression that represents an event attach or detach action.
- A function that will build the
- to pass when raising the event.
-
-
-
-
- Specifies the custom event that will be raised
- when the setup is matched.
-
- An expression that represents an event attach or detach action.
- The arguments to pass to the custom delegate (non EventHandler-compatible).
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
- The type of the fifteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
- The type of the fifteenth argument received by the expected invocation.
- The type of the sixteenth argument received by the expected invocation.
-
-
-
-
- Defines the Returns verb.
-
- Mocked type.
- Type of the return value from the expression.
-
-
-
- Specifies the value to return.
-
- The value to return, or .
-
- Return a true value from the method call:
-
- mock.Setup(x => x.Execute("ping"))
- .Returns(true);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method.
-
- The function that will calculate the return value.
-
- Return a calculated value when the method is called:
-
- mock.Setup(x => x.Execute("ping"))
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the method
- is executed and the value the returnValues array has at
- that moment.
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the argument of the invoked method.
- The function that will calculate the return value.
-
- Return a calculated value which is evaluated lazily at the time of the invocation.
-
- The lookup list can change between invocations and the setup
- will return different values accordingly. Also, notice how the specific
- string argument is retrieved by simply declaring it as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Returns((string command) => returnValues[command]);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2) => arg1 + arg2);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16);
-
-
-
-
-
- Language for ReturnSequence
-
-
-
-
- Returns value
-
-
-
-
- Throws an exception
-
-
-
-
- Throws an exception
-
-
-
-
- The first method call or member access will be the
- last segment of the expression (depth-first traversal),
- which is the one we have to Setup rather than FluentMock.
- And the last one is the one we have to Mock.Get rather
- than FluentMock.
-
-
-
-
- Base class for mocks and static helper class with methods that
- apply to mocked objects, such as to
- retrieve a from an object instance.
-
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the specification of how the mocked object should behave.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Retrieves the mock object for the given object instance.
-
- Type of the mock to retrieve. Can be omitted as it's inferred
- from the object instance passed in as the instance.
- The instance of the mocked object.The mock associated with the mocked object.
- The received instance
- was not created by Moq.
-
- The following example shows how to add a new setup to an object
- instance which is not the original but rather
- the object associated with it:
-
- // Typed instance, not the mock, is retrieved from some test API.
- HttpContextBase context = GetMockContext();
-
- // context.Request is the typed object from the "real" API
- // so in order to add a setup to it, we need to get
- // the mock that "owns" it
- Mock<HttpRequestBase> request = Mock.Get(context.Request);
- mock.Setup(req => req.AppRelativeCurrentExecutionFilePath)
- .Returns(tempUrl);
-
-
-
-
-
- Returns the mocked object value.
-
-
-
-
- Verifies that all verifiable expectations have been met.
-
- This example sets up an expectation and marks it as verifiable. After
- the mock is used, a Verify() call is issued on the mock
- to ensure the method in the setup was invoked:
-
- var mock = new Mock<IWarehouse>();
- this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory.
- this.Verify();
-
- Not all verifiable expectations were met.
-
-
-
- Verifies all expectations regardless of whether they have
- been flagged as verifiable.
-
- This example sets up an expectation without marking it as verifiable. After
- the mock is used, a call is issued on the mock
- to ensure that all expectations are met:
-
- var mock = new Mock<IWarehouse>();
- this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory, even
- // that expectation was not marked as verifiable.
- this.VerifyAll();
-
- At least one expectation was not met.
-
-
-
- Gets the interceptor target for the given expression and root mock,
- building the intermediate hierarchy of mock objects if necessary.
-
-
-
-
- Raises the associated event with the given
- event argument data.
-
-
-
-
- Raises the associated event with the given
- event argument data.
-
-
-
-
- Adds an interface implementation to the mock,
- allowing setups to be specified for it.
-
- This method can only be called before the first use
- of the mock property, at which
- point the runtime type has already been generated
- and no more interfaces can be added to it.
-
- Also, must be an
- interface and not a class, which must be specified
- when creating the mock instead.
-
-
- The mock type
- has already been generated by accessing the property.
-
- The specified
- is not an interface.
-
- The following example creates a mock for the main interface
- and later adds to it to verify
- it's called by the consumer code:
-
- var mock = new Mock<IProcessor>();
- mock.Setup(x => x.Execute("ping"));
-
- // add IDisposable interface
- var disposable = mock.As<IDisposable>();
- disposable.Setup(d => d.Dispose()).Verifiable();
-
- Type of interface to cast the mock to.
-
-
-
-
-
-
- Behavior of the mock, according to the value set in the constructor.
-
-
-
-
- Whether the base member virtual implementation will be called
- for mocked classes if no setup is matched. Defaults to .
-
-
-
-
- Specifies the behavior to use when returning default values for
- unexpected invocations on loose mocks.
-
-
-
-
- Gets the mocked object instance.
-
-
-
-
- Retrieves the type of the mocked object, its generic type argument.
- This is used in the auto-mocking of hierarchy access.
-
-
-
-
- Specifies the class that will determine the default
- value to return when invocations are made that
- have no setups and need to return a default
- value (for loose mocks).
-
-
-
-
- Exposes the list of extra interfaces implemented by the mock.
-
-
-
-
- Utility repository class to use to construct multiple
- mocks when consistent verification is
- desired for all of them.
-
-
- If multiple mocks will be created during a test, passing
- the desired (if different than the
- or the one
- passed to the repository constructor) and later verifying each
- mock can become repetitive and tedious.
-
- This repository class helps in that scenario by providing a
- simplified creation of multiple mocks with a default
- (unless overriden by calling
- ) and posterior verification.
-
-
-
- The following is a straightforward example on how to
- create and automatically verify strict mocks using a :
-
- var repository = new MockRepository(MockBehavior.Strict);
-
- var foo = repository.Create<IFoo>();
- var bar = repository.Create<IBar>();
-
- // no need to call Verifiable() on the setup
- // as we'll be validating all of them anyway.
- foo.Setup(f => f.Do());
- bar.Setup(b => b.Redo());
-
- // exercise the mocks here
-
- repository.VerifyAll();
- // At this point all setups are already checked
- // and an optional MockException might be thrown.
- // Note also that because the mocks are strict, any invocation
- // that doesn't have a matching setup will also throw a MockException.
-
- The following examples shows how to setup the repository
- to create loose mocks and later verify only verifiable setups:
-
- var repository = new MockRepository(MockBehavior.Loose);
-
- var foo = repository.Create<IFoo>();
- var bar = repository.Create<IBar>();
-
- // this setup will be verified when we verify the repository
- foo.Setup(f => f.Do()).Verifiable();
-
- // this setup will NOT be verified
- foo.Setup(f => f.Calculate());
-
- // this setup will be verified when we verify the repository
- bar.Setup(b => b.Redo()).Verifiable();
-
- // exercise the mocks here
- // note that because the mocks are Loose, members
- // called in the interfaces for which no matching
- // setups exist will NOT throw exceptions,
- // and will rather return default values.
-
- repository.Verify();
- // At this point verifiable setups are already checked
- // and an optional MockException might be thrown.
-
- The following examples shows how to setup the repository with a
- default strict behavior, overriding that default for a
- specific mock:
-
- var repository = new MockRepository(MockBehavior.Strict);
-
- // this particular one we want loose
- var foo = repository.Create<IFoo>(MockBehavior.Loose);
- var bar = repository.Create<IBar>();
-
- // specify setups
-
- // exercise the mocks here
-
- repository.Verify();
-
-
-
-
-
-
- Utility factory class to use to construct multiple
- mocks when consistent verification is
- desired for all of them.
-
-
- If multiple mocks will be created during a test, passing
- the desired (if different than the
- or the one
- passed to the factory constructor) and later verifying each
- mock can become repetitive and tedious.
-
- This factory class helps in that scenario by providing a
- simplified creation of multiple mocks with a default
- (unless overriden by calling
- ) and posterior verification.
-
-
-
- The following is a straightforward example on how to
- create and automatically verify strict mocks using a :
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // no need to call Verifiable() on the setup
- // as we'll be validating all of them anyway.
- foo.Setup(f => f.Do());
- bar.Setup(b => b.Redo());
-
- // exercise the mocks here
-
- factory.VerifyAll();
- // At this point all setups are already checked
- // and an optional MockException might be thrown.
- // Note also that because the mocks are strict, any invocation
- // that doesn't have a matching setup will also throw a MockException.
-
- The following examples shows how to setup the factory
- to create loose mocks and later verify only verifiable setups:
-
- var factory = new MockFactory(MockBehavior.Loose);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // this setup will be verified when we verify the factory
- foo.Setup(f => f.Do()).Verifiable();
-
- // this setup will NOT be verified
- foo.Setup(f => f.Calculate());
-
- // this setup will be verified when we verify the factory
- bar.Setup(b => b.Redo()).Verifiable();
-
- // exercise the mocks here
- // note that because the mocks are Loose, members
- // called in the interfaces for which no matching
- // setups exist will NOT throw exceptions,
- // and will rather return default values.
-
- factory.Verify();
- // At this point verifiable setups are already checked
- // and an optional MockException might be thrown.
-
- The following examples shows how to setup the factory with a
- default strict behavior, overriding that default for a
- specific mock:
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- // this particular one we want loose
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
- var bar = factory.Create<IBar>();
-
- // specify setups
-
- // exercise the mocks here
-
- factory.Verify();
-
-
-
-
-
-
- Initializes the factory with the given
- for newly created mocks from the factory.
-
- The behavior to use for mocks created
- using the factory method if not overriden
- by using the overload.
-
-
-
- Creates a new mock with the default
- specified at factory construction time.
-
- Type to mock.
- A new .
-
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- // use mock on tests
-
- factory.VerifyAll();
-
-
-
-
-
- Creates a new mock with the default
- specified at factory construction time and with the
- the given constructor arguments for the class.
-
-
- The mock will try to find the best match constructor given the
- constructor arguments, and invoke that to initialize the instance.
- This applies only to classes, not interfaces.
-
- Type to mock.
- Constructor arguments for mocked classes.
- A new .
-
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>("Foo", 25, true);
- // use mock on tests
-
- factory.Verify();
-
-
-
-
-
- Creates a new mock with the given .
-
- Type to mock.
- Behavior to use for the mock, which overrides
- the default behavior specified at factory construction time.
- A new .
-
- The following example shows how to create a mock with a different
- behavior to that specified as the default for the factory:
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
-
-
-
-
-
- Creates a new mock with the given
- and with the the given constructor arguments for the class.
-
-
- The mock will try to find the best match constructor given the
- constructor arguments, and invoke that to initialize the instance.
- This applies only to classes, not interfaces.
-
- Type to mock.
- Behavior to use for the mock, which overrides
- the default behavior specified at factory construction time.
- Constructor arguments for mocked classes.
- A new .
-
- The following example shows how to create a mock with a different
- behavior to that specified as the default for the factory, passing
- constructor arguments:
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true);
-
-
-
-
-
- Implements creation of a new mock within the factory.
-
- Type to mock.
- The behavior for the new mock.
- Optional arguments for the construction of the mock.
-
-
-
- Verifies all verifiable expectations on all mocks created
- by this factory.
-
-
- One or more mocks had expectations that were not satisfied.
-
-
-
- Verifies all verifiable expectations on all mocks created
- by this factory.
-
-
- One or more mocks had expectations that were not satisfied.
-
-
-
- Invokes for each mock
- in , and accumulates the resulting
- that might be
- thrown from the action.
-
- The action to execute against
- each mock.
-
-
-
- Whether the base member virtual implementation will be called
- for mocked classes if no setup is matched. Defaults to .
-
-
-
-
- Specifies the behavior to use when returning default values for
- unexpected invocations on loose mocks.
-
-
-
-
- Gets the mocks that have been created by this factory and
- that will get verified together.
-
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The type of the mocked object to query.
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The predicate with the setup expressions.
- The type of the mocked object to query.
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the setup expressions.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates the mock query with the underlying queriable implementation.
-
-
-
-
- Wraps the enumerator inside a queryable.
-
-
-
-
- Method that is turned into the actual call from .Query{T}, to
- transform the queryable query into a normal enumerable query.
- This method is never used directly by consumers.
-
-
-
-
- Initializes the repository with the given
- for newly created mocks from the repository.
-
- The behavior to use for mocks created
- using the repository method if not overriden
- by using the overload.
-
-
-
- A that returns an empty default value
- for invocations that do not have setups or return values, with loose mocks.
- This is the default behavior for a mock.
-
-
-
-
- Interface to be implemented by classes that determine the
- default value of non-expected invocations.
-
-
-
-
- Defines the default value to return in all the methods returning .
- The type of the return value.The value to set as default.
-
-
-
- Provides a value for the given member and arguments.
-
- The member to provide a default value for.
-
-
-
-
- The intention of is to create a more readable
- string representation for the failure message.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Throws verb.
-
-
-
-
- Specifies the exception to throw when the method is invoked.
-
- Exception instance to throw.
-
- This example shows how to throw an exception when the method is
- invoked with an empty string argument:
-
- mock.Setup(x => x.Execute(""))
- .Throws(new ArgumentException());
-
-
-
-
-
- Specifies the type of exception to throw when the method is invoked.
-
- Type of exception to instantiate and throw when the setup is matched.
-
- This example shows how to throw an exception when the method is
- invoked with an empty string argument:
-
- mock.Setup(x => x.Execute(""))
- .Throws<ArgumentException>();
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines occurrence members to constraint setups.
-
-
-
-
- The expected invocation can happen at most once.
-
-
-
- var mock = new Mock<ICommand>();
- mock.Setup(foo => foo.Execute("ping"))
- .AtMostOnce();
-
-
-
-
-
- The expected invocation can happen at most specified number of times.
-
- The number of times to accept calls.
-
-
- var mock = new Mock<ICommand>();
- mock.Setup(foo => foo.Execute("ping"))
- .AtMost( 5 );
-
-
-
-
-
- Defines the Verifiable verb.
-
-
-
-
- Marks the expectation as verifiable, meaning that a call
- to will check if this particular
- expectation was met.
-
-
- The following example marks the expectation as verifiable:
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true)
- .Verifiable();
-
-
-
-
-
- Marks the expectation as verifiable, meaning that a call
- to will check if this particular
- expectation was met, and specifies a message for failures.
-
-
- The following example marks the expectation as verifiable:
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true)
- .Verifiable("Ping should be executed always!");
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- We need this non-generics base class so that
- we can use from
- generic code.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb for property getter setups.
-
-
- Mocked type.
- Type of the property.
-
-
-
- Specifies a callback to invoke when the property is retrieved.
-
- Callback method to invoke.
-
- Invokes the given callback with the property value being set.
-
- mock.SetupGet(x => x.Suspended)
- .Callback(() => called = true)
- .Returns(true);
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Returns verb for property get setups.
-
- Mocked type.
- Type of the property.
-
-
-
- Specifies the value to return.
-
- The value to return, or .
-
- Return a true value from the property getter call:
-
- mock.SetupGet(x => x.Suspended)
- .Returns(true);
-
-
-
-
-
- Specifies a function that will calculate the value to return for the property.
-
- The function that will calculate the return value.
-
- Return a calculated value when the property is retrieved:
-
- mock.SetupGet(x => x.Suspended)
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the property
- is retrieved and the value the returnValues array has at
- that moment.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Encapsulates a method that has five parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has five parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has six parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has six parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has seven parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has seven parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has eight parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has eight parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has nine parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has nine parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has ten parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has ten parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has eleven parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has eleven parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has twelve parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has twelve parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has thirteen parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has thirteen parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has fourteen parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The type of the fourteenth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
- The fourteenth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has fourteen parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The type of the fourteenth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
- The fourteenth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has fifteen parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The type of the fourteenth parameter of the method that this delegate encapsulates.
- The type of the fifteenth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
- The fourteenth parameter of the method that this delegate encapsulates.
- The fifteenth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has fifteen parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The type of the fourteenth parameter of the method that this delegate encapsulates.
- The type of the fifteenth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
- The fourteenth parameter of the method that this delegate encapsulates.
- The fifteenth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has sixteen parameters and does not return a value.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The type of the fourteenth parameter of the method that this delegate encapsulates.
- The type of the fifteenth parameter of the method that this delegate encapsulates.
- The type of the sixteenth parameter of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
- The fourteenth parameter of the method that this delegate encapsulates.
- The fifteenth parameter of the method that this delegate encapsulates.
- The sixteenth parameter of the method that this delegate encapsulates.
-
-
-
- Encapsulates a method that has sixteen parameters and returns a value of the type specified by the parameter.
-
- The type of the first parameter of the method that this delegate encapsulates.
- The type of the second parameter of the method that this delegate encapsulates.
- The type of the third parameter of the method that this delegate encapsulates.
- The type of the fourth parameter of the method that this delegate encapsulates.
- The type of the fifth parameter of the method that this delegate encapsulates.
- The type of the sixth parameter of the method that this delegate encapsulates.
- The type of the seventh parameter of the method that this delegate encapsulates.
- The type of the eighth parameter of the method that this delegate encapsulates.
- The type of the nineth parameter of the method that this delegate encapsulates.
- The type of the tenth parameter of the method that this delegate encapsulates.
- The type of the eleventh parameter of the method that this delegate encapsulates.
- The type of the twelfth parameter of the method that this delegate encapsulates.
- The type of the thirteenth parameter of the method that this delegate encapsulates.
- The type of the fourteenth parameter of the method that this delegate encapsulates.
- The type of the fifteenth parameter of the method that this delegate encapsulates.
- The type of the sixteenth parameter of the method that this delegate encapsulates.
- The type of the return value of the method that this delegate encapsulates.
- The first parameter of the method that this delegate encapsulates.
- The second parameter of the method that this delegate encapsulates.
- The third parameter of the method that this delegate encapsulates.
- The fourth parameter of the method that this delegate encapsulates.
- The fifth parameter of the method that this delegate encapsulates.
- The sixth parameter of the method that this delegate encapsulates.
- The seventh parameter of the method that this delegate encapsulates.
- The eighth parameter of the method that this delegate encapsulates.
- The nineth parameter of the method that this delegate encapsulates.
- The tenth parameter of the method that this delegate encapsulates.
- The eleventh parameter of the method that this delegate encapsulates.
- The twelfth parameter of the method that this delegate encapsulates.
- The thirteenth parameter of the method that this delegate encapsulates.
- The fourteenth parameter of the method that this delegate encapsulates.
- The fifteenth parameter of the method that this delegate encapsulates.
- The sixteenth parameter of the method that this delegate encapsulates.
- The return value of the method that this delegate encapsulates.
-
-
-
- Helper class to setup a full trace between many mocks
-
-
-
-
- Initialize a trace setup
-
-
-
-
- Allow sequence to be repeated
-
-
-
-
- define nice api
-
-
-
-
- Perform an expectation in the trace.
-
-
-
-
- Marks a method as a matcher, which allows complete replacement
- of the built-in class with your own argument
- matching rules.
-
-
- This feature has been deprecated in favor of the new
- and simpler .
-
-
- The argument matching is used to determine whether a concrete
- invocation in the mock matches a given setup. This
- matching mechanism is fully extensible.
-
-
- There are two parts of a matcher: the compiler matcher
- and the runtime matcher.
-
- -
- Compiler matcher
- Used to satisfy the compiler requirements for the
- argument. Needs to be a method optionally receiving any arguments
- you might need for the matching, but with a return type that
- matches that of the argument.
-
- Let's say I want to match a lists of orders that contains
- a particular one. I might create a compiler matcher like the following:
-
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
- }
-
- Now we can invoke this static method instead of an argument in an
- invocation:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- Note that the return value from the compiler matcher is irrelevant.
- This method will never be called, and is just used to satisfy the
- compiler and to signal Moq that this is not a method that we want
- to be invoked at runtime.
-
-
- -
- Runtime matcher
-
- The runtime matcher is the one that will actually perform evaluation
- when the test is run, and is defined by convention to have the
- same signature as the compiler matcher, but where the return
- value is the first argument to the call, which contains the
- object received by the actual invocation at runtime:
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
-
- At runtime, the mocked method will be invoked with a specific
- list of orders. This value will be passed to this runtime
- matcher as the first argument, while the second argument is the
- one specified in the setup (x.Save(Orders.Contains(order))).
-
- The boolean returned determines whether the given argument has been
- matched. If all arguments to the expected method are matched, then
- the setup matches and is evaluated.
-
-
-
-
-
- Using this extensible infrastructure, you can easily replace the entire
- set of matchers with your own. You can also avoid the
- typical (and annoying) lengthy expressions that result when you have
- multiple arguments that use generics.
-
-
- The following is the complete example explained above:
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
- }
-
- And the concrete test using this matcher:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- // use mock, invoke Save, and have the matcher filter.
-
-
-
-
-
- Provides a mock implementation of .
-
- Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked.
-
- The behavior of the mock with regards to the setups and the actual calls is determined
- by the optional that can be passed to the
- constructor.
-
- Type to mock, which can be an interface or a class.
- The following example shows establishing setups with specific values
- for method invocations:
-
- // Arrange
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
-
- // Act
- order.Fill(mock.Object);
-
- // Assert
- Assert.True(order.IsFilled);
-
- The following example shows how to use the class
- to specify conditions for arguments instead of specific values:
-
- // Arrange
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- // shows how to expect a value within a range
- mock.Setup(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
- // shows how to throw for unexpected calls.
- mock.Setup(x => x.Remove(
- It.IsAny<string>(),
- It.IsAny<int>()))
- .Throws(new InvalidOperationException());
-
- // Act
- order.Fill(mock.Object);
-
- // Assert
- Assert.False(order.IsFilled);
-
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Ctor invoked by AsTInterface exclusively.
-
-
-
-
- Initializes an instance of the mock with default behavior.
-
- var mock = new Mock<IFormatProvider>();
-
-
-
-
- Initializes an instance of the mock with default behavior and with
- the given constructor arguments for the class. (Only valid when is a class)
-
- The mock will try to find the best match constructor given the constructor arguments, and invoke that
- to initialize the instance. This applies only for classes, not interfaces.
-
- var mock = new Mock<MyProvider>(someArgument, 25);
- Optional constructor arguments if the mocked type is a class.
-
-
-
- Initializes an instance of the mock with the specified behavior.
-
- var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed);
- Behavior of the mock.
-
-
-
- Initializes an instance of the mock with a specific behavior with
- the given constructor arguments for the class.
-
- The mock will try to find the best match constructor given the constructor arguments, and invoke that
- to initialize the instance. This applies only to classes, not interfaces.
-
- var mock = new Mock<MyProvider>(someArgument, 25);
- Behavior of the mock.Optional constructor arguments if the mocked type is a class.
-
-
-
- Returns the mocked object value.
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a void method.
-
- If more than one setup is specified for the same method or property,
- the latest one wins and is the one that will be executed.
- Lambda expression that specifies the expected method invocation.
-
- var mock = new Mock<IProcessor>();
- mock.Setup(x => x.Execute("ping"));
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a value returning method.
- Type of the return value. Typically omitted as it can be inferred from the expression.
- If more than one setup is specified for the same method or property,
- the latest one wins and is the one that will be executed.
- Lambda expression that specifies the method invocation.
-
- mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property getter.
-
- If more than one setup is set for the same property getter,
- the latest one wins and is the one that will be executed.
- Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter.
-
- mock.SetupGet(x => x.Suspended)
- .Returns(true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter.
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
-
- This overloads allows the use of a callback already
- typed for the property type.
-
- Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value.
-
- mock.SetupSet(x => x.Suspended = true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter.
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
- Lambda expression that sets a property to a value.
-
- mock.SetupSet(x => x.Suspended = true);
-
-
-
-
-
- Specifies that the given property should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. (this is also
- known as "stubbing").
-
- Type of the property, inferred from the property
- expression (does not need to be specified).
- Property expression to stub.
- If you have an interface with an int property Value, you might
- stub it using the following straightforward call:
-
- var mock = new Mock<IHaveValue>();
- mock.Stub(v => v.Value);
-
- After the Stub call has been issued, setting and
- retrieving the object value will behave as expected:
-
- IHaveValue v = mock.Object;
-
- v.Value = 5;
- Assert.Equal(5, v.Value);
-
-
-
-
-
- Specifies that the given property should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. This overload
- allows setting the initial value for the property. (this is also
- known as "stubbing").
-
- Type of the property, inferred from the property
- expression (does not need to be specified).
- Property expression to stub.Initial value for the property.
- If you have an interface with an int property Value, you might
- stub it using the following straightforward call:
-
- var mock = new Mock<IHaveValue>();
- mock.SetupProperty(v => v.Value, 5);
-
- After the SetupProperty call has been issued, setting and
- retrieving the object value will behave as expected:
-
- IHaveValue v = mock.Object;
- // Initial value was stored
- Assert.Equal(5, v.Value);
-
- // New value set which changes the initial value
- v.Value = 6;
- Assert.Equal(6, v.Value);
-
-
-
-
-
- Specifies that the all properties on the mock should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. (this is also
- known as "stubbing"). The default value for each property will be the
- one generated as specified by the property for the mock.
-
- If the mock is set to ,
- the mocked default values will also get all properties setup recursively.
-
-
-
-
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IProcessor>();
- // exercise mock
- //...
- // Will throw if the test code didn't call Execute with a "ping" string argument.
- mock.Verify(proc => proc.Execute("ping"));
-
- The invocation was not performed on the mock.Expression to verify.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock,
- specifying a failure error message. Use in conjuntion with the default
- .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IProcessor>();
- // exercise mock
- //...
- // Will throw if the test code didn't call Execute with a "ping" string argument.
- mock.Verify(proc => proc.Execute("ping"));
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock,
- specifying a failure error message. Use in conjuntion with the default
- .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't call HasInventory.
- mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50));
-
- The invocation was not performed on the mock.Expression to verify.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock. Use in conjuntion
- with the default .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock, specifying a failure
- error message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't call HasInventory.
- mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked");
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock, specifying a failure
- error message.
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression.
-
-
-
- Verifies that a property was read on the mock.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was retrieved from it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't retrieve the IsClosed property.
- mock.VerifyGet(warehouse => warehouse.IsClosed);
-
- The invocation was not performed on the mock.Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock, specifying a failure
- error message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was retrieved from it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't retrieve the IsClosed property.
- mock.VerifyGet(warehouse => warehouse.IsClosed);
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock, specifying a failure
- error message.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was set on the mock.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was set on it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed = true);
-
- The invocation was not performed on the mock.Expression to verify.
-
-
-
- Verifies that a property was set on the mock.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.
-
-
-
- Verifies that a property was set on the mock, specifying
- a failure message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was set on it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action");
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
-
-
-
- Verifies that a property was set on the mock, specifying
- a failure message.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails.
-
-
-
- Raises the event referenced in using
- the given argument.
-
- The argument is
- invalid for the target event invocation, or the is
- not an event attach or detach expression.
-
- The following example shows how to raise a event:
-
- var mock = new Mock<IViewModel>();
-
- mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name"));
-
-
- This example shows how to invoke an event with a custom event arguments
- class in a view that will cause its corresponding presenter to
- react by changing its state:
-
- var mockView = new Mock<IOrdersView>();
- var presenter = new OrdersPresenter(mockView.Object);
-
- // Check that the presenter has no selection by default
- Assert.Null(presenter.SelectedOrder);
-
- // Raise the event with a specific arguments data
- mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) });
-
- // Now the presenter reacted to the event, and we have a selected order
- Assert.NotNull(presenter.SelectedOrder);
- Assert.Equal("moq", presenter.SelectedOrder.ProductName);
-
-
-
-
-
- Raises the event referenced in using
- the given argument for a non-EventHandler typed event.
-
- The arguments are
- invalid for the target event invocation, or the is
- not an event attach or detach expression.
-
- The following example shows how to raise a custom event that does not adhere to
- the standard EventHandler:
-
- var mock = new Mock<IViewModel>();
-
- mock.Raise(x => x.MyEvent -= null, "Name", bool, 25);
-
-
-
-
-
- Exposes the mocked object instance.
-
-
-
-
- Provides legacy API members as extensions so that
- existing code continues to compile, but new code
- doesn't see then.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Provides additional methods on mocks.
-
-
- Provided as extension methods as they confuse the compiler
- with the overloads taking Action.
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter, regardless of its value.
-
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
-
- Type of the property. Typically omitted as it can be inferred from the expression.
- Type of the mock.
- The target mock for the setup.
- Lambda expression that specifies the property setter.
-
-
- mock.SetupSet(x => x.Suspended);
-
-
-
- This method is not legacy, but must be on an extension method to avoid
- confusing the compiler with the new Action syntax.
-
-
-
-
- Verifies that a property has been set on the mock, regarless of its value.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- Expression to verify.
- The mock instance.
- Mocked type.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, specifying a failure
- error message.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- Expression to verify.
- Message to show if verification fails.
- The mock instance.
- Mocked type.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, regardless
- of the value but only the specified number of times.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- The invocation was not call the times specified by
- .
- The mock instance.
- Mocked type.
- The number of times a method is allowed to be called.
- Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, regardless
- of the value but only the specified number of times, and specifying a failure
- error message.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- The invocation was not call the times specified by
- .
- The mock instance.
- Mocked type.
- The number of times a method is allowed to be called.
- Message to show if verification fails.
- Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Helper for sequencing return values in the same method.
-
-
-
-
- Return a sequence of values, once per call.
-
-
-
-
- Casts the expression to a lambda expression, removing
- a cast if there's any.
-
-
-
-
- Casts the body of the lambda expression to a .
-
- If the body is not a method call.
-
-
-
- Converts the body of the lambda expression into the referenced by it.
-
-
-
-
- Checks whether the body of the lambda expression is a property access.
-
-
-
-
- Checks whether the expression is a property access.
-
-
-
-
- Checks whether the body of the lambda expression is a property indexer, which is true
- when the expression is an whose
- has
- equal to .
-
-
-
-
- Checks whether the expression is a property indexer, which is true
- when the expression is an whose
- has
- equal to .
-
-
-
-
- Creates an expression that casts the given expression to the
- type.
-
-
-
-
- TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583
- is fixed.
-
-
-
-
- Provides partial evaluation of subtrees, whenever they can be evaluated locally.
-
- Matt Warren: http://blogs.msdn.com/mattwar
- Documented by InSTEDD: http://www.instedd.org
-
-
-
- Performs evaluation and replacement of independent sub-trees
-
- The root of the expression tree.
- A function that decides whether a given expression
- node can be part of the local function.
- A new tree with sub-trees evaluated and replaced.
-
-
-
- Performs evaluation and replacement of independent sub-trees
-
- The root of the expression tree.
- A new tree with sub-trees evaluated and replaced.
-
-
-
- Evaluates and replaces sub-trees when first candidate is reached (top-down)
-
-
-
-
- Performs bottom-up analysis to determine which nodes can possibly
- be part of an evaluated sub-tree.
-
-
-
-
- Ensures the given is not null.
- Throws otherwise.
-
-
-
-
- Ensures the given string is not null or empty.
- Throws in the first case, or
- in the latter.
-
-
-
-
- Checks an argument to ensure it is in the specified range including the edges.
-
- Type of the argument to check, it must be an type.
-
- The expression containing the name of the argument.
- The argument value to check.
- The minimun allowed value for the argument.
- The maximun allowed value for the argument.
-
-
-
- Checks an argument to ensure it is in the specified range excluding the edges.
-
- Type of the argument to check, it must be an type.
-
- The expression containing the name of the argument.
- The argument value to check.
- The minimun allowed value for the argument.
- The maximun allowed value for the argument.
-
-
-
- Implemented by all generated mock object instances.
-
-
-
-
- Implemented by all generated mock object instances.
-
-
-
-
- Reference the Mock that contains this as the mock.Object value.
-
-
-
-
- Reference the Mock that contains this as the mock.Object value.
-
-
-
-
- Implements the actual interception and method invocation for
- all mocks.
-
-
-
-
- Get an eventInfo for a given event name. Search type ancestors depth first if necessary.
-
- Name of the event, with the set_ or get_ prefix already removed
-
-
-
- Given a type return all of its ancestors, both types and interfaces.
-
- The type to find immediate ancestors of
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb for property setter setups.
-
- Type of the property.
-
-
-
- Specifies a callback to invoke when the property is set that receives the
- property value being set.
-
- Callback method to invoke.
-
- Invokes the given callback with the property value being set.
-
- mock.SetupSet(x => x.Suspended)
- .Callback((bool state) => Console.WriteLine(state));
-
-
-
-
-
- Allows the specification of a matching condition for an
- argument in a method invocation, rather than a specific
- argument value. "It" refers to the argument being matched.
-
- This class allows the setup to match a method invocation
- with an arbitrary value, with a value in a specified range, or
- even one that matches a given predicate.
-
-
-
-
- Matches any value of the given type.
-
- Typically used when the actual argument value for a method
- call is not relevant.
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException());
-
- Type of the value.
-
-
-
- Matches any value that satisfies the given predicate.
- Type of the argument to check.The predicate used to match the method argument.
- Allows the specification of a predicate to perform matching
- of method call arguments.
-
- This example shows how to return the value 1 whenever the argument to the
- Do method is an even number.
-
- mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0)))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0)))
- .Throws(new ArgumentException());
-
-
-
-
-
- Matches any value that is in the range specified.
- Type of the argument to check.The lower bound of the range.The upper bound of the range.
- The kind of range. See .
-
- The following example shows how to expect a method call
- with an integer argument within the 0..100 range.
-
- mock.Setup(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
- The pattern to use to match the string argument value.
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression:
-
- mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
- The pattern to use to match the string argument value.The options used to interpret the pattern.
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression, in a case insensitive way:
-
- mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1);
-
-
-
-
-
- Matcher to treat static functions as matchers.
-
- mock.Setup(x => x.StringMethod(A.MagicString()));
-
- public static class A
- {
- [Matcher]
- public static string MagicString() { return null; }
- public static bool MagicString(string arg)
- {
- return arg == "magic";
- }
- }
-
- Will succeed if: mock.Object.StringMethod("magic");
- and fail with any other call.
-
-
-
-
- Options to customize the behavior of the mock.
-
-
-
-
- Causes the mock to always throw
- an exception for invocations that don't have a
- corresponding setup.
-
-
-
-
- Will never throw exceptions, returning default
- values when necessary (null for reference types,
- zero for value types or empty enumerables and arrays).
-
-
-
-
- Default mock behavior, which equals .
-
-
-
-
- Exception thrown by mocks when setups are not matched,
- the mock is not properly setup, etc.
-
-
- A distinct exception type is provided so that exceptions
- thrown by the mock can be differentiated in tests that
- expect other exceptions to be thrown (i.e. ArgumentException).
-
- Richer exception hierarchy/types are not provided as
- tests typically should not catch or expect exceptions
- from the mocks. These are typically the result of changes
- in the tested class or its collaborators implementation, and
- result in fixes in the mock setup so that they dissapear and
- allow the test to pass.
-
-
-
-
-
- Supports the serialization infrastructure.
-
- Serialization information.
- Streaming context.
-
-
-
- Supports the serialization infrastructure.
-
- Serialization information.
- Streaming context.
-
-
-
- Made internal as it's of no use for
- consumers, but it's important for
- our own tests.
-
-
-
-
- Used by the mock factory to accumulate verification
- failures.
-
-
-
-
- Supports the serialization infrastructure.
-
-
-
-
- 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 Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that..
-
-
-
-
- Looks up a localized string similar to Value cannot be an empty string..
-
-
-
-
- Looks up a localized string similar to Can only add interfaces to the mock..
-
-
-
-
- Looks up a localized string similar to Can't set return value for void method {0}..
-
-
-
-
- Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks..
-
-
-
-
- Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type..
-
-
-
-
- Looks up a localized string similar to Could not locate event for attach or detach method {0}..
-
-
-
-
- Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead..
-
-
-
-
- Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. .
-
-
-
-
- Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces.
- Please cast the argument to one of the supported types: {1}.
- Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed..
-
-
-
-
- Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to LINQ method '{0}' not supported..
-
-
-
-
- Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to Member {0}.{1} does not exist..
-
-
-
-
- Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead:
- mock.Setup(x => x.{1}());
- .
-
-
-
-
- Looks up a localized string similar to {0} invocation failed with mock behavior {1}.
- {2}.
-
-
-
-
- Looks up a localized string similar to Expected only {0} calls to {1}..
-
-
-
-
- Looks up a localized string similar to Expected only one call to {0}..
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at least {2} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at least once, but was never performed: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at most {3} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at most once, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock exactly {2} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock should never have been performed, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock once, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to All invocations on the mock must have a corresponding setup..
-
-
-
-
- Looks up a localized string similar to Object instance was not created by Moq..
-
-
-
-
- Looks up a localized string similar to Out expression must evaluate to a constant value..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not have a getter..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not exist..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} is write-only..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} is read-only..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not have a setter..
-
-
-
-
- Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object..
-
-
-
-
- Looks up a localized string similar to Ref expression must evaluate to a constant value..
-
-
-
-
- Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it..
-
-
-
-
- Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>..
-
-
-
-
- Looks up a localized string similar to Invocation {0} should not have been made..
-
-
-
-
- Looks up a localized string similar to Expression is not a method invocation: {0}.
-
-
-
-
- Looks up a localized string similar to Expression is not a property access: {0}.
-
-
-
-
- Looks up a localized string similar to Expression is not a property setter invocation..
-
-
-
-
- Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}.
-
-
-
-
- Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}.
-
-
-
-
- Looks up a localized string similar to Type {0} does not implement required interface {1}.
-
-
-
-
- Looks up a localized string similar to Type {0} does not from required type {1}.
-
-
-
-
- Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as:
- mock.Setup(x => x.{1}).Returns(value);
- mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one
- mock.SetupSet(x => x.{1}).Callback(callbackDelegate);
- .
-
-
-
-
- Looks up a localized string similar to Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}..
-
-
-
-
- Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}..
-
-
-
-
- Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters..
-
-
-
-
- Looks up a localized string similar to Member {0} is not supported for protected mocking..
-
-
-
-
- Looks up a localized string similar to Setter expression can only use static custom matchers..
-
-
-
-
- Looks up a localized string similar to The following setups were not matched:
- {0}.
-
-
-
-
- Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}.
-
-
-
-
- Allows setups to be specified for protected members by using their
- name as a string, rather than strong-typing them which is not possible
- due to their visibility.
-
-
-
-
- Specifies a setup for a void method invocation with the given
- , optionally specifying arguments for the method call.
-
- The name of the void method to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
-
-
-
- Specifies a setup for an invocation on a property or a non void method with the given
- , optionally specifying arguments for the method call.
-
- The name of the method or property to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
- The return type of the method or property.
-
-
-
- Specifies a setup for an invocation on a property getter with the given
- .
-
- The name of the property.
- The type of the property.
-
-
-
- Specifies a setup for an invocation on a property setter with the given
- .
-
- The name of the property.
- The property value. If argument matchers are used,
- remember to use rather than .
- The type of the property.
-
-
-
- Specifies a verify for a void method with the given ,
- optionally specifying arguments for the method call. Use in conjuntion with the default
- .
-
- The invocation was not call the times specified by
- .
- The name of the void method to be verified.
- The number of times a method is allowed to be called.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
-
-
-
- Specifies a verify for an invocation on a property or a non void method with the given
- , optionally specifying arguments for the method call.
-
- The invocation was not call the times specified by
- .
- The name of the method or property to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
- The number of times a method is allowed to be called.
- The type of return value from the expression.
-
-
-
- Specifies a verify for an invocation on a property getter with the given
- .
- The invocation was not call the times specified by
- .
-
- The name of the property.
- The number of times a method is allowed to be called.
- The type of the property.
-
-
-
- Specifies a setup for an invocation on a property setter with the given
- .
-
- The invocation was not call the times specified by
- .
- The name of the property.
- The number of times a method is allowed to be called.
- The property value.
- The type of the property. If argument matchers are used,
- remember to use rather than .
-
-
-
- Allows the specification of a matching condition for an
- argument in a protected member setup, rather than a specific
- argument value. "ItExpr" refers to the argument being matched.
-
-
- Use this variant of argument matching instead of
- for protected setups.
- This class allows the setup to match a method invocation
- with an arbitrary value, with a value in a specified range, or
- even one that matches a given predicate, or null.
-
-
-
-
- Matches a null value of the given type.
-
-
- Required for protected mocks as the null value cannot be used
- directly as it prevents proper method overload selection.
-
-
-
- // Throws an exception for a call to Remove with a null string value.
- mock.Protected()
- .Setup("Remove", ItExpr.IsNull<string>())
- .Throws(new InvalidOperationException());
-
-
- Type of the value.
-
-
-
- Matches any value of the given type.
-
-
- Typically used when the actual argument value for a method
- call is not relevant.
-
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Protected()
- .Setup("Remove", ItExpr.IsAny<string>())
- .Throws(new InvalidOperationException());
-
-
- Type of the value.
-
-
-
- Matches any value that satisfies the given predicate.
-
- Type of the argument to check.
- The predicate used to match the method argument.
-
- Allows the specification of a predicate to perform matching
- of method call arguments.
-
-
- This example shows how to return the value 1 whenever the argument to the
- Do method is an even number.
-
- mock.Protected()
- .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Protected()
- .Setup("GetUser", ItExpr.Is<int>(i => i < 0))
- .Throws(new ArgumentException());
-
-
-
-
-
- Matches any value that is in the range specified.
-
- Type of the argument to check.
- The lower bound of the range.
- The upper bound of the range.
- The kind of range. See .
-
- The following example shows how to expect a method call
- with an integer argument within the 0..100 range.
-
- mock.Protected()
- .Setup("HasInventory",
- ItExpr.IsAny<string>(),
- ItExpr.IsInRange(0, 100, Range.Inclusive))
- .Returns(false);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
-
- The pattern to use to match the string argument value.
-
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression:
-
- mock.Protected()
- .Setup("Check", ItExpr.IsRegex("[a-z]+"))
- .Returns(1);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
-
- The pattern to use to match the string argument value.
- The options used to interpret the pattern.
-
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression, in a case insensitive way:
-
- mock.Protected()
- .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase))
- .Returns(1);
-
-
-
-
-
- Enables the Protected() method on ,
- allowing setups to be set for protected members by using their
- name as a string, rather than strong-typing them which is not possible
- due to their visibility.
-
-
-
-
- Enable protected setups for the mock.
-
- Mocked object type. Typically omitted as it can be inferred from the mock instance.
- The mock to set the protected setups on.
-
-
-
-
-
-
-
-
-
-
-
- Kind of range to use in a filter specified through
- .
-
-
-
-
- The range includes the to and
- from values.
-
-
-
-
- The range does not include the to and
- from values.
-
-
-
-
- Determines the way default values are generated
- calculated for loose mocks.
-
-
-
-
- Default behavior, which generates empty values for
- value types (i.e. default(int)), empty array and
- enumerables, and nulls for all other reference types.
-
-
-
-
- Whenever the default value generated by
- is null, replaces this value with a mock (if the type
- can be mocked).
-
-
- For sealed classes, a null value will be generated.
-
-
-
-
- A default implementation of IQueryable for use with QueryProvider
-
-
-
-
- The is a
- static method that returns an IQueryable of Mocks of T which is used to
- apply the linq specification to.
-
-
-
-
- Allows creation custom value matchers that can be used on setups and verification,
- completely replacing the built-in class with your own argument
- matching rules.
-
- See also .
-
-
-
-
- Provided for the sole purpose of rendering the delegate passed to the
- matcher constructor if no friendly render lambda is provided.
-
-
-
-
- Initializes the match with the condition that
- will be checked in order to match invocation
- values.
- The condition to match against actual values.
-
-
-
-
-
-
-
-
- This method is used to set an expression as the last matcher invoked,
- which is used in the SetupSet to allow matchers in the prop = value
- delegate expression. This delegate is executed in "fluent" mode in
- order to capture the value being set, and construct the corresponding
- methodcall.
- This is also used in the MatcherFactory for each argument expression.
- This method ensures that when we execute the delegate, we
- also track the matcher that was invoked, so that when we create the
- methodcall we build the expression using it, rather than the null/default
- value returned from the actual invocation.
-
-
-
-
- Allows creation custom value matchers that can be used on setups and verification,
- completely replacing the built-in class with your own argument
- matching rules.
- Type of the value to match.
- The argument matching is used to determine whether a concrete
- invocation in the mock matches a given setup. This
- matching mechanism is fully extensible.
-
- Creating a custom matcher is straightforward. You just need to create a method
- that returns a value from a call to with
- your matching condition and optional friendly render expression:
-
- [Matcher]
- public Order IsBigOrder()
- {
- return Match<Order>.Create(
- o => o.GrandTotal >= 5000,
- /* a friendly expression to render on failures */
- () => IsBigOrder());
- }
-
- This method can be used in any mock setup invocation:
-
- mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>();
-
- At runtime, Moq knows that the return value was a matcher (note that the method MUST be
- annotated with the [Matcher] attribute in order to determine this) and
- evaluates your predicate with the actual value passed into your predicate.
-
- Another example might be a case where you want to match a lists of orders
- that contains a particular one. You might create matcher like the following:
-
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order));
- }
- }
-
- Now we can invoke this static method instead of an argument in an
- invocation:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
-
-
-
-
- Tracks the current mock and interception context.
-
-
-
-
- Having an active fluent mock context means that the invocation
- is being performed in "trial" mode, just to gather the
- target method and arguments that need to be matched later
- when the actual invocation is made.
-
-
-
-
- A that returns an empty default value
- for non-mockeable types, and mocks for all other types (interfaces and
- non-sealed classes) that can be mocked.
-
-
-
-
- Allows querying the universe of mocks for those that behave
- according to the LINQ query specification.
-
-
- This entry-point into Linq to Mocks is the only one in the root Moq
- namespace to ease discovery. But to get all the mocking extension
- methods on Object, a using of Moq.Linq must be done, so that the
- polluting of the intellisense for all objects is an explicit opt-in.
-
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The type of the mocked object to query.
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The predicate with the setup expressions.
- The type of the mocked object to query.
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the setup expressions.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates the mock query with the underlying queriable implementation.
-
-
-
-
- Wraps the enumerator inside a queryable.
-
-
-
-
- Method that is turned into the actual call from .Query{T}, to
- transform the queryable query into a normal enumerable query.
- This method is never used directly by consumers.
-
-
-
-
- Extension method used to support Linq-like setup properties that are not virtual but do have
- a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :)
-
-
-
-
- Helper extensions that are used by the query translator.
-
-
-
-
- Retrieves a fluent mock from the given setup expression.
-
-
-
-
- Defines the number of invocations allowed by a mocked method.
-
-
-
-
- Specifies that a mocked method should be invoked times as minimum.
- The minimun number of times.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked one time as minimum.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked time as maximun.
- The maximun number of times.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked one time as maximun.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked between and
- times.
- The minimun number of times.The maximun number of times.
- The kind of range. See .
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked exactly times.
- The times that a method or property can be called.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should not be invoked.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked exactly one time.
- An object defining the allowed number of invocations.
-
-
-
- Determines whether the specified is equal to this instance.
-
- The to compare with this instance.
-
- true if the specified is equal to this instance; otherwise, false.
-
-
-
-
- Returns a hash code for this instance.
-
- A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
-
-
-
-
- Determines whether two specified objects have the same value.
-
- The first .
-
- The second .
-
- true if the value of left is the same as the value of right; otherwise, false.
-
-
-
-
- Determines whether two specified objects have different values.
-
- The first .
-
- The second .
-
- true if the value of left is different from the value of right; otherwise, false.
-
-
-
-
diff --git a/packages/Moq.4.0.10827/lib/NET40/Moq.dll b/packages/Moq.4.0.10827/lib/NET40/Moq.dll
deleted file mode 100644
index 3a3e653..0000000
Binary files a/packages/Moq.4.0.10827/lib/NET40/Moq.dll and /dev/null differ
diff --git a/packages/Moq.4.0.10827/lib/NET40/Moq.xml b/packages/Moq.4.0.10827/lib/NET40/Moq.xml
deleted file mode 100644
index 13b8804..0000000
--- a/packages/Moq.4.0.10827/lib/NET40/Moq.xml
+++ /dev/null
@@ -1,5120 +0,0 @@
-
-
-
- Moq
-
-
-
-
- Implements the fluent API.
-
-
-
-
- The expectation will be considered only in the former condition.
-
-
-
-
-
-
- The expectation will be considered only in the former condition.
-
-
-
-
-
-
-
- Setups the get.
-
- The type of the property.
- The expression.
-
-
-
-
- Setups the set.
-
- The type of the property.
- The setter expression.
-
-
-
-
- Setups the set.
-
- The setter expression.
-
-
-
-
- Defines the Callback verb and overloads.
-
-
-
-
- Helper interface used to hide the base
- members from the fluent API to make it much cleaner
- in Visual Studio intellisense.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Specifies a callback to invoke when the method is called.
-
- The callback method to invoke.
-
- The following example specifies a callback to set a boolean
- value that can be used later:
-
- var called = false;
- mock.Setup(x => x.Execute())
- .Callback(() => called = true);
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The argument type of the invoked method.
- The callback method to invoke.
-
- Invokes the given callback with the concrete invocation argument value.
-
- Notice how the specific string argument is retrieved by simply declaring
- it as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Callback((string command) => Console.WriteLine(command));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
-
-
-
-
-
- Defines the Callback verb and overloads for callbacks on
- setups that return a value.
-
- Mocked type.
- Type of the return value of the setup.
-
-
-
- Specifies a callback to invoke when the method is called.
-
- The callback method to invoke.
-
- The following example specifies a callback to set a boolean value that can be used later:
-
- var called = false;
- mock.Setup(x => x.Execute())
- .Callback(() => called = true)
- .Returns(true);
-
- Note that in the case of value-returning methods, after the Callback
- call you can still specify the return value.
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the argument of the invoked method.
- Callback method to invoke.
-
- Invokes the given callback with the concrete invocation argument value.
-
- Notice how the specific string argument is retrieved by simply declaring
- it as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Callback(command => Console.WriteLine(command))
- .Returns(true);
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
-
-
-
-
-
- Defines the Raises verb.
-
-
-
-
- Specifies the event that will be raised
- when the setup is met.
-
- An expression that represents an event attach or detach action.
- The event arguments to pass for the raised event.
-
- The following example shows how to raise an event when
- the setup is met:
-
- var mock = new Mock<IContainer>();
-
- mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>()))
- .Raises(add => add.Added += null, EventArgs.Empty);
-
-
-
-
-
- Specifies the event that will be raised
- when the setup is matched.
-
- An expression that represents an event attach or detach action.
- A function that will build the
- to pass when raising the event.
-
-
-
-
- Specifies the custom event that will be raised
- when the setup is matched.
-
- An expression that represents an event attach or detach action.
- The arguments to pass to the custom delegate (non EventHandler-compatible).
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
- The type of the fifteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
- The type of the fifteenth argument received by the expected invocation.
- The type of the sixteenth argument received by the expected invocation.
-
-
-
-
- Defines the Returns verb.
-
- Mocked type.
- Type of the return value from the expression.
-
-
-
- Specifies the value to return.
-
- The value to return, or .
-
- Return a true value from the method call:
-
- mock.Setup(x => x.Execute("ping"))
- .Returns(true);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method.
-
- The function that will calculate the return value.
-
- Return a calculated value when the method is called:
-
- mock.Setup(x => x.Execute("ping"))
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the method
- is executed and the value the returnValues array has at
- that moment.
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the argument of the invoked method.
- The function that will calculate the return value.
-
- Return a calculated value which is evaluated lazily at the time of the invocation.
-
- The lookup list can change between invocations and the setup
- will return different values accordingly. Also, notice how the specific
- string argument is retrieved by simply declaring it as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Returns((string command) => returnValues[command]);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2) => arg1 + arg2);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16);
-
-
-
-
-
- Language for ReturnSequence
-
-
-
-
- Returns value
-
-
-
-
- Throws an exception
-
-
-
-
- Throws an exception
-
-
-
-
- The first method call or member access will be the
- last segment of the expression (depth-first traversal),
- which is the one we have to Setup rather than FluentMock.
- And the last one is the one we have to Mock.Get rather
- than FluentMock.
-
-
-
-
- Base class for mocks and static helper class with methods that
- apply to mocked objects, such as to
- retrieve a from an object instance.
-
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the specification of how the mocked object should behave.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Retrieves the mock object for the given object instance.
-
- Type of the mock to retrieve. Can be omitted as it's inferred
- from the object instance passed in as the instance.
- The instance of the mocked object.The mock associated with the mocked object.
- The received instance
- was not created by Moq.
-
- The following example shows how to add a new setup to an object
- instance which is not the original but rather
- the object associated with it:
-
- // Typed instance, not the mock, is retrieved from some test API.
- HttpContextBase context = GetMockContext();
-
- // context.Request is the typed object from the "real" API
- // so in order to add a setup to it, we need to get
- // the mock that "owns" it
- Mock<HttpRequestBase> request = Mock.Get(context.Request);
- mock.Setup(req => req.AppRelativeCurrentExecutionFilePath)
- .Returns(tempUrl);
-
-
-
-
-
- Returns the mocked object value.
-
-
-
-
- Verifies that all verifiable expectations have been met.
-
- This example sets up an expectation and marks it as verifiable. After
- the mock is used, a Verify() call is issued on the mock
- to ensure the method in the setup was invoked:
-
- var mock = new Mock<IWarehouse>();
- this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory.
- this.Verify();
-
- Not all verifiable expectations were met.
-
-
-
- Verifies all expectations regardless of whether they have
- been flagged as verifiable.
-
- This example sets up an expectation without marking it as verifiable. After
- the mock is used, a call is issued on the mock
- to ensure that all expectations are met:
-
- var mock = new Mock<IWarehouse>();
- this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory, even
- // that expectation was not marked as verifiable.
- this.VerifyAll();
-
- At least one expectation was not met.
-
-
-
- Gets the interceptor target for the given expression and root mock,
- building the intermediate hierarchy of mock objects if necessary.
-
-
-
-
- Raises the associated event with the given
- event argument data.
-
-
-
-
- Raises the associated event with the given
- event argument data.
-
-
-
-
- Adds an interface implementation to the mock,
- allowing setups to be specified for it.
-
- This method can only be called before the first use
- of the mock property, at which
- point the runtime type has already been generated
- and no more interfaces can be added to it.
-
- Also, must be an
- interface and not a class, which must be specified
- when creating the mock instead.
-
-
- The mock type
- has already been generated by accessing the property.
-
- The specified
- is not an interface.
-
- The following example creates a mock for the main interface
- and later adds to it to verify
- it's called by the consumer code:
-
- var mock = new Mock<IProcessor>();
- mock.Setup(x => x.Execute("ping"));
-
- // add IDisposable interface
- var disposable = mock.As<IDisposable>();
- disposable.Setup(d => d.Dispose()).Verifiable();
-
- Type of interface to cast the mock to.
-
-
-
-
-
-
- Behavior of the mock, according to the value set in the constructor.
-
-
-
-
- Whether the base member virtual implementation will be called
- for mocked classes if no setup is matched. Defaults to .
-
-
-
-
- Specifies the behavior to use when returning default values for
- unexpected invocations on loose mocks.
-
-
-
-
- Gets the mocked object instance.
-
-
-
-
- Retrieves the type of the mocked object, its generic type argument.
- This is used in the auto-mocking of hierarchy access.
-
-
-
-
- Specifies the class that will determine the default
- value to return when invocations are made that
- have no setups and need to return a default
- value (for loose mocks).
-
-
-
-
- Exposes the list of extra interfaces implemented by the mock.
-
-
-
-
- Utility repository class to use to construct multiple
- mocks when consistent verification is
- desired for all of them.
-
-
- If multiple mocks will be created during a test, passing
- the desired (if different than the
- or the one
- passed to the repository constructor) and later verifying each
- mock can become repetitive and tedious.
-
- This repository class helps in that scenario by providing a
- simplified creation of multiple mocks with a default
- (unless overriden by calling
- ) and posterior verification.
-
-
-
- The following is a straightforward example on how to
- create and automatically verify strict mocks using a :
-
- var repository = new MockRepository(MockBehavior.Strict);
-
- var foo = repository.Create<IFoo>();
- var bar = repository.Create<IBar>();
-
- // no need to call Verifiable() on the setup
- // as we'll be validating all of them anyway.
- foo.Setup(f => f.Do());
- bar.Setup(b => b.Redo());
-
- // exercise the mocks here
-
- repository.VerifyAll();
- // At this point all setups are already checked
- // and an optional MockException might be thrown.
- // Note also that because the mocks are strict, any invocation
- // that doesn't have a matching setup will also throw a MockException.
-
- The following examples shows how to setup the repository
- to create loose mocks and later verify only verifiable setups:
-
- var repository = new MockRepository(MockBehavior.Loose);
-
- var foo = repository.Create<IFoo>();
- var bar = repository.Create<IBar>();
-
- // this setup will be verified when we verify the repository
- foo.Setup(f => f.Do()).Verifiable();
-
- // this setup will NOT be verified
- foo.Setup(f => f.Calculate());
-
- // this setup will be verified when we verify the repository
- bar.Setup(b => b.Redo()).Verifiable();
-
- // exercise the mocks here
- // note that because the mocks are Loose, members
- // called in the interfaces for which no matching
- // setups exist will NOT throw exceptions,
- // and will rather return default values.
-
- repository.Verify();
- // At this point verifiable setups are already checked
- // and an optional MockException might be thrown.
-
- The following examples shows how to setup the repository with a
- default strict behavior, overriding that default for a
- specific mock:
-
- var repository = new MockRepository(MockBehavior.Strict);
-
- // this particular one we want loose
- var foo = repository.Create<IFoo>(MockBehavior.Loose);
- var bar = repository.Create<IBar>();
-
- // specify setups
-
- // exercise the mocks here
-
- repository.Verify();
-
-
-
-
-
-
- Utility factory class to use to construct multiple
- mocks when consistent verification is
- desired for all of them.
-
-
- If multiple mocks will be created during a test, passing
- the desired (if different than the
- or the one
- passed to the factory constructor) and later verifying each
- mock can become repetitive and tedious.
-
- This factory class helps in that scenario by providing a
- simplified creation of multiple mocks with a default
- (unless overriden by calling
- ) and posterior verification.
-
-
-
- The following is a straightforward example on how to
- create and automatically verify strict mocks using a :
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // no need to call Verifiable() on the setup
- // as we'll be validating all of them anyway.
- foo.Setup(f => f.Do());
- bar.Setup(b => b.Redo());
-
- // exercise the mocks here
-
- factory.VerifyAll();
- // At this point all setups are already checked
- // and an optional MockException might be thrown.
- // Note also that because the mocks are strict, any invocation
- // that doesn't have a matching setup will also throw a MockException.
-
- The following examples shows how to setup the factory
- to create loose mocks and later verify only verifiable setups:
-
- var factory = new MockFactory(MockBehavior.Loose);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // this setup will be verified when we verify the factory
- foo.Setup(f => f.Do()).Verifiable();
-
- // this setup will NOT be verified
- foo.Setup(f => f.Calculate());
-
- // this setup will be verified when we verify the factory
- bar.Setup(b => b.Redo()).Verifiable();
-
- // exercise the mocks here
- // note that because the mocks are Loose, members
- // called in the interfaces for which no matching
- // setups exist will NOT throw exceptions,
- // and will rather return default values.
-
- factory.Verify();
- // At this point verifiable setups are already checked
- // and an optional MockException might be thrown.
-
- The following examples shows how to setup the factory with a
- default strict behavior, overriding that default for a
- specific mock:
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- // this particular one we want loose
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
- var bar = factory.Create<IBar>();
-
- // specify setups
-
- // exercise the mocks here
-
- factory.Verify();
-
-
-
-
-
-
- Initializes the factory with the given
- for newly created mocks from the factory.
-
- The behavior to use for mocks created
- using the factory method if not overriden
- by using the overload.
-
-
-
- Creates a new mock with the default
- specified at factory construction time.
-
- Type to mock.
- A new .
-
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- // use mock on tests
-
- factory.VerifyAll();
-
-
-
-
-
- Creates a new mock with the default
- specified at factory construction time and with the
- the given constructor arguments for the class.
-
-
- The mock will try to find the best match constructor given the
- constructor arguments, and invoke that to initialize the instance.
- This applies only to classes, not interfaces.
-
- Type to mock.
- Constructor arguments for mocked classes.
- A new .
-
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>("Foo", 25, true);
- // use mock on tests
-
- factory.Verify();
-
-
-
-
-
- Creates a new mock with the given .
-
- Type to mock.
- Behavior to use for the mock, which overrides
- the default behavior specified at factory construction time.
- A new .
-
- The following example shows how to create a mock with a different
- behavior to that specified as the default for the factory:
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
-
-
-
-
-
- Creates a new mock with the given
- and with the the given constructor arguments for the class.
-
-
- The mock will try to find the best match constructor given the
- constructor arguments, and invoke that to initialize the instance.
- This applies only to classes, not interfaces.
-
- Type to mock.
- Behavior to use for the mock, which overrides
- the default behavior specified at factory construction time.
- Constructor arguments for mocked classes.
- A new .
-
- The following example shows how to create a mock with a different
- behavior to that specified as the default for the factory, passing
- constructor arguments:
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true);
-
-
-
-
-
- Implements creation of a new mock within the factory.
-
- Type to mock.
- The behavior for the new mock.
- Optional arguments for the construction of the mock.
-
-
-
- Verifies all verifiable expectations on all mocks created
- by this factory.
-
-
- One or more mocks had expectations that were not satisfied.
-
-
-
- Verifies all verifiable expectations on all mocks created
- by this factory.
-
-
- One or more mocks had expectations that were not satisfied.
-
-
-
- Invokes for each mock
- in , and accumulates the resulting
- that might be
- thrown from the action.
-
- The action to execute against
- each mock.
-
-
-
- Whether the base member virtual implementation will be called
- for mocked classes if no setup is matched. Defaults to .
-
-
-
-
- Specifies the behavior to use when returning default values for
- unexpected invocations on loose mocks.
-
-
-
-
- Gets the mocks that have been created by this factory and
- that will get verified together.
-
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The type of the mocked object to query.
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The predicate with the setup expressions.
- The type of the mocked object to query.
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the setup expressions.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates the mock query with the underlying queriable implementation.
-
-
-
-
- Wraps the enumerator inside a queryable.
-
-
-
-
- Method that is turned into the actual call from .Query{T}, to
- transform the queryable query into a normal enumerable query.
- This method is never used directly by consumers.
-
-
-
-
- Initializes the repository with the given
- for newly created mocks from the repository.
-
- The behavior to use for mocks created
- using the repository method if not overriden
- by using the overload.
-
-
-
- A that returns an empty default value
- for invocations that do not have setups or return values, with loose mocks.
- This is the default behavior for a mock.
-
-
-
-
- Interface to be implemented by classes that determine the
- default value of non-expected invocations.
-
-
-
-
- Defines the default value to return in all the methods returning .
- The type of the return value.The value to set as default.
-
-
-
- Provides a value for the given member and arguments.
-
- The member to provide a default value for.
-
-
-
-
- The intention of is to create a more readable
- string representation for the failure message.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Throws verb.
-
-
-
-
- Specifies the exception to throw when the method is invoked.
-
- Exception instance to throw.
-
- This example shows how to throw an exception when the method is
- invoked with an empty string argument:
-
- mock.Setup(x => x.Execute(""))
- .Throws(new ArgumentException());
-
-
-
-
-
- Specifies the type of exception to throw when the method is invoked.
-
- Type of exception to instantiate and throw when the setup is matched.
-
- This example shows how to throw an exception when the method is
- invoked with an empty string argument:
-
- mock.Setup(x => x.Execute(""))
- .Throws<ArgumentException>();
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines occurrence members to constraint setups.
-
-
-
-
- The expected invocation can happen at most once.
-
-
-
- var mock = new Mock<ICommand>();
- mock.Setup(foo => foo.Execute("ping"))
- .AtMostOnce();
-
-
-
-
-
- The expected invocation can happen at most specified number of times.
-
- The number of times to accept calls.
-
-
- var mock = new Mock<ICommand>();
- mock.Setup(foo => foo.Execute("ping"))
- .AtMost( 5 );
-
-
-
-
-
- Defines the Verifiable verb.
-
-
-
-
- Marks the expectation as verifiable, meaning that a call
- to will check if this particular
- expectation was met.
-
-
- The following example marks the expectation as verifiable:
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true)
- .Verifiable();
-
-
-
-
-
- Marks the expectation as verifiable, meaning that a call
- to will check if this particular
- expectation was met, and specifies a message for failures.
-
-
- The following example marks the expectation as verifiable:
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true)
- .Verifiable("Ping should be executed always!");
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- We need this non-generics base class so that
- we can use from
- generic code.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb for property getter setups.
-
-
- Mocked type.
- Type of the property.
-
-
-
- Specifies a callback to invoke when the property is retrieved.
-
- Callback method to invoke.
-
- Invokes the given callback with the property value being set.
-
- mock.SetupGet(x => x.Suspended)
- .Callback(() => called = true)
- .Returns(true);
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Returns verb for property get setups.
-
- Mocked type.
- Type of the property.
-
-
-
- Specifies the value to return.
-
- The value to return, or .
-
- Return a true value from the property getter call:
-
- mock.SetupGet(x => x.Suspended)
- .Returns(true);
-
-
-
-
-
- Specifies a function that will calculate the value to return for the property.
-
- The function that will calculate the return value.
-
- Return a calculated value when the property is retrieved:
-
- mock.SetupGet(x => x.Suspended)
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the property
- is retrieved and the value the returnValues array has at
- that moment.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Helper class to setup a full trace between many mocks
-
-
-
-
- Initialize a trace setup
-
-
-
-
- Allow sequence to be repeated
-
-
-
-
- define nice api
-
-
-
-
- Perform an expectation in the trace.
-
-
-
-
- Marks a method as a matcher, which allows complete replacement
- of the built-in class with your own argument
- matching rules.
-
-
- This feature has been deprecated in favor of the new
- and simpler .
-
-
- The argument matching is used to determine whether a concrete
- invocation in the mock matches a given setup. This
- matching mechanism is fully extensible.
-
-
- There are two parts of a matcher: the compiler matcher
- and the runtime matcher.
-
- -
- Compiler matcher
- Used to satisfy the compiler requirements for the
- argument. Needs to be a method optionally receiving any arguments
- you might need for the matching, but with a return type that
- matches that of the argument.
-
- Let's say I want to match a lists of orders that contains
- a particular one. I might create a compiler matcher like the following:
-
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
- }
-
- Now we can invoke this static method instead of an argument in an
- invocation:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- Note that the return value from the compiler matcher is irrelevant.
- This method will never be called, and is just used to satisfy the
- compiler and to signal Moq that this is not a method that we want
- to be invoked at runtime.
-
-
- -
- Runtime matcher
-
- The runtime matcher is the one that will actually perform evaluation
- when the test is run, and is defined by convention to have the
- same signature as the compiler matcher, but where the return
- value is the first argument to the call, which contains the
- object received by the actual invocation at runtime:
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
-
- At runtime, the mocked method will be invoked with a specific
- list of orders. This value will be passed to this runtime
- matcher as the first argument, while the second argument is the
- one specified in the setup (x.Save(Orders.Contains(order))).
-
- The boolean returned determines whether the given argument has been
- matched. If all arguments to the expected method are matched, then
- the setup matches and is evaluated.
-
-
-
-
-
- Using this extensible infrastructure, you can easily replace the entire
- set of matchers with your own. You can also avoid the
- typical (and annoying) lengthy expressions that result when you have
- multiple arguments that use generics.
-
-
- The following is the complete example explained above:
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
- }
-
- And the concrete test using this matcher:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- // use mock, invoke Save, and have the matcher filter.
-
-
-
-
-
- Provides a mock implementation of .
-
- Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked.
-
- The behavior of the mock with regards to the setups and the actual calls is determined
- by the optional that can be passed to the
- constructor.
-
- Type to mock, which can be an interface or a class.
- The following example shows establishing setups with specific values
- for method invocations:
-
- // Arrange
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
-
- // Act
- order.Fill(mock.Object);
-
- // Assert
- Assert.True(order.IsFilled);
-
- The following example shows how to use the class
- to specify conditions for arguments instead of specific values:
-
- // Arrange
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- // shows how to expect a value within a range
- mock.Setup(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
- // shows how to throw for unexpected calls.
- mock.Setup(x => x.Remove(
- It.IsAny<string>(),
- It.IsAny<int>()))
- .Throws(new InvalidOperationException());
-
- // Act
- order.Fill(mock.Object);
-
- // Assert
- Assert.False(order.IsFilled);
-
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Ctor invoked by AsTInterface exclusively.
-
-
-
-
- Initializes an instance of the mock with default behavior.
-
- var mock = new Mock<IFormatProvider>();
-
-
-
-
- Initializes an instance of the mock with default behavior and with
- the given constructor arguments for the class. (Only valid when is a class)
-
- The mock will try to find the best match constructor given the constructor arguments, and invoke that
- to initialize the instance. This applies only for classes, not interfaces.
-
- var mock = new Mock<MyProvider>(someArgument, 25);
- Optional constructor arguments if the mocked type is a class.
-
-
-
- Initializes an instance of the mock with the specified behavior.
-
- var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed);
- Behavior of the mock.
-
-
-
- Initializes an instance of the mock with a specific behavior with
- the given constructor arguments for the class.
-
- The mock will try to find the best match constructor given the constructor arguments, and invoke that
- to initialize the instance. This applies only to classes, not interfaces.
-
- var mock = new Mock<MyProvider>(someArgument, 25);
- Behavior of the mock.Optional constructor arguments if the mocked type is a class.
-
-
-
- Returns the mocked object value.
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a void method.
-
- If more than one setup is specified for the same method or property,
- the latest one wins and is the one that will be executed.
- Lambda expression that specifies the expected method invocation.
-
- var mock = new Mock<IProcessor>();
- mock.Setup(x => x.Execute("ping"));
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a value returning method.
- Type of the return value. Typically omitted as it can be inferred from the expression.
- If more than one setup is specified for the same method or property,
- the latest one wins and is the one that will be executed.
- Lambda expression that specifies the method invocation.
-
- mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property getter.
-
- If more than one setup is set for the same property getter,
- the latest one wins and is the one that will be executed.
- Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter.
-
- mock.SetupGet(x => x.Suspended)
- .Returns(true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter.
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
-
- This overloads allows the use of a callback already
- typed for the property type.
-
- Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value.
-
- mock.SetupSet(x => x.Suspended = true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter.
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
- Lambda expression that sets a property to a value.
-
- mock.SetupSet(x => x.Suspended = true);
-
-
-
-
-
- Specifies that the given property should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. (this is also
- known as "stubbing").
-
- Type of the property, inferred from the property
- expression (does not need to be specified).
- Property expression to stub.
- If you have an interface with an int property Value, you might
- stub it using the following straightforward call:
-
- var mock = new Mock<IHaveValue>();
- mock.Stub(v => v.Value);
-
- After the Stub call has been issued, setting and
- retrieving the object value will behave as expected:
-
- IHaveValue v = mock.Object;
-
- v.Value = 5;
- Assert.Equal(5, v.Value);
-
-
-
-
-
- Specifies that the given property should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. This overload
- allows setting the initial value for the property. (this is also
- known as "stubbing").
-
- Type of the property, inferred from the property
- expression (does not need to be specified).
- Property expression to stub.Initial value for the property.
- If you have an interface with an int property Value, you might
- stub it using the following straightforward call:
-
- var mock = new Mock<IHaveValue>();
- mock.SetupProperty(v => v.Value, 5);
-
- After the SetupProperty call has been issued, setting and
- retrieving the object value will behave as expected:
-
- IHaveValue v = mock.Object;
- // Initial value was stored
- Assert.Equal(5, v.Value);
-
- // New value set which changes the initial value
- v.Value = 6;
- Assert.Equal(6, v.Value);
-
-
-
-
-
- Specifies that the all properties on the mock should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. (this is also
- known as "stubbing"). The default value for each property will be the
- one generated as specified by the property for the mock.
-
- If the mock is set to ,
- the mocked default values will also get all properties setup recursively.
-
-
-
-
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IProcessor>();
- // exercise mock
- //...
- // Will throw if the test code didn't call Execute with a "ping" string argument.
- mock.Verify(proc => proc.Execute("ping"));
-
- The invocation was not performed on the mock.Expression to verify.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock,
- specifying a failure error message. Use in conjuntion with the default
- .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IProcessor>();
- // exercise mock
- //...
- // Will throw if the test code didn't call Execute with a "ping" string argument.
- mock.Verify(proc => proc.Execute("ping"));
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock,
- specifying a failure error message. Use in conjuntion with the default
- .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't call HasInventory.
- mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50));
-
- The invocation was not performed on the mock.Expression to verify.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock. Use in conjuntion
- with the default .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock, specifying a failure
- error message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't call HasInventory.
- mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked");
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock, specifying a failure
- error message.
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression.
-
-
-
- Verifies that a property was read on the mock.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was retrieved from it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't retrieve the IsClosed property.
- mock.VerifyGet(warehouse => warehouse.IsClosed);
-
- The invocation was not performed on the mock.Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock, specifying a failure
- error message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was retrieved from it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't retrieve the IsClosed property.
- mock.VerifyGet(warehouse => warehouse.IsClosed);
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock, specifying a failure
- error message.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was set on the mock.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was set on it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed = true);
-
- The invocation was not performed on the mock.Expression to verify.
-
-
-
- Verifies that a property was set on the mock.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.
-
-
-
- Verifies that a property was set on the mock, specifying
- a failure message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was set on it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action");
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
-
-
-
- Verifies that a property was set on the mock, specifying
- a failure message.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails.
-
-
-
- Raises the event referenced in using
- the given argument.
-
- The argument is
- invalid for the target event invocation, or the is
- not an event attach or detach expression.
-
- The following example shows how to raise a event:
-
- var mock = new Mock<IViewModel>();
-
- mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name"));
-
-
- This example shows how to invoke an event with a custom event arguments
- class in a view that will cause its corresponding presenter to
- react by changing its state:
-
- var mockView = new Mock<IOrdersView>();
- var presenter = new OrdersPresenter(mockView.Object);
-
- // Check that the presenter has no selection by default
- Assert.Null(presenter.SelectedOrder);
-
- // Raise the event with a specific arguments data
- mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) });
-
- // Now the presenter reacted to the event, and we have a selected order
- Assert.NotNull(presenter.SelectedOrder);
- Assert.Equal("moq", presenter.SelectedOrder.ProductName);
-
-
-
-
-
- Raises the event referenced in using
- the given argument for a non-EventHandler typed event.
-
- The arguments are
- invalid for the target event invocation, or the is
- not an event attach or detach expression.
-
- The following example shows how to raise a custom event that does not adhere to
- the standard EventHandler:
-
- var mock = new Mock<IViewModel>();
-
- mock.Raise(x => x.MyEvent -= null, "Name", bool, 25);
-
-
-
-
-
- Exposes the mocked object instance.
-
-
-
-
- Provides legacy API members as extensions so that
- existing code continues to compile, but new code
- doesn't see then.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Provides additional methods on mocks.
-
-
- Provided as extension methods as they confuse the compiler
- with the overloads taking Action.
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter, regardless of its value.
-
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
-
- Type of the property. Typically omitted as it can be inferred from the expression.
- Type of the mock.
- The target mock for the setup.
- Lambda expression that specifies the property setter.
-
-
- mock.SetupSet(x => x.Suspended);
-
-
-
- This method is not legacy, but must be on an extension method to avoid
- confusing the compiler with the new Action syntax.
-
-
-
-
- Verifies that a property has been set on the mock, regarless of its value.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- Expression to verify.
- The mock instance.
- Mocked type.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, specifying a failure
- error message.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- Expression to verify.
- Message to show if verification fails.
- The mock instance.
- Mocked type.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, regardless
- of the value but only the specified number of times.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- The invocation was not call the times specified by
- .
- The mock instance.
- Mocked type.
- The number of times a method is allowed to be called.
- Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, regardless
- of the value but only the specified number of times, and specifying a failure
- error message.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- The invocation was not call the times specified by
- .
- The mock instance.
- Mocked type.
- The number of times a method is allowed to be called.
- Message to show if verification fails.
- Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Helper for sequencing return values in the same method.
-
-
-
-
- Return a sequence of values, once per call.
-
-
-
-
- Casts the expression to a lambda expression, removing
- a cast if there's any.
-
-
-
-
- Casts the body of the lambda expression to a .
-
- If the body is not a method call.
-
-
-
- Converts the body of the lambda expression into the referenced by it.
-
-
-
-
- Checks whether the body of the lambda expression is a property access.
-
-
-
-
- Checks whether the expression is a property access.
-
-
-
-
- Checks whether the body of the lambda expression is a property indexer, which is true
- when the expression is an whose
- has
- equal to .
-
-
-
-
- Checks whether the expression is a property indexer, which is true
- when the expression is an whose
- has
- equal to .
-
-
-
-
- Creates an expression that casts the given expression to the
- type.
-
-
-
-
- TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583
- is fixed.
-
-
-
-
- Provides partial evaluation of subtrees, whenever they can be evaluated locally.
-
- Matt Warren: http://blogs.msdn.com/mattwar
- Documented by InSTEDD: http://www.instedd.org
-
-
-
- Performs evaluation and replacement of independent sub-trees
-
- The root of the expression tree.
- A function that decides whether a given expression
- node can be part of the local function.
- A new tree with sub-trees evaluated and replaced.
-
-
-
- Performs evaluation and replacement of independent sub-trees
-
- The root of the expression tree.
- A new tree with sub-trees evaluated and replaced.
-
-
-
- Evaluates and replaces sub-trees when first candidate is reached (top-down)
-
-
-
-
- Performs bottom-up analysis to determine which nodes can possibly
- be part of an evaluated sub-tree.
-
-
-
-
- Ensures the given is not null.
- Throws otherwise.
-
-
-
-
- Ensures the given string is not null or empty.
- Throws in the first case, or
- in the latter.
-
-
-
-
- Checks an argument to ensure it is in the specified range including the edges.
-
- Type of the argument to check, it must be an type.
-
- The expression containing the name of the argument.
- The argument value to check.
- The minimun allowed value for the argument.
- The maximun allowed value for the argument.
-
-
-
- Checks an argument to ensure it is in the specified range excluding the edges.
-
- Type of the argument to check, it must be an type.
-
- The expression containing the name of the argument.
- The argument value to check.
- The minimun allowed value for the argument.
- The maximun allowed value for the argument.
-
-
-
- Implemented by all generated mock object instances.
-
-
-
-
- Implemented by all generated mock object instances.
-
-
-
-
- Reference the Mock that contains this as the mock.Object value.
-
-
-
-
- Reference the Mock that contains this as the mock.Object value.
-
-
-
-
- Implements the actual interception and method invocation for
- all mocks.
-
-
-
-
- Get an eventInfo for a given event name. Search type ancestors depth first if necessary.
-
- Name of the event, with the set_ or get_ prefix already removed
-
-
-
- Given a type return all of its ancestors, both types and interfaces.
-
- The type to find immediate ancestors of
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb for property setter setups.
-
- Type of the property.
-
-
-
- Specifies a callback to invoke when the property is set that receives the
- property value being set.
-
- Callback method to invoke.
-
- Invokes the given callback with the property value being set.
-
- mock.SetupSet(x => x.Suspended)
- .Callback((bool state) => Console.WriteLine(state));
-
-
-
-
-
- Allows the specification of a matching condition for an
- argument in a method invocation, rather than a specific
- argument value. "It" refers to the argument being matched.
-
- This class allows the setup to match a method invocation
- with an arbitrary value, with a value in a specified range, or
- even one that matches a given predicate.
-
-
-
-
- Matches any value of the given type.
-
- Typically used when the actual argument value for a method
- call is not relevant.
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException());
-
- Type of the value.
-
-
-
- Matches any value that satisfies the given predicate.
- Type of the argument to check.The predicate used to match the method argument.
- Allows the specification of a predicate to perform matching
- of method call arguments.
-
- This example shows how to return the value 1 whenever the argument to the
- Do method is an even number.
-
- mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0)))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0)))
- .Throws(new ArgumentException());
-
-
-
-
-
- Matches any value that is in the range specified.
- Type of the argument to check.The lower bound of the range.The upper bound of the range.
- The kind of range. See .
-
- The following example shows how to expect a method call
- with an integer argument within the 0..100 range.
-
- mock.Setup(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
- The pattern to use to match the string argument value.
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression:
-
- mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
- The pattern to use to match the string argument value.The options used to interpret the pattern.
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression, in a case insensitive way:
-
- mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1);
-
-
-
-
-
- Matcher to treat static functions as matchers.
-
- mock.Setup(x => x.StringMethod(A.MagicString()));
-
- public static class A
- {
- [Matcher]
- public static string MagicString() { return null; }
- public static bool MagicString(string arg)
- {
- return arg == "magic";
- }
- }
-
- Will succeed if: mock.Object.StringMethod("magic");
- and fail with any other call.
-
-
-
-
- Options to customize the behavior of the mock.
-
-
-
-
- Causes the mock to always throw
- an exception for invocations that don't have a
- corresponding setup.
-
-
-
-
- Will never throw exceptions, returning default
- values when necessary (null for reference types,
- zero for value types or empty enumerables and arrays).
-
-
-
-
- Default mock behavior, which equals .
-
-
-
-
- Exception thrown by mocks when setups are not matched,
- the mock is not properly setup, etc.
-
-
- A distinct exception type is provided so that exceptions
- thrown by the mock can be differentiated in tests that
- expect other exceptions to be thrown (i.e. ArgumentException).
-
- Richer exception hierarchy/types are not provided as
- tests typically should not catch or expect exceptions
- from the mocks. These are typically the result of changes
- in the tested class or its collaborators implementation, and
- result in fixes in the mock setup so that they dissapear and
- allow the test to pass.
-
-
-
-
-
- Supports the serialization infrastructure.
-
- Serialization information.
- Streaming context.
-
-
-
- Supports the serialization infrastructure.
-
- Serialization information.
- Streaming context.
-
-
-
- Made internal as it's of no use for
- consumers, but it's important for
- our own tests.
-
-
-
-
- Used by the mock factory to accumulate verification
- failures.
-
-
-
-
- Supports the serialization infrastructure.
-
-
-
-
- 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 Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that..
-
-
-
-
- Looks up a localized string similar to Value cannot be an empty string..
-
-
-
-
- Looks up a localized string similar to Can only add interfaces to the mock..
-
-
-
-
- Looks up a localized string similar to Can't set return value for void method {0}..
-
-
-
-
- Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks..
-
-
-
-
- Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type..
-
-
-
-
- Looks up a localized string similar to Could not locate event for attach or detach method {0}..
-
-
-
-
- Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead..
-
-
-
-
- Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. .
-
-
-
-
- Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces.
- Please cast the argument to one of the supported types: {1}.
- Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed..
-
-
-
-
- Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to LINQ method '{0}' not supported..
-
-
-
-
- Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to Member {0}.{1} does not exist..
-
-
-
-
- Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead:
- mock.Setup(x => x.{1}());
- .
-
-
-
-
- Looks up a localized string similar to {0} invocation failed with mock behavior {1}.
- {2}.
-
-
-
-
- Looks up a localized string similar to Expected only {0} calls to {1}..
-
-
-
-
- Looks up a localized string similar to Expected only one call to {0}..
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at least {2} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at least once, but was never performed: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at most {3} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at most once, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock exactly {2} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock should never have been performed, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock once, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to All invocations on the mock must have a corresponding setup..
-
-
-
-
- Looks up a localized string similar to Object instance was not created by Moq..
-
-
-
-
- Looks up a localized string similar to Out expression must evaluate to a constant value..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not have a getter..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not exist..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} is write-only..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} is read-only..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not have a setter..
-
-
-
-
- Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object..
-
-
-
-
- Looks up a localized string similar to Ref expression must evaluate to a constant value..
-
-
-
-
- Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it..
-
-
-
-
- Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>..
-
-
-
-
- Looks up a localized string similar to Invocation {0} should not have been made..
-
-
-
-
- Looks up a localized string similar to Expression is not a method invocation: {0}.
-
-
-
-
- Looks up a localized string similar to Expression is not a property access: {0}.
-
-
-
-
- Looks up a localized string similar to Expression is not a property setter invocation..
-
-
-
-
- Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}.
-
-
-
-
- Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}.
-
-
-
-
- Looks up a localized string similar to Type {0} does not implement required interface {1}.
-
-
-
-
- Looks up a localized string similar to Type {0} does not from required type {1}.
-
-
-
-
- Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as:
- mock.Setup(x => x.{1}).Returns(value);
- mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one
- mock.SetupSet(x => x.{1}).Callback(callbackDelegate);
- .
-
-
-
-
- Looks up a localized string similar to Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}..
-
-
-
-
- Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}..
-
-
-
-
- Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters..
-
-
-
-
- Looks up a localized string similar to Member {0} is not supported for protected mocking..
-
-
-
-
- Looks up a localized string similar to Setter expression can only use static custom matchers..
-
-
-
-
- Looks up a localized string similar to The following setups were not matched:
- {0}.
-
-
-
-
- Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}.
-
-
-
-
- Allows setups to be specified for protected members by using their
- name as a string, rather than strong-typing them which is not possible
- due to their visibility.
-
-
-
-
- Specifies a setup for a void method invocation with the given
- , optionally specifying arguments for the method call.
-
- The name of the void method to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
-
-
-
- Specifies a setup for an invocation on a property or a non void method with the given
- , optionally specifying arguments for the method call.
-
- The name of the method or property to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
- The return type of the method or property.
-
-
-
- Specifies a setup for an invocation on a property getter with the given
- .
-
- The name of the property.
- The type of the property.
-
-
-
- Specifies a setup for an invocation on a property setter with the given
- .
-
- The name of the property.
- The property value. If argument matchers are used,
- remember to use rather than .
- The type of the property.
-
-
-
- Specifies a verify for a void method with the given ,
- optionally specifying arguments for the method call. Use in conjuntion with the default
- .
-
- The invocation was not call the times specified by
- .
- The name of the void method to be verified.
- The number of times a method is allowed to be called.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
-
-
-
- Specifies a verify for an invocation on a property or a non void method with the given
- , optionally specifying arguments for the method call.
-
- The invocation was not call the times specified by
- .
- The name of the method or property to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
- The number of times a method is allowed to be called.
- The type of return value from the expression.
-
-
-
- Specifies a verify for an invocation on a property getter with the given
- .
- The invocation was not call the times specified by
- .
-
- The name of the property.
- The number of times a method is allowed to be called.
- The type of the property.
-
-
-
- Specifies a setup for an invocation on a property setter with the given
- .
-
- The invocation was not call the times specified by
- .
- The name of the property.
- The number of times a method is allowed to be called.
- The property value.
- The type of the property. If argument matchers are used,
- remember to use rather than .
-
-
-
- Allows the specification of a matching condition for an
- argument in a protected member setup, rather than a specific
- argument value. "ItExpr" refers to the argument being matched.
-
-
- Use this variant of argument matching instead of
- for protected setups.
- This class allows the setup to match a method invocation
- with an arbitrary value, with a value in a specified range, or
- even one that matches a given predicate, or null.
-
-
-
-
- Matches a null value of the given type.
-
-
- Required for protected mocks as the null value cannot be used
- directly as it prevents proper method overload selection.
-
-
-
- // Throws an exception for a call to Remove with a null string value.
- mock.Protected()
- .Setup("Remove", ItExpr.IsNull<string>())
- .Throws(new InvalidOperationException());
-
-
- Type of the value.
-
-
-
- Matches any value of the given type.
-
-
- Typically used when the actual argument value for a method
- call is not relevant.
-
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Protected()
- .Setup("Remove", ItExpr.IsAny<string>())
- .Throws(new InvalidOperationException());
-
-
- Type of the value.
-
-
-
- Matches any value that satisfies the given predicate.
-
- Type of the argument to check.
- The predicate used to match the method argument.
-
- Allows the specification of a predicate to perform matching
- of method call arguments.
-
-
- This example shows how to return the value 1 whenever the argument to the
- Do method is an even number.
-
- mock.Protected()
- .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Protected()
- .Setup("GetUser", ItExpr.Is<int>(i => i < 0))
- .Throws(new ArgumentException());
-
-
-
-
-
- Matches any value that is in the range specified.
-
- Type of the argument to check.
- The lower bound of the range.
- The upper bound of the range.
- The kind of range. See .
-
- The following example shows how to expect a method call
- with an integer argument within the 0..100 range.
-
- mock.Protected()
- .Setup("HasInventory",
- ItExpr.IsAny<string>(),
- ItExpr.IsInRange(0, 100, Range.Inclusive))
- .Returns(false);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
-
- The pattern to use to match the string argument value.
-
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression:
-
- mock.Protected()
- .Setup("Check", ItExpr.IsRegex("[a-z]+"))
- .Returns(1);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
-
- The pattern to use to match the string argument value.
- The options used to interpret the pattern.
-
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression, in a case insensitive way:
-
- mock.Protected()
- .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase))
- .Returns(1);
-
-
-
-
-
- Enables the Protected() method on ,
- allowing setups to be set for protected members by using their
- name as a string, rather than strong-typing them which is not possible
- due to their visibility.
-
-
-
-
- Enable protected setups for the mock.
-
- Mocked object type. Typically omitted as it can be inferred from the mock instance.
- The mock to set the protected setups on.
-
-
-
-
-
-
-
-
-
-
-
- Kind of range to use in a filter specified through
- .
-
-
-
-
- The range includes the to and
- from values.
-
-
-
-
- The range does not include the to and
- from values.
-
-
-
-
- Determines the way default values are generated
- calculated for loose mocks.
-
-
-
-
- Default behavior, which generates empty values for
- value types (i.e. default(int)), empty array and
- enumerables, and nulls for all other reference types.
-
-
-
-
- Whenever the default value generated by
- is null, replaces this value with a mock (if the type
- can be mocked).
-
-
- For sealed classes, a null value will be generated.
-
-
-
-
- A default implementation of IQueryable for use with QueryProvider
-
-
-
-
- The is a
- static method that returns an IQueryable of Mocks of T which is used to
- apply the linq specification to.
-
-
-
-
- Allows creation custom value matchers that can be used on setups and verification,
- completely replacing the built-in class with your own argument
- matching rules.
-
- See also .
-
-
-
-
- Provided for the sole purpose of rendering the delegate passed to the
- matcher constructor if no friendly render lambda is provided.
-
-
-
-
- Initializes the match with the condition that
- will be checked in order to match invocation
- values.
- The condition to match against actual values.
-
-
-
-
-
-
-
-
- This method is used to set an expression as the last matcher invoked,
- which is used in the SetupSet to allow matchers in the prop = value
- delegate expression. This delegate is executed in "fluent" mode in
- order to capture the value being set, and construct the corresponding
- methodcall.
- This is also used in the MatcherFactory for each argument expression.
- This method ensures that when we execute the delegate, we
- also track the matcher that was invoked, so that when we create the
- methodcall we build the expression using it, rather than the null/default
- value returned from the actual invocation.
-
-
-
-
- Allows creation custom value matchers that can be used on setups and verification,
- completely replacing the built-in class with your own argument
- matching rules.
- Type of the value to match.
- The argument matching is used to determine whether a concrete
- invocation in the mock matches a given setup. This
- matching mechanism is fully extensible.
-
- Creating a custom matcher is straightforward. You just need to create a method
- that returns a value from a call to with
- your matching condition and optional friendly render expression:
-
- [Matcher]
- public Order IsBigOrder()
- {
- return Match<Order>.Create(
- o => o.GrandTotal >= 5000,
- /* a friendly expression to render on failures */
- () => IsBigOrder());
- }
-
- This method can be used in any mock setup invocation:
-
- mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>();
-
- At runtime, Moq knows that the return value was a matcher (note that the method MUST be
- annotated with the [Matcher] attribute in order to determine this) and
- evaluates your predicate with the actual value passed into your predicate.
-
- Another example might be a case where you want to match a lists of orders
- that contains a particular one. You might create matcher like the following:
-
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order));
- }
- }
-
- Now we can invoke this static method instead of an argument in an
- invocation:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
-
-
-
-
- Tracks the current mock and interception context.
-
-
-
-
- Having an active fluent mock context means that the invocation
- is being performed in "trial" mode, just to gather the
- target method and arguments that need to be matched later
- when the actual invocation is made.
-
-
-
-
- A that returns an empty default value
- for non-mockeable types, and mocks for all other types (interfaces and
- non-sealed classes) that can be mocked.
-
-
-
-
- Allows querying the universe of mocks for those that behave
- according to the LINQ query specification.
-
-
- This entry-point into Linq to Mocks is the only one in the root Moq
- namespace to ease discovery. But to get all the mocking extension
- methods on Object, a using of Moq.Linq must be done, so that the
- polluting of the intellisense for all objects is an explicit opt-in.
-
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The type of the mocked object to query.
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The predicate with the setup expressions.
- The type of the mocked object to query.
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the setup expressions.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates the mock query with the underlying queriable implementation.
-
-
-
-
- Wraps the enumerator inside a queryable.
-
-
-
-
- Method that is turned into the actual call from .Query{T}, to
- transform the queryable query into a normal enumerable query.
- This method is never used directly by consumers.
-
-
-
-
- Extension method used to support Linq-like setup properties that are not virtual but do have
- a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :)
-
-
-
-
- Helper extensions that are used by the query translator.
-
-
-
-
- Retrieves a fluent mock from the given setup expression.
-
-
-
-
- Defines the number of invocations allowed by a mocked method.
-
-
-
-
- Specifies that a mocked method should be invoked times as minimum.
- The minimun number of times.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked one time as minimum.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked time as maximun.
- The maximun number of times.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked one time as maximun.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked between and
- times.
- The minimun number of times.The maximun number of times.
- The kind of range. See .
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked exactly times.
- The times that a method or property can be called.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should not be invoked.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked exactly one time.
- An object defining the allowed number of invocations.
-
-
-
- Determines whether the specified is equal to this instance.
-
- The to compare with this instance.
-
- true if the specified is equal to this instance; otherwise, false.
-
-
-
-
- Returns a hash code for this instance.
-
- A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
-
-
-
-
- Determines whether two specified objects have the same value.
-
- The first .
-
- The second .
-
- true if the value of left is the same as the value of right; otherwise, false.
-
-
-
-
- Determines whether two specified objects have different values.
-
- The first .
-
- The second .
-
- true if the value of left is different from the value of right; otherwise, false.
-
-
-
-
diff --git a/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll b/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll
deleted file mode 100644
index a887ecd..0000000
Binary files a/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll and /dev/null differ
diff --git a/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll
deleted file mode 100644
index fb516c1..0000000
Binary files a/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll and /dev/null differ
diff --git a/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.xml b/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.xml
deleted file mode 100644
index ac37f5c..0000000
--- a/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.xml
+++ /dev/null
@@ -1,5101 +0,0 @@
-
-
-
- Moq.Silverlight
-
-
-
-
- Provides a mock implementation of .
-
- Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked.
-
- The behavior of the mock with regards to the setups and the actual calls is determined
- by the optional that can be passed to the
- constructor.
-
- Type to mock, which can be an interface or a class.
- The following example shows establishing setups with specific values
- for method invocations:
-
- // Arrange
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
-
- // Act
- order.Fill(mock.Object);
-
- // Assert
- Assert.True(order.IsFilled);
-
- The following example shows how to use the class
- to specify conditions for arguments instead of specific values:
-
- // Arrange
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- // shows how to expect a value within a range
- mock.Setup(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
- // shows how to throw for unexpected calls.
- mock.Setup(x => x.Remove(
- It.IsAny<string>(),
- It.IsAny<int>()))
- .Throws(new InvalidOperationException());
-
- // Act
- order.Fill(mock.Object);
-
- // Assert
- Assert.False(order.IsFilled);
-
-
-
-
-
- Base class for mocks and static helper class with methods that
- apply to mocked objects, such as to
- retrieve a from an object instance.
-
-
-
-
- Helper interface used to hide the base
- members from the fluent API to make it much cleaner
- in Visual Studio intellisense.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the specification of how the mocked object should behave.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Retrieves the mock object for the given object instance.
-
- Type of the mock to retrieve. Can be omitted as it's inferred
- from the object instance passed in as the instance.
- The instance of the mocked object.The mock associated with the mocked object.
- The received instance
- was not created by Moq.
-
- The following example shows how to add a new setup to an object
- instance which is not the original but rather
- the object associated with it:
-
- // Typed instance, not the mock, is retrieved from some test API.
- HttpContextBase context = GetMockContext();
-
- // context.Request is the typed object from the "real" API
- // so in order to add a setup to it, we need to get
- // the mock that "owns" it
- Mock<HttpRequestBase> request = Mock.Get(context.Request);
- mock.Setup(req => req.AppRelativeCurrentExecutionFilePath)
- .Returns(tempUrl);
-
-
-
-
-
- Returns the mocked object value.
-
-
-
-
- Verifies that all verifiable expectations have been met.
-
- This example sets up an expectation and marks it as verifiable. After
- the mock is used, a Verify() call is issued on the mock
- to ensure the method in the setup was invoked:
-
- var mock = new Mock<IWarehouse>();
- this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory.
- this.Verify();
-
- Not all verifiable expectations were met.
-
-
-
- Verifies all expectations regardless of whether they have
- been flagged as verifiable.
-
- This example sets up an expectation without marking it as verifiable. After
- the mock is used, a call is issued on the mock
- to ensure that all expectations are met:
-
- var mock = new Mock<IWarehouse>();
- this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory, even
- // that expectation was not marked as verifiable.
- this.VerifyAll();
-
- At least one expectation was not met.
-
-
-
- Gets the interceptor target for the given expression and root mock,
- building the intermediate hierarchy of mock objects if necessary.
-
-
-
-
- Raises the associated event with the given
- event argument data.
-
-
-
-
- Raises the associated event with the given
- event argument data.
-
-
-
-
- Adds an interface implementation to the mock,
- allowing setups to be specified for it.
-
- This method can only be called before the first use
- of the mock property, at which
- point the runtime type has already been generated
- and no more interfaces can be added to it.
-
- Also, must be an
- interface and not a class, which must be specified
- when creating the mock instead.
-
-
- The mock type
- has already been generated by accessing the property.
-
- The specified
- is not an interface.
-
- The following example creates a mock for the main interface
- and later adds to it to verify
- it's called by the consumer code:
-
- var mock = new Mock<IProcessor>();
- mock.Setup(x => x.Execute("ping"));
-
- // add IDisposable interface
- var disposable = mock.As<IDisposable>();
- disposable.Setup(d => d.Dispose()).Verifiable();
-
- Type of interface to cast the mock to.
-
-
-
-
-
-
- Behavior of the mock, according to the value set in the constructor.
-
-
-
-
- Whether the base member virtual implementation will be called
- for mocked classes if no setup is matched. Defaults to .
-
-
-
-
- Specifies the behavior to use when returning default values for
- unexpected invocations on loose mocks.
-
-
-
-
- Gets the mocked object instance.
-
-
-
-
- Retrieves the type of the mocked object, its generic type argument.
- This is used in the auto-mocking of hierarchy access.
-
-
-
-
- Specifies the class that will determine the default
- value to return when invocations are made that
- have no setups and need to return a default
- value (for loose mocks).
-
-
-
-
- Exposes the list of extra interfaces implemented by the mock.
-
-
-
-
- Ctor invoked by AsTInterface exclusively.
-
-
-
-
- Initializes an instance of the mock with default behavior.
-
- var mock = new Mock<IFormatProvider>();
-
-
-
-
- Initializes an instance of the mock with default behavior and with
- the given constructor arguments for the class. (Only valid when is a class)
-
- The mock will try to find the best match constructor given the constructor arguments, and invoke that
- to initialize the instance. This applies only for classes, not interfaces.
-
- var mock = new Mock<MyProvider>(someArgument, 25);
- Optional constructor arguments if the mocked type is a class.
-
-
-
- Initializes an instance of the mock with the specified behavior.
-
- var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed);
- Behavior of the mock.
-
-
-
- Initializes an instance of the mock with a specific behavior with
- the given constructor arguments for the class.
-
- The mock will try to find the best match constructor given the constructor arguments, and invoke that
- to initialize the instance. This applies only to classes, not interfaces.
-
- var mock = new Mock<MyProvider>(someArgument, 25);
- Behavior of the mock.Optional constructor arguments if the mocked type is a class.
-
-
-
- Returns the mocked object value.
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a void method.
-
- If more than one setup is specified for the same method or property,
- the latest one wins and is the one that will be executed.
- Lambda expression that specifies the expected method invocation.
-
- var mock = new Mock<IProcessor>();
- mock.Setup(x => x.Execute("ping"));
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a value returning method.
- Type of the return value. Typically omitted as it can be inferred from the expression.
- If more than one setup is specified for the same method or property,
- the latest one wins and is the one that will be executed.
- Lambda expression that specifies the method invocation.
-
- mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property getter.
-
- If more than one setup is set for the same property getter,
- the latest one wins and is the one that will be executed.
- Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter.
-
- mock.SetupGet(x => x.Suspended)
- .Returns(true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter.
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
-
- This overloads allows the use of a callback already
- typed for the property type.
-
- Type of the property. Typically omitted as it can be inferred from the expression.The Lambda expression that sets a property to a value.
-
- mock.SetupSet(x => x.Suspended = true);
-
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter.
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
- Lambda expression that sets a property to a value.
-
- mock.SetupSet(x => x.Suspended = true);
-
-
-
-
-
- Specifies that the given property should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. (this is also
- known as "stubbing").
-
- Type of the property, inferred from the property
- expression (does not need to be specified).
- Property expression to stub.
- If you have an interface with an int property Value, you might
- stub it using the following straightforward call:
-
- var mock = new Mock<IHaveValue>();
- mock.Stub(v => v.Value);
-
- After the Stub call has been issued, setting and
- retrieving the object value will behave as expected:
-
- IHaveValue v = mock.Object;
-
- v.Value = 5;
- Assert.Equal(5, v.Value);
-
-
-
-
-
- Specifies that the given property should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. This overload
- allows setting the initial value for the property. (this is also
- known as "stubbing").
-
- Type of the property, inferred from the property
- expression (does not need to be specified).
- Property expression to stub.Initial value for the property.
- If you have an interface with an int property Value, you might
- stub it using the following straightforward call:
-
- var mock = new Mock<IHaveValue>();
- mock.SetupProperty(v => v.Value, 5);
-
- After the SetupProperty call has been issued, setting and
- retrieving the object value will behave as expected:
-
- IHaveValue v = mock.Object;
- // Initial value was stored
- Assert.Equal(5, v.Value);
-
- // New value set which changes the initial value
- v.Value = 6;
- Assert.Equal(6, v.Value);
-
-
-
-
-
- Specifies that the all properties on the mock should have "property behavior",
- meaning that setting its value will cause it to be saved and
- later returned when the property is requested. (this is also
- known as "stubbing"). The default value for each property will be the
- one generated as specified by the property for the mock.
-
- If the mock is set to ,
- the mocked default values will also get all properties setup recursively.
-
-
-
-
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IProcessor>();
- // exercise mock
- //...
- // Will throw if the test code didn't call Execute with a "ping" string argument.
- mock.Verify(proc => proc.Execute("ping"));
-
- The invocation was not performed on the mock.Expression to verify.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock,
- specifying a failure error message. Use in conjuntion with the default
- .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IProcessor>();
- // exercise mock
- //...
- // Will throw if the test code didn't call Execute with a "ping" string argument.
- mock.Verify(proc => proc.Execute("ping"));
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock,
- specifying a failure error message. Use in conjuntion with the default
- .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.
-
-
-
- Verifies that a specific invocation matching the given expression was performed on the mock. Use
- in conjuntion with the default .
-
- This example assumes that the mock has been used, and later we want to verify that a given
- invocation with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't call HasInventory.
- mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50));
-
- The invocation was not performed on the mock.Expression to verify.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock. Use in conjuntion
- with the default .
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock, specifying a failure
- error message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't call HasInventory.
- mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked");
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression.
-
-
-
- Verifies that a specific invocation matching the given
- expression was performed on the mock, specifying a failure
- error message.
-
- The invocation was not call the times specified by
- .
- Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression.
-
-
-
- Verifies that a property was read on the mock.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was retrieved from it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't retrieve the IsClosed property.
- mock.VerifyGet(warehouse => warehouse.IsClosed);
-
- The invocation was not performed on the mock.Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock, specifying a failure
- error message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was retrieved from it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't retrieve the IsClosed property.
- mock.VerifyGet(warehouse => warehouse.IsClosed);
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was read on the mock, specifying a failure
- error message.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
-
- Verifies that a property was set on the mock.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was set on it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed = true);
-
- The invocation was not performed on the mock.Expression to verify.
-
-
-
- Verifies that a property was set on the mock.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.
-
-
-
- Verifies that a property was set on the mock, specifying
- a failure message.
-
- This example assumes that the mock has been used,
- and later we want to verify that a given property
- was set on it:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action");
-
- The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.
-
-
-
- Verifies that a property was set on the mock, specifying
- a failure message.
-
- The invocation was not call the times specified by
- .
- The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails.
-
-
-
- Raises the event referenced in using
- the given argument.
-
- The argument is
- invalid for the target event invocation, or the is
- not an event attach or detach expression.
-
- The following example shows how to raise a event:
-
- var mock = new Mock<IViewModel>();
-
- mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name"));
-
-
- This example shows how to invoke an event with a custom event arguments
- class in a view that will cause its corresponding presenter to
- react by changing its state:
-
- var mockView = new Mock<IOrdersView>();
- var presenter = new OrdersPresenter(mockView.Object);
-
- // Check that the presenter has no selection by default
- Assert.Null(presenter.SelectedOrder);
-
- // Raise the event with a specific arguments data
- mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) });
-
- // Now the presenter reacted to the event, and we have a selected order
- Assert.NotNull(presenter.SelectedOrder);
- Assert.Equal("moq", presenter.SelectedOrder.ProductName);
-
-
-
-
-
- Raises the event referenced in using
- the given argument for a non-EventHandler typed event.
-
- The arguments are
- invalid for the target event invocation, or the is
- not an event attach or detach expression.
-
- The following example shows how to raise a custom event that does not adhere to
- the standard EventHandler:
-
- var mock = new Mock<IViewModel>();
-
- mock.Raise(x => x.MyEvent -= null, "Name", bool, 25);
-
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Exposes the mocked object instance.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- The expectation will be considered only in the former condition.
-
-
-
-
-
-
- The expectation will be considered only in the former condition.
-
-
-
-
-
-
-
- Setups the get.
-
- The type of the property.
- The expression.
-
-
-
-
- Setups the set.
-
- The type of the property.
- The setter expression.
-
-
-
-
- Setups the set.
-
- The setter expression.
-
-
-
-
- Determines the way default values are generated
- calculated for loose mocks.
-
-
-
-
- Default behavior, which generates empty values for
- value types (i.e. default(int)), empty array and
- enumerables, and nulls for all other reference types.
-
-
-
-
- Whenever the default value generated by
- is null, replaces this value with a mock (if the type
- can be mocked).
-
-
- For sealed classes, a null value will be generated.
-
-
-
-
- A that returns an empty default value
- for invocations that do not have setups or return values, with loose mocks.
- This is the default behavior for a mock.
-
-
-
-
- Interface to be implemented by classes that determine the
- default value of non-expected invocations.
-
-
-
-
- Defines the default value to return in all the methods returning .
- The type of the return value.The value to set as default.
-
-
-
- Provides a value for the given member and arguments.
-
- The member to provide a default value for.
-
-
-
-
- Provides partial evaluation of subtrees, whenever they can be evaluated locally.
-
- Matt Warren: http://blogs.msdn.com/mattwar
- Documented by InSTEDD: http://www.instedd.org
-
-
-
- Performs evaluation and replacement of independent sub-trees
-
- The root of the expression tree.
- A function that decides whether a given expression
- node can be part of the local function.
- A new tree with sub-trees evaluated and replaced.
-
-
-
- Performs evaluation and replacement of independent sub-trees
-
- The root of the expression tree.
- A new tree with sub-trees evaluated and replaced.
-
-
-
- Evaluates and replaces sub-trees when first candidate is reached (top-down)
-
-
-
-
- Performs bottom-up analysis to determine which nodes can possibly
- be part of an evaluated sub-tree.
-
-
-
-
- Casts the expression to a lambda expression, removing
- a cast if there's any.
-
-
-
-
- Casts the body of the lambda expression to a .
-
- If the body is not a method call.
-
-
-
- Converts the body of the lambda expression into the referenced by it.
-
-
-
-
- Checks whether the body of the lambda expression is a property access.
-
-
-
-
- Checks whether the expression is a property access.
-
-
-
-
- Checks whether the body of the lambda expression is a property indexer, which is true
- when the expression is an whose
- has
- equal to .
-
-
-
-
- Checks whether the expression is a property indexer, which is true
- when the expression is an whose
- has
- equal to .
-
-
-
-
- Creates an expression that casts the given expression to the
- type.
-
-
-
-
- TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583
- is fixed.
-
-
-
-
- The intention of is to create a more readable
- string representation for the failure message.
-
-
-
-
- Tracks the current mock and interception context.
-
-
-
-
- Having an active fluent mock context means that the invocation
- is being performed in "trial" mode, just to gather the
- target method and arguments that need to be matched later
- when the actual invocation is made.
-
-
-
-
- Ensures the given is not null.
- Throws otherwise.
-
-
-
-
- Ensures the given string is not null or empty.
- Throws in the first case, or
- in the latter.
-
-
-
-
- Checks an argument to ensure it is in the specified range including the edges.
-
- Type of the argument to check, it must be an type.
-
- The expression containing the name of the argument.
- The argument value to check.
- The minimun allowed value for the argument.
- The maximun allowed value for the argument.
-
-
-
- Checks an argument to ensure it is in the specified range excluding the edges.
-
- Type of the argument to check, it must be an type.
-
- The expression containing the name of the argument.
- The argument value to check.
- The minimun allowed value for the argument.
- The maximun allowed value for the argument.
-
-
-
- Implemented by all generated mock object instances.
-
-
-
-
- Implemented by all generated mock object instances.
-
-
-
-
- Reference the Mock that contains this as the mock.Object value.
-
-
-
-
- Reference the Mock that contains this as the mock.Object value.
-
-
-
-
- Implements the actual interception and method invocation for
- all mocks.
-
-
-
-
- Get an eventInfo for a given event name. Search type ancestors depth first if necessary.
-
- Name of the event, with the set_ or get_ prefix already removed
-
-
-
- Given a type return all of its ancestors, both types and interfaces.
-
- The type to find immediate ancestors of
-
-
-
- Allows the specification of a matching condition for an
- argument in a method invocation, rather than a specific
- argument value. "It" refers to the argument being matched.
-
- This class allows the setup to match a method invocation
- with an arbitrary value, with a value in a specified range, or
- even one that matches a given predicate.
-
-
-
-
- Matches any value of the given type.
-
- Typically used when the actual argument value for a method
- call is not relevant.
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException());
-
- Type of the value.
-
-
-
- Matches any value that satisfies the given predicate.
- Type of the argument to check.The predicate used to match the method argument.
- Allows the specification of a predicate to perform matching
- of method call arguments.
-
- This example shows how to return the value 1 whenever the argument to the
- Do method is an even number.
-
- mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0)))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0)))
- .Throws(new ArgumentException());
-
-
-
-
-
- Matches any value that is in the range specified.
- Type of the argument to check.The lower bound of the range.The upper bound of the range.
- The kind of range. See .
-
- The following example shows how to expect a method call
- with an integer argument within the 0..100 range.
-
- mock.Setup(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
- The pattern to use to match the string argument value.
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression:
-
- mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
- The pattern to use to match the string argument value.The options used to interpret the pattern.
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression, in a case insensitive way:
-
- mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1);
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb and overloads.
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
-
-
-
-
-
- Specifies a callback to invoke when the method is called.
-
- The callback method to invoke.
-
- The following example specifies a callback to set a boolean
- value that can be used later:
-
- var called = false;
- mock.Setup(x => x.Execute())
- .Callback(() => called = true);
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The argument type of the invoked method.
- The callback method to invoke.
-
- Invokes the given callback with the concrete invocation argument value.
-
- Notice how the specific string argument is retrieved by simply declaring
- it as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Callback((string command) => Console.WriteLine(command));
-
-
-
-
-
- Defines occurrence members to constraint setups.
-
-
-
-
- The expected invocation can happen at most once.
-
-
-
- var mock = new Mock<ICommand>();
- mock.Setup(foo => foo.Execute("ping"))
- .AtMostOnce();
-
-
-
-
-
- The expected invocation can happen at most specified number of times.
-
- The number of times to accept calls.
-
-
- var mock = new Mock<ICommand>();
- mock.Setup(foo => foo.Execute("ping"))
- .AtMost( 5 );
-
-
-
-
-
- Defines the Raises verb.
-
-
-
-
- Specifies the event that will be raised
- when the setup is met.
-
- An expression that represents an event attach or detach action.
- The event arguments to pass for the raised event.
-
- The following example shows how to raise an event when
- the setup is met:
-
- var mock = new Mock<IContainer>();
-
- mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>()))
- .Raises(add => add.Added += null, EventArgs.Empty);
-
-
-
-
-
- Specifies the event that will be raised
- when the setup is matched.
-
- An expression that represents an event attach or detach action.
- A function that will build the
- to pass when raising the event.
-
-
-
-
- Specifies the custom event that will be raised
- when the setup is matched.
-
- An expression that represents an event attach or detach action.
- The arguments to pass to the custom delegate (non EventHandler-compatible).
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
- The type of the fifteenth argument received by the expected invocation.
-
-
-
-
- Specifies the event that will be raised when the setup is matched.
-
- The expression that represents an event attach or detach action.
- The function that will build the
- to pass when raising the event.
- The type of the first argument received by the expected invocation.
- The type of the second argument received by the expected invocation.
- The type of the third argument received by the expected invocation.
- The type of the fourth argument received by the expected invocation.
- The type of the fifth argument received by the expected invocation.
- The type of the sixth argument received by the expected invocation.
- The type of the seventh argument received by the expected invocation.
- The type of the eighth argument received by the expected invocation.
- The type of the nineth argument received by the expected invocation.
- The type of the tenth argument received by the expected invocation.
- The type of the eleventh argument received by the expected invocation.
- The type of the twelfth argument received by the expected invocation.
- The type of the thirteenth argument received by the expected invocation.
- The type of the fourteenth argument received by the expected invocation.
- The type of the fifteenth argument received by the expected invocation.
- The type of the sixteenth argument received by the expected invocation.
-
-
-
-
- Defines the Verifiable verb.
-
-
-
-
- Marks the expectation as verifiable, meaning that a call
- to will check if this particular
- expectation was met.
-
-
- The following example marks the expectation as verifiable:
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true)
- .Verifiable();
-
-
-
-
-
- Marks the expectation as verifiable, meaning that a call
- to will check if this particular
- expectation was met, and specifies a message for failures.
-
-
- The following example marks the expectation as verifiable:
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true)
- .Verifiable("Ping should be executed always!");
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Throws verb.
-
-
-
-
- Specifies the exception to throw when the method is invoked.
-
- Exception instance to throw.
-
- This example shows how to throw an exception when the method is
- invoked with an empty string argument:
-
- mock.Setup(x => x.Execute(""))
- .Throws(new ArgumentException());
-
-
-
-
-
- Specifies the type of exception to throw when the method is invoked.
-
- Type of exception to instantiate and throw when the setup is matched.
-
- This example shows how to throw an exception when the method is
- invoked with an empty string argument:
-
- mock.Setup(x => x.Execute(""))
- .Throws<ArgumentException>();
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb and overloads for callbacks on
- setups that return a value.
-
- Mocked type.
- Type of the return value of the setup.
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
-
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original
- arguments.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The callback method to invoke.
- A reference to interface.
-
- Invokes the given callback with the concrete invocation arguments values.
-
- Notice how the specific arguments are retrieved by simply declaring
- them as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
-
-
-
-
-
- Specifies a callback to invoke when the method is called.
-
- The callback method to invoke.
-
- The following example specifies a callback to set a boolean value that can be used later:
-
- var called = false;
- mock.Setup(x => x.Execute())
- .Callback(() => called = true)
- .Returns(true);
-
- Note that in the case of value-returning methods, after the Callback
- call you can still specify the return value.
-
-
-
-
- Specifies a callback to invoke when the method is called that receives the original arguments.
-
- The type of the argument of the invoked method.
- Callback method to invoke.
-
- Invokes the given callback with the concrete invocation argument value.
-
- Notice how the specific string argument is retrieved by simply declaring
- it as part of the lambda expression for the callback:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Callback(command => Console.WriteLine(command))
- .Returns(true);
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Returns verb.
-
- Mocked type.
- Type of the return value from the expression.
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2) => arg1 + arg2);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the first argument of the invoked method.
- The type of the second argument of the invoked method.
- The type of the third argument of the invoked method.
- The type of the fourth argument of the invoked method.
- The type of the fifth argument of the invoked method.
- The type of the sixth argument of the invoked method.
- The type of the seventh argument of the invoked method.
- The type of the eighth argument of the invoked method.
- The type of the nineth argument of the invoked method.
- The type of the tenth argument of the invoked method.
- The type of the eleventh argument of the invoked method.
- The type of the twelfth argument of the invoked method.
- The type of the thirteenth argument of the invoked method.
- The type of the fourteenth argument of the invoked method.
- The type of the fifteenth argument of the invoked method.
- The type of the sixteenth argument of the invoked method.
- The function that will calculate the return value.
- Returns a calculated value which is evaluated lazily at the time of the invocation.
-
-
- The return value is calculated from the value of the actual method invocation arguments.
- Notice how the arguments are retrieved by simply declaring them as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16);
-
-
-
-
-
- Specifies the value to return.
-
- The value to return, or .
-
- Return a true value from the method call:
-
- mock.Setup(x => x.Execute("ping"))
- .Returns(true);
-
-
-
-
-
- Specifies a function that will calculate the value to return from the method.
-
- The function that will calculate the return value.
-
- Return a calculated value when the method is called:
-
- mock.Setup(x => x.Execute("ping"))
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the method
- is executed and the value the returnValues array has at
- that moment.
-
-
-
-
- Specifies a function that will calculate the value to return from the method,
- retrieving the arguments for the invocation.
-
- The type of the argument of the invoked method.
- The function that will calculate the return value.
-
- Return a calculated value which is evaluated lazily at the time of the invocation.
-
- The lookup list can change between invocations and the setup
- will return different values accordingly. Also, notice how the specific
- string argument is retrieved by simply declaring it as part of the lambda
- expression:
-
-
- mock.Setup(x => x.Execute(It.IsAny<string>()))
- .Returns((string command) => returnValues[command]);
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb for property getter setups.
-
-
- Mocked type.
- Type of the property.
-
-
-
- Specifies a callback to invoke when the property is retrieved.
-
- Callback method to invoke.
-
- Invokes the given callback with the property value being set.
-
- mock.SetupGet(x => x.Suspended)
- .Callback(() => called = true)
- .Returns(true);
-
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Returns verb for property get setups.
-
- Mocked type.
- Type of the property.
-
-
-
- Specifies the value to return.
-
- The value to return, or .
-
- Return a true value from the property getter call:
-
- mock.SetupGet(x => x.Suspended)
- .Returns(true);
-
-
-
-
-
- Specifies a function that will calculate the value to return for the property.
-
- The function that will calculate the return value.
-
- Return a calculated value when the property is retrieved:
-
- mock.SetupGet(x => x.Suspended)
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the property
- is retrieved and the value the returnValues array has at
- that moment.
-
-
-
-
- Implements the fluent API.
-
-
-
-
- Defines the Callback verb for property setter setups.
-
- Type of the property.
-
-
-
- Specifies a callback to invoke when the property is set that receives the
- property value being set.
-
- Callback method to invoke.
-
- Invokes the given callback with the property value being set.
-
- mock.SetupSet(x => x.Suspended)
- .Callback((bool state) => Console.WriteLine(state));
-
-
-
-
-
- Language for ReturnSequence
-
-
-
-
- Returns value
-
-
-
-
- Throws an exception
-
-
-
-
- Throws an exception
-
-
-
-
- The first method call or member access will be the
- last segment of the expression (depth-first traversal),
- which is the one we have to Setup rather than FluentMock.
- And the last one is the one we have to Mock.Get rather
- than FluentMock.
-
-
-
-
- A default implementation of IQueryable for use with QueryProvider
-
-
-
-
- The is a
- static method that returns an IQueryable of Mocks of T which is used to
- apply the linq specification to.
-
-
-
-
- Utility repository class to use to construct multiple
- mocks when consistent verification is
- desired for all of them.
-
-
- If multiple mocks will be created during a test, passing
- the desired (if different than the
- or the one
- passed to the repository constructor) and later verifying each
- mock can become repetitive and tedious.
-
- This repository class helps in that scenario by providing a
- simplified creation of multiple mocks with a default
- (unless overriden by calling
- ) and posterior verification.
-
-
-
- The following is a straightforward example on how to
- create and automatically verify strict mocks using a :
-
- var repository = new MockRepository(MockBehavior.Strict);
-
- var foo = repository.Create<IFoo>();
- var bar = repository.Create<IBar>();
-
- // no need to call Verifiable() on the setup
- // as we'll be validating all of them anyway.
- foo.Setup(f => f.Do());
- bar.Setup(b => b.Redo());
-
- // exercise the mocks here
-
- repository.VerifyAll();
- // At this point all setups are already checked
- // and an optional MockException might be thrown.
- // Note also that because the mocks are strict, any invocation
- // that doesn't have a matching setup will also throw a MockException.
-
- The following examples shows how to setup the repository
- to create loose mocks and later verify only verifiable setups:
-
- var repository = new MockRepository(MockBehavior.Loose);
-
- var foo = repository.Create<IFoo>();
- var bar = repository.Create<IBar>();
-
- // this setup will be verified when we verify the repository
- foo.Setup(f => f.Do()).Verifiable();
-
- // this setup will NOT be verified
- foo.Setup(f => f.Calculate());
-
- // this setup will be verified when we verify the repository
- bar.Setup(b => b.Redo()).Verifiable();
-
- // exercise the mocks here
- // note that because the mocks are Loose, members
- // called in the interfaces for which no matching
- // setups exist will NOT throw exceptions,
- // and will rather return default values.
-
- repository.Verify();
- // At this point verifiable setups are already checked
- // and an optional MockException might be thrown.
-
- The following examples shows how to setup the repository with a
- default strict behavior, overriding that default for a
- specific mock:
-
- var repository = new MockRepository(MockBehavior.Strict);
-
- // this particular one we want loose
- var foo = repository.Create<IFoo>(MockBehavior.Loose);
- var bar = repository.Create<IBar>();
-
- // specify setups
-
- // exercise the mocks here
-
- repository.Verify();
-
-
-
-
-
-
- Utility factory class to use to construct multiple
- mocks when consistent verification is
- desired for all of them.
-
-
- If multiple mocks will be created during a test, passing
- the desired (if different than the
- or the one
- passed to the factory constructor) and later verifying each
- mock can become repetitive and tedious.
-
- This factory class helps in that scenario by providing a
- simplified creation of multiple mocks with a default
- (unless overriden by calling
- ) and posterior verification.
-
-
-
- The following is a straightforward example on how to
- create and automatically verify strict mocks using a :
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // no need to call Verifiable() on the setup
- // as we'll be validating all of them anyway.
- foo.Setup(f => f.Do());
- bar.Setup(b => b.Redo());
-
- // exercise the mocks here
-
- factory.VerifyAll();
- // At this point all setups are already checked
- // and an optional MockException might be thrown.
- // Note also that because the mocks are strict, any invocation
- // that doesn't have a matching setup will also throw a MockException.
-
- The following examples shows how to setup the factory
- to create loose mocks and later verify only verifiable setups:
-
- var factory = new MockFactory(MockBehavior.Loose);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // this setup will be verified when we verify the factory
- foo.Setup(f => f.Do()).Verifiable();
-
- // this setup will NOT be verified
- foo.Setup(f => f.Calculate());
-
- // this setup will be verified when we verify the factory
- bar.Setup(b => b.Redo()).Verifiable();
-
- // exercise the mocks here
- // note that because the mocks are Loose, members
- // called in the interfaces for which no matching
- // setups exist will NOT throw exceptions,
- // and will rather return default values.
-
- factory.Verify();
- // At this point verifiable setups are already checked
- // and an optional MockException might be thrown.
-
- The following examples shows how to setup the factory with a
- default strict behavior, overriding that default for a
- specific mock:
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- // this particular one we want loose
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
- var bar = factory.Create<IBar>();
-
- // specify setups
-
- // exercise the mocks here
-
- factory.Verify();
-
-
-
-
-
-
- Initializes the factory with the given
- for newly created mocks from the factory.
-
- The behavior to use for mocks created
- using the factory method if not overriden
- by using the overload.
-
-
-
- Creates a new mock with the default
- specified at factory construction time.
-
- Type to mock.
- A new .
-
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- // use mock on tests
-
- factory.VerifyAll();
-
-
-
-
-
- Creates a new mock with the default
- specified at factory construction time and with the
- the given constructor arguments for the class.
-
-
- The mock will try to find the best match constructor given the
- constructor arguments, and invoke that to initialize the instance.
- This applies only to classes, not interfaces.
-
- Type to mock.
- Constructor arguments for mocked classes.
- A new .
-
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>("Foo", 25, true);
- // use mock on tests
-
- factory.Verify();
-
-
-
-
-
- Creates a new mock with the given .
-
- Type to mock.
- Behavior to use for the mock, which overrides
- the default behavior specified at factory construction time.
- A new .
-
- The following example shows how to create a mock with a different
- behavior to that specified as the default for the factory:
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
-
-
-
-
-
- Creates a new mock with the given
- and with the the given constructor arguments for the class.
-
-
- The mock will try to find the best match constructor given the
- constructor arguments, and invoke that to initialize the instance.
- This applies only to classes, not interfaces.
-
- Type to mock.
- Behavior to use for the mock, which overrides
- the default behavior specified at factory construction time.
- Constructor arguments for mocked classes.
- A new .
-
- The following example shows how to create a mock with a different
- behavior to that specified as the default for the factory, passing
- constructor arguments:
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true);
-
-
-
-
-
- Implements creation of a new mock within the factory.
-
- Type to mock.
- The behavior for the new mock.
- Optional arguments for the construction of the mock.
-
-
-
- Verifies all verifiable expectations on all mocks created
- by this factory.
-
-
- One or more mocks had expectations that were not satisfied.
-
-
-
- Verifies all verifiable expectations on all mocks created
- by this factory.
-
-
- One or more mocks had expectations that were not satisfied.
-
-
-
- Invokes for each mock
- in , and accumulates the resulting
- that might be
- thrown from the action.
-
- The action to execute against
- each mock.
-
-
-
- Whether the base member virtual implementation will be called
- for mocked classes if no setup is matched. Defaults to .
-
-
-
-
- Specifies the behavior to use when returning default values for
- unexpected invocations on loose mocks.
-
-
-
-
- Gets the mocks that have been created by this factory and
- that will get verified together.
-
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The type of the mocked object to query.
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The predicate with the setup expressions.
- The type of the mocked object to query.
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the setup expressions.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates the mock query with the underlying queriable implementation.
-
-
-
-
- Wraps the enumerator inside a queryable.
-
-
-
-
- Method that is turned into the actual call from .Query{T}, to
- transform the queryable query into a normal enumerable query.
- This method is never used directly by consumers.
-
-
-
-
- Initializes the repository with the given
- for newly created mocks from the repository.
-
- The behavior to use for mocks created
- using the repository method if not overriden
- by using the overload.
-
-
-
- Allows querying the universe of mocks for those that behave
- according to the LINQ query specification.
-
-
- This entry-point into Linq to Mocks is the only one in the root Moq
- namespace to ease discovery. But to get all the mocking extension
- methods on Object, a using of Moq.Linq must be done, so that the
- polluting of the intellisense for all objects is an explicit opt-in.
-
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The type of the mocked object to query.
-
-
-
- Access the universe of mocks of the given type, to retrieve those
- that behave according to the LINQ query specification.
-
- The predicate with the setup expressions.
- The type of the mocked object to query.
-
-
-
- Creates an mock object of the indicated type.
-
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates an mock object of the indicated type.
-
- The predicate with the setup expressions.
- The type of the mocked object.
- The mocked object created.
-
-
-
- Creates the mock query with the underlying queriable implementation.
-
-
-
-
- Wraps the enumerator inside a queryable.
-
-
-
-
- Method that is turned into the actual call from .Query{T}, to
- transform the queryable query into a normal enumerable query.
- This method is never used directly by consumers.
-
-
-
-
- Extension method used to support Linq-like setup properties that are not virtual but do have
- a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :)
-
-
-
-
- Helper extensions that are used by the query translator.
-
-
-
-
- Retrieves a fluent mock from the given setup expression.
-
-
-
-
- Allows creation custom value matchers that can be used on setups and verification,
- completely replacing the built-in class with your own argument
- matching rules.
-
- See also .
-
-
-
-
- Provided for the sole purpose of rendering the delegate passed to the
- matcher constructor if no friendly render lambda is provided.
-
-
-
-
- Initializes the match with the condition that
- will be checked in order to match invocation
- values.
- The condition to match against actual values.
-
-
-
-
-
-
-
-
- This method is used to set an expression as the last matcher invoked,
- which is used in the SetupSet to allow matchers in the prop = value
- delegate expression. This delegate is executed in "fluent" mode in
- order to capture the value being set, and construct the corresponding
- methodcall.
- This is also used in the MatcherFactory for each argument expression.
- This method ensures that when we execute the delegate, we
- also track the matcher that was invoked, so that when we create the
- methodcall we build the expression using it, rather than the null/default
- value returned from the actual invocation.
-
-
-
-
- Allows creation custom value matchers that can be used on setups and verification,
- completely replacing the built-in class with your own argument
- matching rules.
- Type of the value to match.
- The argument matching is used to determine whether a concrete
- invocation in the mock matches a given setup. This
- matching mechanism is fully extensible.
-
- Creating a custom matcher is straightforward. You just need to create a method
- that returns a value from a call to with
- your matching condition and optional friendly render expression:
-
- [Matcher]
- public Order IsBigOrder()
- {
- return Match<Order>.Create(
- o => o.GrandTotal >= 5000,
- /* a friendly expression to render on failures */
- () => IsBigOrder());
- }
-
- This method can be used in any mock setup invocation:
-
- mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>();
-
- At runtime, Moq knows that the return value was a matcher (note that the method MUST be
- annotated with the [Matcher] attribute in order to determine this) and
- evaluates your predicate with the actual value passed into your predicate.
-
- Another example might be a case where you want to match a lists of orders
- that contains a particular one. You might create matcher like the following:
-
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order));
- }
- }
-
- Now we can invoke this static method instead of an argument in an
- invocation:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
-
-
-
-
- Marks a method as a matcher, which allows complete replacement
- of the built-in class with your own argument
- matching rules.
-
-
- This feature has been deprecated in favor of the new
- and simpler .
-
-
- The argument matching is used to determine whether a concrete
- invocation in the mock matches a given setup. This
- matching mechanism is fully extensible.
-
-
- There are two parts of a matcher: the compiler matcher
- and the runtime matcher.
-
- -
- Compiler matcher
- Used to satisfy the compiler requirements for the
- argument. Needs to be a method optionally receiving any arguments
- you might need for the matching, but with a return type that
- matches that of the argument.
-
- Let's say I want to match a lists of orders that contains
- a particular one. I might create a compiler matcher like the following:
-
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
- }
-
- Now we can invoke this static method instead of an argument in an
- invocation:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- Note that the return value from the compiler matcher is irrelevant.
- This method will never be called, and is just used to satisfy the
- compiler and to signal Moq that this is not a method that we want
- to be invoked at runtime.
-
-
- -
- Runtime matcher
-
- The runtime matcher is the one that will actually perform evaluation
- when the test is run, and is defined by convention to have the
- same signature as the compiler matcher, but where the return
- value is the first argument to the call, which contains the
- object received by the actual invocation at runtime:
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
-
- At runtime, the mocked method will be invoked with a specific
- list of orders. This value will be passed to this runtime
- matcher as the first argument, while the second argument is the
- one specified in the setup (x.Save(Orders.Contains(order))).
-
- The boolean returned determines whether the given argument has been
- matched. If all arguments to the expected method are matched, then
- the setup matches and is evaluated.
-
-
-
-
-
- Using this extensible infrastructure, you can easily replace the entire
- set of matchers with your own. You can also avoid the
- typical (and annoying) lengthy expressions that result when you have
- multiple arguments that use generics.
-
-
- The following is the complete example explained above:
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
- }
-
- And the concrete test using this matcher:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Setup(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- // use mock, invoke Save, and have the matcher filter.
-
-
-
-
-
- Matcher to treat static functions as matchers.
-
- mock.Setup(x => x.StringMethod(A.MagicString()));
-
- public static class A
- {
- [Matcher]
- public static string MagicString() { return null; }
- public static bool MagicString(string arg)
- {
- return arg == "magic";
- }
- }
-
- Will succeed if: mock.Object.StringMethod("magic");
- and fail with any other call.
-
-
-
-
- We need this non-generics base class so that
- we can use from
- generic code.
-
-
-
-
- Options to customize the behavior of the mock.
-
-
-
-
- Causes the mock to always throw
- an exception for invocations that don't have a
- corresponding setup.
-
-
-
-
- Will never throw exceptions, returning default
- values when necessary (null for reference types,
- zero for value types or empty enumerables and arrays).
-
-
-
-
- Default mock behavior, which equals .
-
-
-
-
- A that returns an empty default value
- for non-mockeable types, and mocks for all other types (interfaces and
- non-sealed classes) that can be mocked.
-
-
-
-
- Exception thrown by mocks when setups are not matched,
- the mock is not properly setup, etc.
-
-
- A distinct exception type is provided so that exceptions
- thrown by the mock can be differentiated in tests that
- expect other exceptions to be thrown (i.e. ArgumentException).
-
- Richer exception hierarchy/types are not provided as
- tests typically should not catch or expect exceptions
- from the mocks. These are typically the result of changes
- in the tested class or its collaborators implementation, and
- result in fixes in the mock setup so that they dissapear and
- allow the test to pass.
-
-
-
-
-
- Made internal as it's of no use for
- consumers, but it's important for
- our own tests.
-
-
-
-
- Used by the mock factory to accumulate verification
- failures.
-
-
-
-
- Helper class to setup a full trace between many mocks
-
-
-
-
- Initialize a trace setup
-
-
-
-
- Allow sequence to be repeated
-
-
-
-
- define nice api
-
-
-
-
- Perform an expectation in the trace.
-
-
-
-
- Provides legacy API members as extensions so that
- existing code continues to compile, but new code
- doesn't see then.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Obsolete.
-
-
-
-
- Provides additional methods on mocks.
-
-
- Provided as extension methods as they confuse the compiler
- with the overloads taking Action.
-
-
-
-
- Specifies a setup on the mocked type for a call to
- to a property setter, regardless of its value.
-
-
- If more than one setup is set for the same property setter,
- the latest one wins and is the one that will be executed.
-
- Type of the property. Typically omitted as it can be inferred from the expression.
- Type of the mock.
- The target mock for the setup.
- Lambda expression that specifies the property setter.
-
-
- mock.SetupSet(x => x.Suspended);
-
-
-
- This method is not legacy, but must be on an extension method to avoid
- confusing the compiler with the new Action syntax.
-
-
-
-
- Verifies that a property has been set on the mock, regarless of its value.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- Expression to verify.
- The mock instance.
- Mocked type.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, specifying a failure
- error message.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- Expression to verify.
- Message to show if verification fails.
- The mock instance.
- Mocked type.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, regardless
- of the value but only the specified number of times.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- The invocation was not call the times specified by
- .
- The mock instance.
- Mocked type.
- The number of times a method is allowed to be called.
- Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Verifies that a property has been set on the mock, regardless
- of the value but only the specified number of times, and specifying a failure
- error message.
-
-
- This example assumes that the mock has been used,
- and later we want to verify that a given invocation
- with specific parameters was performed:
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- The invocation was not performed on the mock.
- The invocation was not call the times specified by
- .
- The mock instance.
- Mocked type.
- The number of times a method is allowed to be called.
- Message to show if verification fails.
- Expression to verify.
- Type of the property to verify. Typically omitted as it can
- be inferred from the expression's return type.
-
-
-
- Allows setups to be specified for protected members by using their
- name as a string, rather than strong-typing them which is not possible
- due to their visibility.
-
-
-
-
- Specifies a setup for a void method invocation with the given
- , optionally specifying arguments for the method call.
-
- The name of the void method to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
-
-
-
- Specifies a setup for an invocation on a property or a non void method with the given
- , optionally specifying arguments for the method call.
-
- The name of the method or property to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
- The return type of the method or property.
-
-
-
- Specifies a setup for an invocation on a property getter with the given
- .
-
- The name of the property.
- The type of the property.
-
-
-
- Specifies a setup for an invocation on a property setter with the given
- .
-
- The name of the property.
- The property value. If argument matchers are used,
- remember to use rather than .
- The type of the property.
-
-
-
- Specifies a verify for a void method with the given ,
- optionally specifying arguments for the method call. Use in conjuntion with the default
- .
-
- The invocation was not call the times specified by
- .
- The name of the void method to be verified.
- The number of times a method is allowed to be called.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
-
-
-
- Specifies a verify for an invocation on a property or a non void method with the given
- , optionally specifying arguments for the method call.
-
- The invocation was not call the times specified by
- .
- The name of the method or property to be invoked.
- The optional arguments for the invocation. If argument matchers are used,
- remember to use rather than .
- The number of times a method is allowed to be called.
- The type of return value from the expression.
-
-
-
- Specifies a verify for an invocation on a property getter with the given
- .
- The invocation was not call the times specified by
- .
-
- The name of the property.
- The number of times a method is allowed to be called.
- The type of the property.
-
-
-
- Specifies a setup for an invocation on a property setter with the given
- .
-
- The invocation was not call the times specified by
- .
- The name of the property.
- The number of times a method is allowed to be called.
- The property value.
- The type of the property. If argument matchers are used,
- remember to use rather than .
-
-
-
- Allows the specification of a matching condition for an
- argument in a protected member setup, rather than a specific
- argument value. "ItExpr" refers to the argument being matched.
-
-
- Use this variant of argument matching instead of
- for protected setups.
- This class allows the setup to match a method invocation
- with an arbitrary value, with a value in a specified range, or
- even one that matches a given predicate, or null.
-
-
-
-
- Matches a null value of the given type.
-
-
- Required for protected mocks as the null value cannot be used
- directly as it prevents proper method overload selection.
-
-
-
- // Throws an exception for a call to Remove with a null string value.
- mock.Protected()
- .Setup("Remove", ItExpr.IsNull<string>())
- .Throws(new InvalidOperationException());
-
-
- Type of the value.
-
-
-
- Matches any value of the given type.
-
-
- Typically used when the actual argument value for a method
- call is not relevant.
-
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Protected()
- .Setup("Remove", ItExpr.IsAny<string>())
- .Throws(new InvalidOperationException());
-
-
- Type of the value.
-
-
-
- Matches any value that satisfies the given predicate.
-
- Type of the argument to check.
- The predicate used to match the method argument.
-
- Allows the specification of a predicate to perform matching
- of method call arguments.
-
-
- This example shows how to return the value 1 whenever the argument to the
- Do method is an even number.
-
- mock.Protected()
- .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Protected()
- .Setup("GetUser", ItExpr.Is<int>(i => i < 0))
- .Throws(new ArgumentException());
-
-
-
-
-
- Matches any value that is in the range specified.
-
- Type of the argument to check.
- The lower bound of the range.
- The upper bound of the range.
- The kind of range. See .
-
- The following example shows how to expect a method call
- with an integer argument within the 0..100 range.
-
- mock.Protected()
- .Setup("HasInventory",
- ItExpr.IsAny<string>(),
- ItExpr.IsInRange(0, 100, Range.Inclusive))
- .Returns(false);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
-
- The pattern to use to match the string argument value.
-
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression:
-
- mock.Protected()
- .Setup("Check", ItExpr.IsRegex("[a-z]+"))
- .Returns(1);
-
-
-
-
-
- Matches a string argument if it matches the given regular expression pattern.
-
- The pattern to use to match the string argument value.
- The options used to interpret the pattern.
-
- The following example shows how to expect a call to a method where the
- string argument matches the given regular expression, in a case insensitive way:
-
- mock.Protected()
- .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase))
- .Returns(1);
-
-
-
-
-
- Enables the Protected() method on ,
- allowing setups to be set for protected members by using their
- name as a string, rather than strong-typing them which is not possible
- due to their visibility.
-
-
-
-
- Enable protected setups for the mock.
-
- Mocked object type. Typically omitted as it can be inferred from the mock instance.
- The mock to set the protected setups on.
-
-
-
-
-
-
-
-
-
-
-
- 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 Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that..
-
-
-
-
- Looks up a localized string similar to Value cannot be an empty string..
-
-
-
-
- Looks up a localized string similar to Can only add interfaces to the mock..
-
-
-
-
- Looks up a localized string similar to Can't set return value for void method {0}..
-
-
-
-
- Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks..
-
-
-
-
- Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type..
-
-
-
-
- Looks up a localized string similar to Could not locate event for attach or detach method {0}..
-
-
-
-
- Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead..
-
-
-
-
- Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. .
-
-
-
-
- Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces.
- Please cast the argument to one of the supported types: {1}.
- Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed..
-
-
-
-
- Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to LINQ method '{0}' not supported..
-
-
-
-
- Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to Member {0}.{1} does not exist..
-
-
-
-
- Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead:
- mock.Setup(x => x.{1}());
- .
-
-
-
-
- Looks up a localized string similar to {0} invocation failed with mock behavior {1}.
- {2}.
-
-
-
-
- Looks up a localized string similar to Expected only {0} calls to {1}..
-
-
-
-
- Looks up a localized string similar to Expected only one call to {0}..
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at least {2} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at least once, but was never performed: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at most {3} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock at most once, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock exactly {2} times, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock should never have been performed, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to {0}
- Expected invocation on the mock once, but was {4} times: {1}.
-
-
-
-
- Looks up a localized string similar to All invocations on the mock must have a corresponding setup..
-
-
-
-
- Looks up a localized string similar to Object instance was not created by Moq..
-
-
-
-
- Looks up a localized string similar to Out expression must evaluate to a constant value..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not have a getter..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not exist..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} is write-only..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} is read-only..
-
-
-
-
- Looks up a localized string similar to Property {0}.{1} does not have a setter..
-
-
-
-
- Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object..
-
-
-
-
- Looks up a localized string similar to Ref expression must evaluate to a constant value..
-
-
-
-
- Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it..
-
-
-
-
- Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>..
-
-
-
-
- Looks up a localized string similar to Invocation {0} should not have been made..
-
-
-
-
- Looks up a localized string similar to Expression is not a method invocation: {0}.
-
-
-
-
- Looks up a localized string similar to Expression is not a property access: {0}.
-
-
-
-
- Looks up a localized string similar to Expression is not a property setter invocation..
-
-
-
-
- Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}.
-
-
-
-
- Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}.
-
-
-
-
- Looks up a localized string similar to Type {0} does not implement required interface {1}.
-
-
-
-
- Looks up a localized string similar to Type {0} does not from required type {1}.
-
-
-
-
- Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as:
- mock.Setup(x => x.{1}).Returns(value);
- mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one
- mock.SetupSet(x => x.{1}).Callback(callbackDelegate);
- .
-
-
-
-
- Looks up a localized string similar to Unsupported expression: {0}.
-
-
-
-
- Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}..
-
-
-
-
- Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}..
-
-
-
-
- Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters..
-
-
-
-
- Looks up a localized string similar to Member {0} is not supported for protected mocking..
-
-
-
-
- Looks up a localized string similar to Setter expression can only use static custom matchers..
-
-
-
-
- Looks up a localized string similar to The following setups were not matched:
- {0}.
-
-
-
-
- Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}.
-
-
-
-
- Kind of range to use in a filter specified through
- .
-
-
-
-
- The range includes the to and
- from values.
-
-
-
-
- The range does not include the to and
- from values.
-
-
-
-
- Helper for sequencing return values in the same method.
-
-
-
-
- Return a sequence of values, once per call.
-
-
-
-
- Defines the number of invocations allowed by a mocked method.
-
-
-
-
- Specifies that a mocked method should be invoked times as minimum.
- The minimun number of times.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked one time as minimum.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked time as maximun.
- The maximun number of times.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked one time as maximun.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked between and
- times.
- The minimun number of times.The maximun number of times.
- The kind of range. See .
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked exactly times.
- The times that a method or property can be called.An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should not be invoked.
- An object defining the allowed number of invocations.
-
-
-
- Specifies that a mocked method should be invoked exactly one time.
- An object defining the allowed number of invocations.
-
-
-
- Determines whether the specified is equal to this instance.
-
- The to compare with this instance.
-
- true if the specified is equal to this instance; otherwise, false.
-
-
-
-
- Returns a hash code for this instance.
-
- A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
-
-
-
-
- Determines whether two specified objects have the same value.
-
- The first .
-
- The second .
-
- true if the value of left is the same as the value of right; otherwise, false.
-
-
-
-
- Determines whether two specified objects have different values.
-
- The first .
-
- The second .
-
- true if the value of left is different from the value of right; otherwise, false.
-
-
-
-
diff --git a/packages/NUnit.2.6.1/NUnit.2.6.1.nupkg b/packages/NUnit.2.6.1/NUnit.2.6.1.nupkg
deleted file mode 100644
index cfdeee7..0000000
Binary files a/packages/NUnit.2.6.1/NUnit.2.6.1.nupkg and /dev/null differ
diff --git a/packages/NUnit.2.6.1/lib/nunit.framework.dll b/packages/NUnit.2.6.1/lib/nunit.framework.dll
deleted file mode 100644
index 215767d..0000000
Binary files a/packages/NUnit.2.6.1/lib/nunit.framework.dll and /dev/null differ
diff --git a/packages/NUnit.2.6.1/lib/nunit.framework.xml b/packages/NUnit.2.6.1/lib/nunit.framework.xml
deleted file mode 100644
index 7b0e798..0000000
--- a/packages/NUnit.2.6.1/lib/nunit.framework.xml
+++ /dev/null
@@ -1,10892 +0,0 @@
-
-
-
- nunit.framework
-
-
-
-
- Attribute used to apply a category to a test
-
-
-
-
- The name of the category
-
-
-
-
- Construct attribute for a given category based on
- a name. The name may not contain the characters ',',
- '+', '-' or '!'. However, this is not checked in the
- constructor since it would cause an error to arise at
- as the test was loaded without giving a clear indication
- of where the problem is located. The error is handled
- in NUnitFramework.cs by marking the test as not
- runnable.
-
- The name of the category
-
-
-
- Protected constructor uses the Type name as the name
- of the category.
-
-
-
-
- The name of the category
-
-
-
-
- Used to mark a field for use as a datapoint when executing a theory
- within the same fixture that requires an argument of the field's Type.
-
-
-
-
- Used to mark an array as containing a set of datapoints to be used
- executing a theory within the same fixture that requires an argument
- of the Type of the array elements.
-
-
-
-
- Attribute used to provide descriptive text about a
- test case or fixture.
-
-
-
-
- Construct the attribute
-
- Text describing the test
-
-
-
- Gets the test description
-
-
-
-
- Enumeration indicating how the expected message parameter is to be used
-
-
-
- Expect an exact match
-
-
- Expect a message containing the parameter string
-
-
- Match the regular expression provided as a parameter
-
-
- Expect a message that starts with the parameter string
-
-
-
- ExpectedExceptionAttribute
-
-
-
-
-
- Constructor for a non-specific exception
-
-
-
-
- Constructor for a given type of exception
-
- The type of the expected exception
-
-
-
- Constructor for a given exception name
-
- The full name of the expected exception
-
-
-
- Gets or sets the expected exception type
-
-
-
-
- Gets or sets the full Type name of the expected exception
-
-
-
-
- Gets or sets the expected message text
-
-
-
-
- Gets or sets the user message displayed in case of failure
-
-
-
-
- Gets or sets the type of match to be performed on the expected message
-
-
-
-
- Gets the name of a method to be used as an exception handler
-
-
-
-
- ExplicitAttribute marks a test or test fixture so that it will
- only be run if explicitly executed from the gui or command line
- or if it is included by use of a filter. The test will not be
- run simply because an enclosing suite is run.
-
-
-
-
- Default constructor
-
-
-
-
- Constructor with a reason
-
- The reason test is marked explicit
-
-
-
- The reason test is marked explicit
-
-
-
-
- Attribute used to mark a test that is to be ignored.
- Ignored tests result in a warning message when the
- tests are run.
-
-
-
-
- Constructs the attribute without giving a reason
- for ignoring the test.
-
-
-
-
- Constructs the attribute giving a reason for ignoring the test
-
- The reason for ignoring the test
-
-
-
- The reason for ignoring a test
-
-
-
-
- Abstract base for Attributes that are used to include tests
- in the test run based on environmental settings.
-
-
-
-
- Constructor with no included items specified, for use
- with named property syntax.
-
-
-
-
- Constructor taking one or more included items
-
- Comma-delimited list of included items
-
-
-
- Name of the item that is needed in order for
- a test to run. Multiple itemss may be given,
- separated by a comma.
-
-
-
-
- Name of the item to be excluded. Multiple items
- may be given, separated by a comma.
-
-
-
-
- The reason for including or excluding the test
-
-
-
-
- PlatformAttribute is used to mark a test fixture or an
- individual method as applying to a particular platform only.
-
-
-
-
- Constructor with no platforms specified, for use
- with named property syntax.
-
-
-
-
- Constructor taking one or more platforms
-
- Comma-deliminted list of platforms
-
-
-
- CultureAttribute is used to mark a test fixture or an
- individual method as applying to a particular Culture only.
-
-
-
-
- Constructor with no cultures specified, for use
- with named property syntax.
-
-
-
-
- Constructor taking one or more cultures
-
- Comma-deliminted list of cultures
-
-
-
- Marks a test to use a combinatorial join of any argument data
- provided. NUnit will create a test case for every combination of
- the arguments provided. This can result in a large number of test
- cases and so should be used judiciously. This is the default join
- type, so the attribute need not be used except as documentation.
-
-
-
-
- PropertyAttribute is used to attach information to a test as a name/value pair..
-
-
-
-
- Construct a PropertyAttribute with a name and string value
-
- The name of the property
- The property value
-
-
-
- Construct a PropertyAttribute with a name and int value
-
- The name of the property
- The property value
-
-
-
- Construct a PropertyAttribute with a name and double value
-
- The name of the property
- The property value
-
-
-
- Constructor for derived classes that set the
- property dictionary directly.
-
-
-
-
- Constructor for use by derived classes that use the
- name of the type as the property name. Derived classes
- must ensure that the Type of the property value is
- a standard type supported by the BCL. Any custom
- types will cause a serialization Exception when
- in the client.
-
-
-
-
- Gets the property dictionary for this attribute
-
-
-
-
- Default constructor
-
-
-
-
- Marks a test to use pairwise join of any argument data provided.
- NUnit will attempt too excercise every pair of argument values at
- least once, using as small a number of test cases as it can. With
- only two arguments, this is the same as a combinatorial join.
-
-
-
-
- Default constructor
-
-
-
-
- Marks a test to use a sequential join of any argument data
- provided. NUnit will use arguements for each parameter in
- sequence, generating test cases up to the largest number
- of argument values provided and using null for any arguments
- for which it runs out of values. Normally, this should be
- used with the same number of arguments for each parameter.
-
-
-
-
- Default constructor
-
-
-
-
- Summary description for MaxTimeAttribute.
-
-
-
-
- Construct a MaxTimeAttribute, given a time in milliseconds.
-
- The maximum elapsed time in milliseconds
-
-
-
- RandomAttribute is used to supply a set of random values
- to a single parameter of a parameterized test.
-
-
-
-
- ValuesAttribute is used to provide literal arguments for
- an individual parameter of a test.
-
-
-
-
- Abstract base class for attributes that apply to parameters
- and supply data for the parameter.
-
-
-
-
- Gets the data to be provided to the specified parameter
-
-
-
-
- The collection of data to be returned. Must
- be set by any derived attribute classes.
- We use an object[] so that the individual
- elements may have their type changed in GetData
- if necessary.
-
-
-
-
- Construct with one argument
-
-
-
-
-
- Construct with two arguments
-
-
-
-
-
-
- Construct with three arguments
-
-
-
-
-
-
-
- Construct with an array of arguments
-
-
-
-
-
- Get the collection of values to be used as arguments
-
-
-
-
- Construct a set of doubles from 0.0 to 1.0,
- specifying only the count.
-
-
-
-
-
- Construct a set of doubles from min to max
-
-
-
-
-
-
-
- Construct a set of ints from min to max
-
-
-
-
-
-
-
- Get the collection of values to be used as arguments
-
-
-
-
- RangeAttribute is used to supply a range of values to an
- individual parameter of a parameterized test.
-
-
-
-
- Construct a range of ints using default step of 1
-
-
-
-
-
-
- Construct a range of ints specifying the step size
-
-
-
-
-
-
-
- Construct a range of longs
-
-
-
-
-
-
-
- Construct a range of doubles
-
-
-
-
-
-
-
- Construct a range of floats
-
-
-
-
-
-
-
- RepeatAttribute may be applied to test case in order
- to run it multiple times.
-
-
-
-
- Construct a RepeatAttribute
-
- The number of times to run the test
-
-
-
- RequiredAddinAttribute may be used to indicate the names of any addins
- that must be present in order to run some or all of the tests in an
- assembly. If the addin is not loaded, the entire assembly is marked
- as NotRunnable.
-
-
-
-
- Initializes a new instance of the class.
-
- The required addin.
-
-
-
- Gets the name of required addin.
-
- The required addin name.
-
-
-
- Summary description for SetCultureAttribute.
-
-
-
-
- Construct given the name of a culture
-
-
-
-
-
- Summary description for SetUICultureAttribute.
-
-
-
-
- Construct given the name of a culture
-
-
-
-
-
- SetUpAttribute is used in a TestFixture to identify a method
- that is called immediately before each test is run. It is
- also used in a SetUpFixture to identify the method that is
- called once, before any of the subordinate tests are run.
-
-
-
-
- Attribute used to mark a class that contains one-time SetUp
- and/or TearDown methods that apply to all the tests in a
- namespace or an assembly.
-
-
-
-
- Attribute used to mark a static (shared in VB) property
- that returns a list of tests.
-
-
-
-
- Attribute used in a TestFixture to identify a method that is
- called immediately after each test is run. It is also used
- in a SetUpFixture to identify the method that is called once,
- after all subordinate tests have run. In either case, the method
- is guaranteed to be called, even if an exception is thrown.
-
-
-
-
- Provide actions to execute before and after tests.
-
-
-
-
- When implemented by an attribute, this interface implemented to provide actions to execute before and after tests.
-
-
-
-
- Executed before each test is run
-
- Provides details about the test that is going to be run.
-
-
-
- Executed after each test is run
-
- Provides details about the test that has just been run.
-
-
-
- Provides the target for the action attribute
-
- The target for the action attribute
-
-
-
- Adding this attribute to a method within a
- class makes the method callable from the NUnit test runner. There is a property
- called Description which is optional which you can provide a more detailed test
- description. This class cannot be inherited.
-
-
-
- [TestFixture]
- public class Fixture
- {
- [Test]
- public void MethodToTest()
- {}
-
- [Test(Description = "more detailed description")]
- publc void TestDescriptionMethod()
- {}
- }
-
-
-
-
-
- Descriptive text for this test
-
-
-
-
- TestCaseAttribute is used to mark parameterized test cases
- and provide them with their arguments.
-
-
-
-
- The ITestCaseData interface is implemented by a class
- that is able to return complete testcases for use by
- a parameterized test method.
-
- NOTE: This interface is used in both the framework
- and the core, even though that results in two different
- types. However, sharing the source code guarantees that
- the various implementations will be compatible and that
- the core is able to reflect successfully over the
- framework implementations of ITestCaseData.
-
-
-
-
- Gets the argument list to be provided to the test
-
-
-
-
- Gets the expected result
-
-
-
-
- Indicates whether a result has been specified.
- This is necessary because the result may be
- null, so it's value cannot be checked.
-
-
-
-
- Gets the expected exception Type
-
-
-
-
- Gets the FullName of the expected exception
-
-
-
-
- Gets the name to be used for the test
-
-
-
-
- Gets the description of the test
-
-
-
-
- Gets a value indicating whether this is ignored.
-
- true if ignored; otherwise, false.
-
-
-
- Gets a value indicating whether this is explicit.
-
- true if explicit; otherwise, false.
-
-
-
- Gets the ignore reason.
-
- The ignore reason.
-
-
-
- Construct a TestCaseAttribute with a list of arguments.
- This constructor is not CLS-Compliant
-
-
-
-
-
- Construct a TestCaseAttribute with a single argument
-
-
-
-
-
- Construct a TestCaseAttribute with a two arguments
-
-
-
-
-
-
- Construct a TestCaseAttribute with a three arguments
-
-
-
-
-
-
-
- Gets the list of arguments to a test case
-
-
-
-
- Gets or sets the expected result.
-
- The result.
-
-
-
- Gets the expected result.
-
- The result.
-
-
-
- Gets a flag indicating whether an expected
- result has been set.
-
-
-
-
- Gets a list of categories associated with this test;
-
-
-
-
- Gets or sets the category associated with this test.
- May be a single category or a comma-separated list.
-
-
-
-
- Gets or sets the expected exception.
-
- The expected exception.
-
-
-
- Gets or sets the name the expected exception.
-
- The expected name of the exception.
-
-
-
- Gets or sets the expected message of the expected exception
-
- The expected message of the exception.
-
-
-
- Gets or sets the type of match to be performed on the expected message
-
-
-
-
- Gets or sets the description.
-
- The description.
-
-
-
- Gets or sets the name of the test.
-
- The name of the test.
-
-
-
- Gets or sets the ignored status of the test
-
-
-
-
- Gets or sets the ignored status of the test
-
-
-
-
- Gets or sets the explicit status of the test
-
-
-
-
- Gets or sets the reason for not running the test
-
-
-
-
- Gets or sets the reason for not running the test.
- Set has the side effect of marking the test as ignored.
-
- The ignore reason.
-
-
-
- FactoryAttribute indicates the source to be used to
- provide test cases for a test method.
-
-
-
-
- Construct with the name of the factory - for use with languages
- that don't support params arrays.
-
- An array of the names of the factories that will provide data
-
-
-
- Construct with a Type and name - for use with languages
- that don't support params arrays.
-
- The Type that will provide data
- The name of the method, property or field that will provide data
-
-
-
- The name of a the method, property or fiend to be used as a source
-
-
-
-
- A Type to be used as a source
-
-
-
-
- Gets or sets the category associated with this test.
- May be a single category or a comma-separated list.
-
-
-
-
- [TestFixture]
- public class ExampleClass
- {}
-
-
-
-
- Default constructor
-
-
-
-
- Construct with a object[] representing a set of arguments.
- In .NET 2.0, the arguments may later be separated into
- type arguments and constructor arguments.
-
-
-
-
-
- Descriptive text for this fixture
-
-
-
-
- Gets and sets the category for this fixture.
- May be a comma-separated list of categories.
-
-
-
-
- Gets a list of categories for this fixture
-
-
-
-
- The arguments originally provided to the attribute
-
-
-
-
- Gets or sets a value indicating whether this should be ignored.
-
- true if ignore; otherwise, false.
-
-
-
- Gets or sets the ignore reason. May set Ignored as a side effect.
-
- The ignore reason.
-
-
-
- Get or set the type arguments. If not set
- explicitly, any leading arguments that are
- Types are taken as type arguments.
-
-
-
-
- Attribute used to identify a method that is
- called before any tests in a fixture are run.
-
-
-
-
- Attribute used to identify a method that is called after
- all the tests in a fixture have run. The method is
- guaranteed to be called, even if an exception is thrown.
-
-
-
-
- Adding this attribute to a method within a
- class makes the method callable from the NUnit test runner. There is a property
- called Description which is optional which you can provide a more detailed test
- description. This class cannot be inherited.
-
-
-
- [TestFixture]
- public class Fixture
- {
- [Test]
- public void MethodToTest()
- {}
-
- [Test(Description = "more detailed description")]
- publc void TestDescriptionMethod()
- {}
- }
-
-
-
-
-
- Used on a method, marks the test with a timeout value in milliseconds.
- The test will be run in a separate thread and is cancelled if the timeout
- is exceeded. Used on a method or assembly, sets the default timeout
- for all contained test methods.
-
-
-
-
- Construct a TimeoutAttribute given a time in milliseconds
-
- The timeout value in milliseconds
-
-
-
- Marks a test that must run in the STA, causing it
- to run in a separate thread if necessary.
-
- On methods, you may also use STAThreadAttribute
- to serve the same purpose.
-
-
-
-
- Construct a RequiresSTAAttribute
-
-
-
-
- Marks a test that must run in the MTA, causing it
- to run in a separate thread if necessary.
-
- On methods, you may also use MTAThreadAttribute
- to serve the same purpose.
-
-
-
-
- Construct a RequiresMTAAttribute
-
-
-
-
- Marks a test that must run on a separate thread.
-
-
-
-
- Construct a RequiresThreadAttribute
-
-
-
-
- Construct a RequiresThreadAttribute, specifying the apartment
-
-
-
-
- ValueSourceAttribute indicates the source to be used to
- provide data for one parameter of a test method.
-
-
-
-
- Construct with the name of the factory - for use with languages
- that don't support params arrays.
-
- The name of the data source to be used
-
-
-
- Construct with a Type and name - for use with languages
- that don't support params arrays.
-
- The Type that will provide data
- The name of the method, property or field that will provide data
-
-
-
- The name of a the method, property or fiend to be used as a source
-
-
-
-
- A Type to be used as a source
-
-
-
-
- AttributeExistsConstraint tests for the presence of a
- specified attribute on a Type.
-
-
-
-
- The Constraint class is the base of all built-in constraints
- within NUnit. It provides the operator overloads used to combine
- constraints.
-
-
-
-
- The IConstraintExpression interface is implemented by all
- complete and resolvable constraints and expressions.
-
-
-
-
- Return the top-level constraint for this expression
-
-
-
-
-
- Static UnsetObject used to detect derived constraints
- failing to set the actual value.
-
-
-
-
- The actual value being tested against a constraint
-
-
-
-
- The display name of this Constraint for use by ToString()
-
-
-
-
- Argument fields used by ToString();
-
-
-
-
- The builder holding this constraint
-
-
-
-
- Construct a constraint with no arguments
-
-
-
-
- Construct a constraint with one argument
-
-
-
-
- Construct a constraint with two arguments
-
-
-
-
- Sets the ConstraintBuilder holding this constraint
-
-
-
-
- Write the failure message to the MessageWriter provided
- as an argument. The default implementation simply passes
- the constraint and the actual value to the writer, which
- then displays the constraint description and the value.
-
- Constraints that need to provide additional details,
- such as where the error occured can override this.
-
- The MessageWriter on which to display the message
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Test whether the constraint is satisfied by an
- ActualValueDelegate that returns the value to be tested.
- The default implementation simply evaluates the delegate
- but derived classes may override it to provide for delayed
- processing.
-
- An ActualValueDelegate
- True for success, false for failure
-
-
-
- Test whether the constraint is satisfied by a given reference.
- The default implementation simply dereferences the value but
- derived classes may override it to provide for delayed processing.
-
- A reference to the value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- Default override of ToString returns the constraint DisplayName
- followed by any arguments within angle brackets.
-
-
-
-
-
- Returns the string representation of this constraint
-
-
-
-
- This operator creates a constraint that is satisfied only if both
- argument constraints are satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied if either
- of the argument constraints is satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied if the
- argument constraint is not satisfied.
-
-
-
-
- Returns a DelayedConstraint with the specified delay time.
-
- The delay in milliseconds.
-
-
-
-
- Returns a DelayedConstraint with the specified delay time
- and polling interval.
-
- The delay in milliseconds.
- The interval at which to test the constraint.
-
-
-
-
- The display name of this Constraint for use by ToString().
- The default value is the name of the constraint with
- trailing "Constraint" removed. Derived classes may set
- this to another name in their constructors.
-
-
-
-
- Returns a ConstraintExpression by appending And
- to the current constraint.
-
-
-
-
- Returns a ConstraintExpression by appending And
- to the current constraint.
-
-
-
-
- Returns a ConstraintExpression by appending Or
- to the current constraint.
-
-
-
-
- Class used to detect any derived constraints
- that fail to set the actual value in their
- Matches override.
-
-
-
-
- Constructs an AttributeExistsConstraint for a specific attribute Type
-
-
-
-
-
- Tests whether the object provides the expected attribute.
-
- A Type, MethodInfo, or other ICustomAttributeProvider
- True if the expected attribute is present, otherwise false
-
-
-
- Writes the description of the constraint to the specified writer
-
-
-
-
- AttributeConstraint tests that a specified attribute is present
- on a Type or other provider and that the value of the attribute
- satisfies some other constraint.
-
-
-
-
- Abstract base class used for prefixes
-
-
-
-
- The base constraint
-
-
-
-
- Construct given a base constraint
-
-
-
-
-
- Constructs an AttributeConstraint for a specified attriute
- Type and base constraint.
-
-
-
-
-
-
- Determines whether the Type or other provider has the
- expected attribute and if its value matches the
- additional constraint specified.
-
-
-
-
- Writes a description of the attribute to the specified writer.
-
-
-
-
- Writes the actual value supplied to the specified writer.
-
-
-
-
- Returns a string representation of the constraint.
-
-
-
-
- BasicConstraint is the abstract base for constraints that
- perform a simple comparison to a constant value.
-
-
-
-
- Initializes a new instance of the class.
-
- The expected.
- The description.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- NullConstraint tests that the actual value is null
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- TrueConstraint tests that the actual value is true
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- FalseConstraint tests that the actual value is false
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- NaNConstraint tests that the actual value is a double or float NaN
-
-
-
-
- Test that the actual value is an NaN
-
-
-
-
-
-
- Write the constraint description to a specified writer
-
-
-
-
-
- BinaryConstraint is the abstract base of all constraints
- that combine two other constraints in some fashion.
-
-
-
-
- The first constraint being combined
-
-
-
-
- The second constraint being combined
-
-
-
-
- Construct a BinaryConstraint from two other constraints
-
- The first constraint
- The second constraint
-
-
-
- AndConstraint succeeds only if both members succeed.
-
-
-
-
- Create an AndConstraint from two other constraints
-
- The first constraint
- The second constraint
-
-
-
- Apply both member constraints to an actual value, succeeding
- succeeding only if both of them succeed.
-
- The actual value
- True if the constraints both succeeded
-
-
-
- Write a description for this contraint to a MessageWriter
-
- The MessageWriter to receive the description
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- OrConstraint succeeds if either member succeeds
-
-
-
-
- Create an OrConstraint from two other constraints
-
- The first constraint
- The second constraint
-
-
-
- Apply the member constraints to an actual value, succeeding
- succeeding as soon as one of them succeeds.
-
- The actual value
- True if either constraint succeeded
-
-
-
- Write a description for this contraint to a MessageWriter
-
- The MessageWriter to receive the description
-
-
-
- CollectionConstraint is the abstract base class for
- constraints that operate on collections.
-
-
-
-
- Construct an empty CollectionConstraint
-
-
-
-
- Construct a CollectionConstraint
-
-
-
-
-
- Determines whether the specified enumerable is empty.
-
- The enumerable.
-
- true if the specified enumerable is empty; otherwise, false.
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Protected method to be implemented by derived classes
-
-
-
-
-
-
- CollectionItemsEqualConstraint is the abstract base class for all
- collection constraints that apply some notion of item equality
- as a part of their operation.
-
-
-
-
- Construct an empty CollectionConstraint
-
-
-
-
- Construct a CollectionConstraint
-
-
-
-
-
- Flag the constraint to use the supplied IComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied Comparison object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IEqualityComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IEqualityComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Compares two collection members for equality
-
-
-
-
- Return a new CollectionTally for use in making tests
-
- The collection to be included in the tally
-
-
-
- Flag the constraint to ignore case and return self.
-
-
-
-
- EmptyCollectionConstraint tests whether a collection is empty.
-
-
-
-
- Check that the collection is empty
-
-
-
-
-
-
- Write the constraint description to a MessageWriter
-
-
-
-
-
- UniqueItemsConstraint tests whether all the items in a
- collection are unique.
-
-
-
-
- Check that all items are unique.
-
-
-
-
-
-
- Write a description of this constraint to a MessageWriter
-
-
-
-
-
- CollectionContainsConstraint is used to test whether a collection
- contains an expected object as a member.
-
-
-
-
- Construct a CollectionContainsConstraint
-
-
-
-
-
- Test whether the expected item is contained in the collection
-
-
-
-
-
-
- Write a descripton of the constraint to a MessageWriter
-
-
-
-
-
- CollectionEquivalentCOnstraint is used to determine whether two
- collections are equivalent.
-
-
-
-
- Construct a CollectionEquivalentConstraint
-
-
-
-
-
- Test whether two collections are equivalent
-
-
-
-
-
-
- Write a description of this constraint to a MessageWriter
-
-
-
-
-
- CollectionSubsetConstraint is used to determine whether
- one collection is a subset of another
-
-
-
-
- Construct a CollectionSubsetConstraint
-
- The collection that the actual value is expected to be a subset of
-
-
-
- Test whether the actual collection is a subset of
- the expected collection provided.
-
-
-
-
-
-
- Write a description of this constraint to a MessageWriter
-
-
-
-
-
- CollectionOrderedConstraint is used to test whether a collection is ordered.
-
-
-
-
- Construct a CollectionOrderedConstraint
-
-
-
-
- Modifies the constraint to use an IComparer and returns self.
-
-
-
-
- Modifies the constraint to use an IComparer<T> and returns self.
-
-
-
-
- Modifies the constraint to use a Comparison<T> and returns self.
-
-
-
-
- Modifies the constraint to test ordering by the value of
- a specified property and returns self.
-
-
-
-
- Test whether the collection is ordered
-
-
-
-
-
-
- Write a description of the constraint to a MessageWriter
-
-
-
-
-
- Returns the string representation of the constraint.
-
-
-
-
-
- If used performs a reverse comparison
-
-
-
-
- CollectionTally counts (tallies) the number of
- occurences of each object in one or more enumerations.
-
-
-
-
- Construct a CollectionTally object from a comparer and a collection
-
-
-
-
- Try to remove an object from the tally
-
- The object to remove
- True if successful, false if the object was not found
-
-
-
- Try to remove a set of objects from the tally
-
- The objects to remove
- True if successful, false if any object was not found
-
-
-
- The number of objects remaining in the tally
-
-
-
-
- ComparisonAdapter class centralizes all comparisons of
- values in NUnit, adapting to the use of any provided
- IComparer, IComparer<T> or Comparison<T>
-
-
-
-
- Returns a ComparisonAdapter that wraps an IComparer
-
-
-
-
- Returns a ComparisonAdapter that wraps an IComparer<T>
-
-
-
-
- Returns a ComparisonAdapter that wraps a Comparison<T>
-
-
-
-
- Compares two objects
-
-
-
-
- Gets the default ComparisonAdapter, which wraps an
- NUnitComparer object.
-
-
-
-
- Construct a ComparisonAdapter for an IComparer
-
-
-
-
- Compares two objects
-
-
-
-
-
-
-
- Construct a default ComparisonAdapter
-
-
-
-
- ComparisonAdapter<T> extends ComparisonAdapter and
- allows use of an IComparer<T> or Comparison<T>
- to actually perform the comparison.
-
-
-
-
- Construct a ComparisonAdapter for an IComparer<T>
-
-
-
-
- Compare a Type T to an object
-
-
-
-
- Construct a ComparisonAdapter for a Comparison<T>
-
-
-
-
- Compare a Type T to an object
-
-
-
-
- Abstract base class for constraints that compare values to
- determine if one is greater than, equal to or less than
- the other. This class supplies the Using modifiers.
-
-
-
-
- ComparisonAdapter to be used in making the comparison
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Modifies the constraint to use an IComparer and returns self
-
-
-
-
- Modifies the constraint to use an IComparer<T> and returns self
-
-
-
-
- Modifies the constraint to use a Comparison<T> and returns self
-
-
-
-
- Delegate used to delay evaluation of the actual value
- to be used in evaluating a constraint
-
-
-
-
- ConstraintBuilder maintains the stacks that are used in
- processing a ConstraintExpression. An OperatorStack
- is used to hold operators that are waiting for their
- operands to be reognized. a ConstraintStack holds
- input constraints as well as the results of each
- operator applied.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Appends the specified operator to the expression by first
- reducing the operator stack and then pushing the new
- operator on the stack.
-
- The operator to push.
-
-
-
- Appends the specified constraint to the expresson by pushing
- it on the constraint stack.
-
- The constraint to push.
-
-
-
- Sets the top operator right context.
-
- The right context.
-
-
-
- Reduces the operator stack until the topmost item
- precedence is greater than or equal to the target precedence.
-
- The target precedence.
-
-
-
- Resolves this instance, returning a Constraint. If the builder
- is not currently in a resolvable state, an exception is thrown.
-
- The resolved constraint
-
-
-
- Gets a value indicating whether this instance is resolvable.
-
-
- true if this instance is resolvable; otherwise, false.
-
-
-
-
- OperatorStack is a type-safe stack for holding ConstraintOperators
-
-
-
-
- Initializes a new instance of the class.
-
- The builder.
-
-
-
- Pushes the specified operator onto the stack.
-
- The op.
-
-
-
- Pops the topmost operator from the stack.
-
-
-
-
-
- Gets a value indicating whether this is empty.
-
- true if empty; otherwise, false.
-
-
-
- Gets the topmost operator without modifying the stack.
-
- The top.
-
-
-
- ConstraintStack is a type-safe stack for holding Constraints
-
-
-
-
- Initializes a new instance of the class.
-
- The builder.
-
-
-
- Pushes the specified constraint. As a side effect,
- the constraint's builder field is set to the
- ConstraintBuilder owning this stack.
-
- The constraint.
-
-
-
- Pops this topmost constrait from the stack.
- As a side effect, the constraint's builder
- field is set to null.
-
-
-
-
-
- Gets a value indicating whether this is empty.
-
- true if empty; otherwise, false.
-
-
-
- Gets the topmost constraint without modifying the stack.
-
- The topmost constraint
-
-
-
- ConstraintExpression represents a compound constraint in the
- process of being constructed from a series of syntactic elements.
-
- Individual elements are appended to the expression as they are
- reognized. Once an actual Constraint is appended, the expression
- returns a resolvable Constraint.
-
-
-
-
- ConstraintExpressionBase is the abstract base class for the
- ConstraintExpression class, which represents a
- compound constraint in the process of being constructed
- from a series of syntactic elements.
-
- NOTE: ConstraintExpressionBase is separate because the
- ConstraintExpression class was generated in earlier
- versions of NUnit. The two classes may be combined
- in a future version.
-
-
-
-
- The ConstraintBuilder holding the elements recognized so far
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the
- class passing in a ConstraintBuilder, which may be pre-populated.
-
- The builder.
-
-
-
- Returns a string representation of the expression as it
- currently stands. This should only be used for testing,
- since it has the side-effect of resolving the expression.
-
-
-
-
-
- Appends an operator to the expression and returns the
- resulting expression itself.
-
-
-
-
- Appends a self-resolving operator to the expression and
- returns a new ResolvableConstraintExpression.
-
-
-
-
- Appends a constraint to the expression and returns that
- constraint, which is associated with the current state
- of the expression being built.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the
- class passing in a ConstraintBuilder, which may be pre-populated.
-
- The builder.
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding only if a specified number of them succeed.
-
-
-
-
- Returns a new PropertyConstraintExpression, which will either
- test for the existence of the named property on the object
- being tested or apply any following constraint to that property.
-
-
-
-
- Returns a new AttributeConstraint checking for the
- presence of a particular attribute on an object.
-
-
-
-
- Returns a new AttributeConstraint checking for the
- presence of a particular attribute on an object.
-
-
-
-
- Returns the constraint provided as an argument - used to allow custom
- custom constraints to easily participate in the syntax.
-
-
-
-
- Returns the constraint provided as an argument - used to allow custom
- custom constraints to easily participate in the syntax.
-
-
-
-
- Returns a constraint that tests two items for equality
-
-
-
-
- Returns a constraint that tests that two references are the same object
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the actual
- value is of the exact type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual
- value is of the exact type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is a collection containing the same elements as the
- collection supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is a subset of the collection supplied as an argument.
-
-
-
-
- Returns a new CollectionContainsConstraint checking for the
- presence of a particular object in the collection.
-
-
-
-
- Returns a new CollectionContainsConstraint checking for the
- presence of a particular object in the collection.
-
-
-
-
- Returns a new ContainsConstraint. This constraint
- will, in turn, make use of the appropriate second-level
- constraint, depending on the type of the actual argument.
- This overload is only used if the item sought is a string,
- since any other type implies that we are looking for a
- collection member.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value matches the Regex pattern supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value matches the Regex pattern supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same as an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same path or under an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same path or under an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the actual value falls
- within a specified range.
-
-
-
-
- Returns a ConstraintExpression that negates any
- following constraint.
-
-
-
-
- Returns a ConstraintExpression that negates any
- following constraint.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them succeed.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if at least one of them succeeds.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them fail.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Length property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Count property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Message property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the InnerException property of the object being tested.
-
-
-
-
- With is currently a NOP - reserved for future use.
-
-
-
-
- Returns a constraint that tests for null
-
-
-
-
- Returns a constraint that tests for True
-
-
-
-
- Returns a constraint that tests for False
-
-
-
-
- Returns a constraint that tests for a positive value
-
-
-
-
- Returns a constraint that tests for a negative value
-
-
-
-
- Returns a constraint that tests for NaN
-
-
-
-
- Returns a constraint that tests for empty
-
-
-
-
- Returns a constraint that tests whether a collection
- contains all unique items.
-
-
-
-
- Returns a constraint that tests whether an object graph is serializable in binary format.
-
-
-
-
- Returns a constraint that tests whether an object graph is serializable in xml format.
-
-
-
-
- Returns a constraint that tests whether a collection is ordered
-
-
-
-
- Helper class with properties and methods that supply
- a number of constraints used in Asserts.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding only if a specified number of them succeed.
-
-
-
-
- Returns a new PropertyConstraintExpression, which will either
- test for the existence of the named property on the object
- being tested or apply any following constraint to that property.
-
-
-
-
- Returns a new AttributeConstraint checking for the
- presence of a particular attribute on an object.
-
-
-
-
- Returns a new AttributeConstraint checking for the
- presence of a particular attribute on an object.
-
-
-
-
- Returns a constraint that tests two items for equality
-
-
-
-
- Returns a constraint that tests that two references are the same object
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the actual
- value is of the exact type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual
- value is of the exact type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is a collection containing the same elements as the
- collection supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is a subset of the collection supplied as an argument.
-
-
-
-
- Returns a new CollectionContainsConstraint checking for the
- presence of a particular object in the collection.
-
-
-
-
- Returns a new CollectionContainsConstraint checking for the
- presence of a particular object in the collection.
-
-
-
-
- Returns a new ContainsConstraint. This constraint
- will, in turn, make use of the appropriate second-level
- constraint, depending on the type of the actual argument.
- This overload is only used if the item sought is a string,
- since any other type implies that we are looking for a
- collection member.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value matches the Regex pattern supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value matches the Regex pattern supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value matches the pattern supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same as an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same path or under an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same path or under an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the actual value falls
- within a specified range.
-
-
-
-
- Returns a ConstraintExpression that negates any
- following constraint.
-
-
-
-
- Returns a ConstraintExpression that negates any
- following constraint.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them succeed.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if at least one of them succeeds.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them fail.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Length property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Count property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Message property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the InnerException property of the object being tested.
-
-
-
-
- Returns a constraint that tests for null
-
-
-
-
- Returns a constraint that tests for True
-
-
-
-
- Returns a constraint that tests for False
-
-
-
-
- Returns a constraint that tests for a positive value
-
-
-
-
- Returns a constraint that tests for a negative value
-
-
-
-
- Returns a constraint that tests for NaN
-
-
-
-
- Returns a constraint that tests for empty
-
-
-
-
- Returns a constraint that tests whether a collection
- contains all unique items.
-
-
-
-
- Returns a constraint that tests whether an object graph is serializable in binary format.
-
-
-
-
- Returns a constraint that tests whether an object graph is serializable in xml format.
-
-
-
-
- Returns a constraint that tests whether a collection is ordered
-
-
-
-
- The ConstraintOperator class is used internally by a
- ConstraintBuilder to represent an operator that
- modifies or combines constraints.
-
- Constraint operators use left and right precedence
- values to determine whether the top operator on the
- stack should be reduced before pushing a new operator.
-
-
-
-
- The precedence value used when the operator
- is about to be pushed to the stack.
-
-
-
-
- The precedence value used when the operator
- is on the top of the stack.
-
-
-
-
- Reduce produces a constraint from the operator and
- any arguments. It takes the arguments from the constraint
- stack and pushes the resulting constraint on it.
-
-
-
-
-
- The syntax element preceding this operator
-
-
-
-
- The syntax element folowing this operator
-
-
-
-
- The precedence value used when the operator
- is about to be pushed to the stack.
-
-
-
-
- The precedence value used when the operator
- is on the top of the stack.
-
-
-
-
- PrefixOperator takes a single constraint and modifies
- it's action in some way.
-
-
-
-
- Reduce produces a constraint from the operator and
- any arguments. It takes the arguments from the constraint
- stack and pushes the resulting constraint on it.
-
-
-
-
-
- Returns the constraint created by applying this
- prefix to another constraint.
-
-
-
-
-
-
- Negates the test of the constraint it wraps.
-
-
-
-
- Constructs a new NotOperator
-
-
-
-
- Returns a NotConstraint applied to its argument.
-
-
-
-
- Abstract base for operators that indicate how to
- apply a constraint to items in a collection.
-
-
-
-
- Constructs a CollectionOperator
-
-
-
-
- Represents a constraint that succeeds if all the
- members of a collection match a base constraint.
-
-
-
-
- Returns a constraint that will apply the argument
- to the members of a collection, succeeding if
- they all succeed.
-
-
-
-
- Represents a constraint that succeeds if any of the
- members of a collection match a base constraint.
-
-
-
-
- Returns a constraint that will apply the argument
- to the members of a collection, succeeding if
- any of them succeed.
-
-
-
-
- Represents a constraint that succeeds if none of the
- members of a collection match a base constraint.
-
-
-
-
- Returns a constraint that will apply the argument
- to the members of a collection, succeeding if
- none of them succeed.
-
-
-
-
- Represents a constraint that succeeds if the specified
- count of members of a collection match a base constraint.
-
-
-
-
- Construct an ExactCountOperator for a specified count
-
- The expected count
-
-
-
- Returns a constraint that will apply the argument
- to the members of a collection, succeeding if
- none of them succeed.
-
-
-
-
- Represents a constraint that simply wraps the
- constraint provided as an argument, without any
- further functionality, but which modifes the
- order of evaluation because of its precedence.
-
-
-
-
- Constructor for the WithOperator
-
-
-
-
- Returns a constraint that wraps its argument
-
-
-
-
- Abstract base class for operators that are able to reduce to a
- constraint whether or not another syntactic element follows.
-
-
-
-
- Operator used to test for the presence of a named Property
- on an object and optionally apply further tests to the
- value of that property.
-
-
-
-
- Constructs a PropOperator for a particular named property
-
-
-
-
- Reduce produces a constraint from the operator and
- any arguments. It takes the arguments from the constraint
- stack and pushes the resulting constraint on it.
-
-
-
-
-
- Gets the name of the property to which the operator applies
-
-
-
-
- Operator that tests for the presence of a particular attribute
- on a type and optionally applies further tests to the attribute.
-
-
-
-
- Construct an AttributeOperator for a particular Type
-
- The Type of attribute tested
-
-
-
- Reduce produces a constraint from the operator and
- any arguments. It takes the arguments from the constraint
- stack and pushes the resulting constraint on it.
-
-
-
-
- Operator that tests that an exception is thrown and
- optionally applies further tests to the exception.
-
-
-
-
- Construct a ThrowsOperator
-
-
-
-
- Reduce produces a constraint from the operator and
- any arguments. It takes the arguments from the constraint
- stack and pushes the resulting constraint on it.
-
-
-
-
- Abstract base class for all binary operators
-
-
-
-
- Reduce produces a constraint from the operator and
- any arguments. It takes the arguments from the constraint
- stack and pushes the resulting constraint on it.
-
-
-
-
-
- Abstract method that produces a constraint by applying
- the operator to its left and right constraint arguments.
-
-
-
-
- Gets the left precedence of the operator
-
-
-
-
- Gets the right precedence of the operator
-
-
-
-
- Operator that requires both it's arguments to succeed
-
-
-
-
- Construct an AndOperator
-
-
-
-
- Apply the operator to produce an AndConstraint
-
-
-
-
- Operator that requires at least one of it's arguments to succeed
-
-
-
-
- Construct an OrOperator
-
-
-
-
- Apply the operator to produce an OrConstraint
-
-
-
-
- ContainsConstraint tests a whether a string contains a substring
- or a collection contains an object. It postpones the decision of
- which test to use until the type of the actual argument is known.
- This allows testing whether a string is contained in a collection
- or as a substring of another string using the same syntax.
-
-
-
-
- Initializes a new instance of the class.
-
- The expected.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Flag the constraint to use the supplied IComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied Comparison object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IEqualityComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IEqualityComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to ignore case and return self.
-
-
-
-
- Applies a delay to the match so that a match can be evaluated in the future.
-
-
-
-
- Creates a new DelayedConstraint
-
- The inner constraint two decorate
- The time interval after which the match is performed
- If the value of is less than 0
-
-
-
- Creates a new DelayedConstraint
-
- The inner constraint two decorate
- The time interval after which the match is performed
- The time interval used for polling
- If the value of is less than 0
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for if the base constraint fails, false if it succeeds
-
-
-
- Test whether the constraint is satisfied by a delegate
-
- The delegate whose value is to be tested
- True for if the base constraint fails, false if it succeeds
-
-
-
- Test whether the constraint is satisfied by a given reference.
- Overridden to wait for the specified delay period before
- calling the base constraint with the dereferenced value.
-
- A reference to the value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a MessageWriter.
-
- The writer on which the actual value is displayed
-
-
-
- Returns the string representation of the constraint.
-
-
-
-
- EmptyDirectoryConstraint is used to test that a directory is empty
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- EmptyConstraint tests a whether a string or collection is empty,
- postponing the decision about which test is applied until the
- type of the actual argument is known.
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- EqualConstraint is able to compare an actual value with the
- expected value provided in its constructor. Two objects are
- considered equal if both are null, or if both have the same
- value. NUnit has special semantics for some object types.
-
-
-
-
- If true, strings in error messages will be clipped
-
-
-
-
- NUnitEqualityComparer used to test equality.
-
-
-
-
- Initializes a new instance of the class.
-
- The expected value.
-
-
-
- Flag the constraint to use a tolerance when determining equality.
-
- Tolerance value to be used
- Self.
-
-
-
- Flag the constraint to use the supplied IComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied Comparison object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IEqualityComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Flag the constraint to use the supplied IEqualityComparer object.
-
- The IComparer object to use.
- Self.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write a failure message. Overridden to provide custom
- failure messages for EqualConstraint.
-
- The MessageWriter to write to
-
-
-
- Write description of this constraint
-
- The MessageWriter to write to
-
-
-
- Display the failure information for two collections that did not match.
-
- The MessageWriter on which to display
- The expected collection.
- The actual collection
- The depth of this failure in a set of nested collections
-
-
-
- Displays a single line showing the types and sizes of the expected
- and actual enumerations, collections or arrays. If both are identical,
- the value is only shown once.
-
- The MessageWriter on which to display
- The expected collection or array
- The actual collection or array
- The indentation level for the message line
-
-
-
- Displays a single line showing the point in the expected and actual
- arrays at which the comparison failed. If the arrays have different
- structures or dimensions, both values are shown.
-
- The MessageWriter on which to display
- The expected array
- The actual array
- Index of the failure point in the underlying collections
- The indentation level for the message line
-
-
-
- Display the failure information for two IEnumerables that did not match.
-
- The MessageWriter on which to display
- The expected enumeration.
- The actual enumeration
- The depth of this failure in a set of nested collections
-
-
-
- Flag the constraint to ignore case and return self.
-
-
-
-
- Flag the constraint to suppress string clipping
- and return self.
-
-
-
-
- Flag the constraint to compare arrays as collections
- and return self.
-
-
-
-
- Switches the .Within() modifier to interpret its tolerance as
- a distance in representable values (see remarks).
-
- Self.
-
- Ulp stands for "unit in the last place" and describes the minimum
- amount a given value can change. For any integers, an ulp is 1 whole
- digit. For floating point values, the accuracy of which is better
- for smaller numbers and worse for larger numbers, an ulp depends
- on the size of the number. Using ulps for comparison of floating
- point results instead of fixed tolerances is safer because it will
- automatically compensate for the added inaccuracy of larger numbers.
-
-
-
-
- Switches the .Within() modifier to interpret its tolerance as
- a percentage that the actual values is allowed to deviate from
- the expected value.
-
- Self
-
-
-
- Causes the tolerance to be interpreted as a TimeSpan in days.
-
- Self
-
-
-
- Causes the tolerance to be interpreted as a TimeSpan in hours.
-
- Self
-
-
-
- Causes the tolerance to be interpreted as a TimeSpan in minutes.
-
- Self
-
-
-
- Causes the tolerance to be interpreted as a TimeSpan in seconds.
-
- Self
-
-
-
- Causes the tolerance to be interpreted as a TimeSpan in milliseconds.
-
- Self
-
-
-
- Causes the tolerance to be interpreted as a TimeSpan in clock ticks.
-
- Self
-
-
-
- EqualityAdapter class handles all equality comparisons
- that use an IEqualityComparer, IEqualityComparer<T>
- or a ComparisonAdapter.
-
-
-
-
- Compares two objects, returning true if they are equal
-
-
-
-
- Returns true if the two objects can be compared by this adapter.
- The base adapter cannot handle IEnumerables except for strings.
-
-
-
-
- Returns an EqualityAdapter that wraps an IComparer.
-
-
-
-
- Returns an EqualityAdapter that wraps an IEqualityComparer.
-
-
-
-
- Returns an EqualityAdapter that wraps an IEqualityComparer<T>.
-
-
-
-
- Returns an EqualityAdapter that wraps an IComparer<T>.
-
-
-
-
- Returns an EqualityAdapter that wraps a Comparison<T>.
-
-
-
-
- EqualityAdapter that wraps an IComparer.
-
-
-
-
- Returns true if the two objects can be compared by this adapter.
- Generic adapter requires objects of the specified type.
-
-
-
-
- EqualityAdapter that wraps an IComparer.
-
-
-
- Helper routines for working with floating point numbers
-
-
- The floating point comparison code is based on this excellent article:
- http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
-
-
- "ULP" means Unit in the Last Place and in the context of this library refers to
- the distance between two adjacent floating point numbers. IEEE floating point
- numbers can only represent a finite subset of natural numbers, with greater
- accuracy for smaller numbers and lower accuracy for very large numbers.
-
-
- If a comparison is allowed "2 ulps" of deviation, that means the values are
- allowed to deviate by up to 2 adjacent floating point values, which might be
- as low as 0.0000001 for small numbers or as high as 10.0 for large numbers.
-
-
-
-
- Compares two floating point values for equality
- First floating point value to be compared
- Second floating point value t be compared
-
- Maximum number of representable floating point values that are allowed to
- be between the left and the right floating point values
-
- True if both numbers are equal or close to being equal
-
-
- Floating point values can only represent a finite subset of natural numbers.
- For example, the values 2.00000000 and 2.00000024 can be stored in a float,
- but nothing inbetween them.
-
-
- This comparison will count how many possible floating point values are between
- the left and the right number. If the number of possible values between both
- numbers is less than or equal to maxUlps, then the numbers are considered as
- being equal.
-
-
- Implementation partially follows the code outlined here:
- http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
-
-
-
-
- Compares two double precision floating point values for equality
- First double precision floating point value to be compared
- Second double precision floating point value t be compared
-
- Maximum number of representable double precision floating point values that are
- allowed to be between the left and the right double precision floating point values
-
- True if both numbers are equal or close to being equal
-
-
- Double precision floating point values can only represent a limited series of
- natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004
- can be stored in a double, but nothing inbetween them.
-
-
- This comparison will count how many possible double precision floating point
- values are between the left and the right number. If the number of possible
- values between both numbers is less than or equal to maxUlps, then the numbers
- are considered as being equal.
-
-
- Implementation partially follows the code outlined here:
- http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/
-
-
-
-
-
- Reinterprets the memory contents of a floating point value as an integer value
-
-
- Floating point value whose memory contents to reinterpret
-
-
- The memory contents of the floating point value interpreted as an integer
-
-
-
-
- Reinterprets the memory contents of a double precision floating point
- value as an integer value
-
-
- Double precision floating point value whose memory contents to reinterpret
-
-
- The memory contents of the double precision floating point value
- interpreted as an integer
-
-
-
-
- Reinterprets the memory contents of an integer as a floating point value
-
- Integer value whose memory contents to reinterpret
-
- The memory contents of the integer value interpreted as a floating point value
-
-
-
-
- Reinterprets the memory contents of an integer value as a double precision
- floating point value
-
- Integer whose memory contents to reinterpret
-
- The memory contents of the integer interpreted as a double precision
- floating point value
-
-
-
- Union of a floating point variable and an integer
-
-
- The union's value as a floating point variable
-
-
- The union's value as an integer
-
-
- The union's value as an unsigned integer
-
-
- Union of a double precision floating point variable and a long
-
-
- The union's value as a double precision floating point variable
-
-
- The union's value as a long
-
-
- The union's value as an unsigned long
-
-
-
- Tests whether a value is greater than the value supplied to its constructor
-
-
-
-
- The value against which a comparison is to be made
-
-
-
-
- Initializes a new instance of the class.
-
- The expected value.
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Tests whether a value is greater than or equal to the value supplied to its constructor
-
-
-
-
- The value against which a comparison is to be made
-
-
-
-
- Initializes a new instance of the class.
-
- The expected value.
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Tests whether a value is less than the value supplied to its constructor
-
-
-
-
- The value against which a comparison is to be made
-
-
-
-
- Initializes a new instance of the class.
-
- The expected value.
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Tests whether a value is less than or equal to the value supplied to its constructor
-
-
-
-
- The value against which a comparison is to be made
-
-
-
-
- Initializes a new instance of the class.
-
- The expected value.
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- MessageWriter is the abstract base for classes that write
- constraint descriptions and messages in some form. The
- class has separate methods for writing various components
- of a message, allowing implementations to tailor the
- presentation as needed.
-
-
-
-
- Construct a MessageWriter given a culture
-
-
-
-
- Method to write single line message with optional args, usually
- written to precede the general failure message.
-
- The message to be written
- Any arguments used in formatting the message
-
-
-
- Method to write single line message with optional args, usually
- written to precede the general failure message, at a givel
- indentation level.
-
- The indentation level of the message
- The message to be written
- Any arguments used in formatting the message
-
-
-
- Display Expected and Actual lines for a constraint. This
- is called by MessageWriter's default implementation of
- WriteMessageTo and provides the generic two-line display.
-
- The constraint that failed
-
-
-
- Display Expected and Actual lines for given values. This
- method may be called by constraints that need more control over
- the display of actual and expected values than is provided
- by the default implementation.
-
- The expected value
- The actual value causing the failure
-
-
-
- Display Expected and Actual lines for given values, including
- a tolerance value on the Expected line.
-
- The expected value
- The actual value causing the failure
- The tolerance within which the test was made
-
-
-
- Display the expected and actual string values on separate lines.
- If the mismatch parameter is >=0, an additional line is displayed
- line containing a caret that points to the mismatch point.
-
- The expected string value
- The actual string value
- The point at which the strings don't match or -1
- If true, case is ignored in locating the point where the strings differ
- If true, the strings should be clipped to fit the line
-
-
-
- Writes the text for a connector.
-
- The connector.
-
-
-
- Writes the text for a predicate.
-
- The predicate.
-
-
-
- Writes the text for an expected value.
-
- The expected value.
-
-
-
- Writes the text for a modifier
-
- The modifier.
-
-
-
- Writes the text for an actual value.
-
- The actual value.
-
-
-
- Writes the text for a generalized value.
-
- The value.
-
-
-
- Writes the text for a collection value,
- starting at a particular point, to a max length
-
- The collection containing elements to write.
- The starting point of the elements to write
- The maximum number of elements to write
-
-
-
- Abstract method to get the max line length
-
-
-
-
- Static methods used in creating messages
-
-
-
-
- Static string used when strings are clipped
-
-
-
-
- Returns the representation of a type as used in NUnitLite.
- This is the same as Type.ToString() except for arrays,
- which are displayed with their declared sizes.
-
-
-
-
-
-
- Converts any control characters in a string
- to their escaped representation.
-
- The string to be converted
- The converted string
-
-
-
- Return the a string representation for a set of indices into an array
-
- Array of indices for which a string is needed
-
-
-
- Get an array of indices representing the point in a enumerable,
- collection or array corresponding to a single int index into the
- collection.
-
- The collection to which the indices apply
- Index in the collection
- Array of indices
-
-
-
- Clip a string to a given length, starting at a particular offset, returning the clipped
- string with ellipses representing the removed parts
-
- The string to be clipped
- The maximum permitted length of the result string
- The point at which to start clipping
- The clipped string
-
-
-
- Clip the expected and actual strings in a coordinated fashion,
- so that they may be displayed together.
-
-
-
-
-
-
-
-
- Shows the position two strings start to differ. Comparison
- starts at the start index.
-
- The expected string
- The actual string
- The index in the strings at which comparison should start
- Boolean indicating whether case should be ignored
- -1 if no mismatch found, or the index where mismatch found
-
-
-
- The Numerics class contains common operations on numeric values.
-
-
-
-
- Checks the type of the object, returning true if
- the object is a numeric type.
-
- The object to check
- true if the object is a numeric type
-
-
-
- Checks the type of the object, returning true if
- the object is a floating point numeric type.
-
- The object to check
- true if the object is a floating point numeric type
-
-
-
- Checks the type of the object, returning true if
- the object is a fixed point numeric type.
-
- The object to check
- true if the object is a fixed point numeric type
-
-
-
- Test two numeric values for equality, performing the usual numeric
- conversions and using a provided or default tolerance. If the tolerance
- provided is Empty, this method may set it to a default tolerance.
-
- The expected value
- The actual value
- A reference to the tolerance in effect
- True if the values are equal
-
-
-
- Compare two numeric values, performing the usual numeric conversions.
-
- The expected value
- The actual value
- The relationship of the values to each other
-
-
-
- NUnitComparer encapsulates NUnit's default behavior
- in comparing two objects.
-
-
-
-
- Compares two objects
-
-
-
-
-
-
-
- Returns the default NUnitComparer.
-
-
-
-
- Generic version of NUnitComparer
-
-
-
-
-
- Compare two objects of the same type
-
-
-
-
- NUnitEqualityComparer encapsulates NUnit's handling of
- equality tests between objects.
-
-
-
-
-
-
-
-
-
- Compares two objects for equality within a tolerance
-
- The first object to compare
- The second object to compare
- The tolerance to use in the comparison
-
-
-
-
- If true, all string comparisons will ignore case
-
-
-
-
- If true, arrays will be treated as collections, allowing
- those of different dimensions to be compared
-
-
-
-
- Comparison objects used in comparisons for some constraints.
-
-
-
-
- Compares two objects for equality within a tolerance.
-
-
-
-
- Helper method to compare two arrays
-
-
-
-
- Method to compare two DirectoryInfo objects
-
- first directory to compare
- second directory to compare
- true if equivalent, false if not
-
-
-
- Returns the default NUnitEqualityComparer
-
-
-
-
- Gets and sets a flag indicating whether case should
- be ignored in determining equality.
-
-
-
-
- Gets and sets a flag indicating that arrays should be
- compared as collections, without regard to their shape.
-
-
-
-
- Gets and sets an external comparer to be used to
- test for equality. It is applied to members of
- collections, in place of NUnit's own logic.
-
-
-
-
- Gets the list of failure points for the last Match performed.
-
-
-
-
- FailurePoint class represents one point of failure
- in an equality test.
-
-
-
-
- The location of the failure
-
-
-
-
- The expected value
-
-
-
-
- The actual value
-
-
-
-
- Indicates whether the expected value is valid
-
-
-
-
- Indicates whether the actual value is valid
-
-
-
-
- PathConstraint serves as the abstract base of constraints
- that operate on paths and provides several helper methods.
-
-
-
-
- The expected path used in the constraint
-
-
-
-
- The actual path being tested
-
-
-
-
- Flag indicating whether a caseInsensitive comparison should be made
-
-
-
-
- Construct a PathConstraint for a give expected path
-
- The expected path
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Returns true if the expected path and actual path match
-
-
-
-
- Returns the string representation of this constraint
-
-
-
-
- Canonicalize the provided path
-
-
- The path in standardized form
-
-
-
- Test whether two paths are the same
-
- The first path
- The second path
- Indicates whether case should be ignored
-
-
-
-
- Test whether one path is under another path
-
- The first path - supposed to be the parent path
- The second path - supposed to be the child path
- Indicates whether case should be ignored
-
-
-
-
- Test whether one path is the same as or under another path
-
- The first path - supposed to be the parent path
- The second path - supposed to be the child path
-
-
-
-
- Modifies the current instance to be case-insensitve
- and returns it.
-
-
-
-
- Modifies the current instance to be case-sensitve
- and returns it.
-
-
-
-
- Summary description for SamePathConstraint.
-
-
-
-
- Initializes a new instance of the class.
-
- The expected path
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The expected path
- The actual path
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- SubPathConstraint tests that the actual path is under the expected path
-
-
-
-
- Initializes a new instance of the class.
-
- The expected path
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The expected path
- The actual path
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- SamePathOrUnderConstraint tests that one path is under another
-
-
-
-
- Initializes a new instance of the class.
-
- The expected path
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The expected path
- The actual path
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Predicate constraint wraps a Predicate in a constraint,
- returning success if the predicate is true.
-
-
-
-
- Construct a PredicateConstraint from a predicate
-
-
-
-
- Determines whether the predicate succeeds when applied
- to the actual value.
-
-
-
-
- Writes the description to a MessageWriter
-
-
-
-
- NotConstraint negates the effect of some other constraint
-
-
-
-
- Initializes a new instance of the class.
-
- The base constraint to be negated.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for if the base constraint fails, false if it succeeds
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a MessageWriter.
-
- The writer on which the actual value is displayed
-
-
-
- AllItemsConstraint applies another constraint to each
- item in a collection, succeeding if they all succeed.
-
-
-
-
- Construct an AllItemsConstraint on top of an existing constraint
-
-
-
-
-
- Apply the item constraint to each item in the collection,
- failing if any item fails.
-
-
-
-
-
-
- Write a description of this constraint to a MessageWriter
-
-
-
-
-
- SomeItemsConstraint applies another constraint to each
- item in a collection, succeeding if any of them succeeds.
-
-
-
-
- Construct a SomeItemsConstraint on top of an existing constraint
-
-
-
-
-
- Apply the item constraint to each item in the collection,
- succeeding if any item succeeds.
-
-
-
-
-
-
- Write a description of this constraint to a MessageWriter
-
-
-
-
-
- NoItemConstraint applies another constraint to each
- item in a collection, failing if any of them succeeds.
-
-
-
-
- Construct a NoItemConstraint on top of an existing constraint
-
-
-
-
-
- Apply the item constraint to each item in the collection,
- failing if any item fails.
-
-
-
-
-
-
- Write a description of this constraint to a MessageWriter
-
-
-
-
-
- ExactCoutConstraint applies another constraint to each
- item in a collection, succeeding only if a specified
- number of items succeed.
-
-
-
-
- Construct an ExactCountConstraint on top of an existing constraint
-
-
-
-
-
-
- Apply the item constraint to each item in the collection,
- succeeding only if the expected number of items pass.
-
-
-
-
-
-
- Write a description of this constraint to a MessageWriter
-
-
-
-
-
- PropertyExistsConstraint tests that a named property
- exists on the object provided through Match.
-
- Originally, PropertyConstraint provided this feature
- in addition to making optional tests on the vaue
- of the property. The two constraints are now separate.
-
-
-
-
- Initializes a new instance of the class.
-
- The name of the property.
-
-
-
- Test whether the property exists for a given object
-
- The object to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter.
-
- The writer on which the actual value is displayed
-
-
-
- Returns the string representation of the constraint.
-
-
-
-
-
- PropertyConstraint extracts a named property and uses
- its value as the actual value for a chained constraint.
-
-
-
-
- Initializes a new instance of the class.
-
- The name.
- The constraint to apply to the property.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- Returns the string representation of the constraint.
-
-
-
-
-
- RangeConstraint tests whethe two values are within a
- specified range.
-
-
-
-
- Initializes a new instance of the class.
-
- From.
- To.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- ResolvableConstraintExpression is used to represent a compound
- constraint being constructed at a point where the last operator
- may either terminate the expression or may have additional
- qualifying constraints added to it.
-
- It is used, for example, for a Property element or for
- an Exception element, either of which may be optionally
- followed by constraints that apply to the property or
- exception.
-
-
-
-
- Create a new instance of ResolvableConstraintExpression
-
-
-
-
- Create a new instance of ResolvableConstraintExpression,
- passing in a pre-populated ConstraintBuilder.
-
-
-
-
- Resolve the current expression to a Constraint
-
-
-
-
- This operator creates a constraint that is satisfied only if both
- argument constraints are satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied only if both
- argument constraints are satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied only if both
- argument constraints are satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied if either
- of the argument constraints is satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied if either
- of the argument constraints is satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied if either
- of the argument constraints is satisfied.
-
-
-
-
- This operator creates a constraint that is satisfied if the
- argument constraint is not satisfied.
-
-
-
-
- Appends an And Operator to the expression
-
-
-
-
- Appends an Or operator to the expression.
-
-
-
-
- ReusableConstraint wraps a resolved constraint so that it
- may be saved and reused as needed.
-
-
-
-
- Construct a ReusableConstraint
-
- The constraint or expression to be reused
-
-
-
- Conversion operator from a normal constraint to a ReusableConstraint.
-
- The original constraint to be wrapped as a ReusableConstraint
-
-
-
-
- Returns the string representation of the constraint.
-
- A string representing the constraint
-
-
-
- Resolves the ReusableConstraint by returning the constraint
- that it originally wrapped.
-
- A resolved constraint
-
-
-
- SameAsConstraint tests whether an object is identical to
- the object passed to its constructor
-
-
-
-
- Initializes a new instance of the class.
-
- The expected object.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- BinarySerializableConstraint tests whether
- an object is serializable in binary format.
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- Returns the string representation
-
-
-
-
- BinarySerializableConstraint tests whether
- an object is serializable in binary format.
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- Returns the string representation of this constraint
-
-
-
-
- StringConstraint is the abstract base for constraints
- that operate on strings. It supports the IgnoreCase
- modifier for string operations.
-
-
-
-
- The expected value
-
-
-
-
- Indicates whether tests should be case-insensitive
-
-
-
-
- Constructs a StringConstraint given an expected value
-
- The expected value
-
-
-
- Modify the constraint to ignore case in matching.
-
-
-
-
- EmptyStringConstraint tests whether a string is empty.
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- NullEmptyStringConstraint tests whether a string is either null or empty.
-
-
-
-
- Constructs a new NullOrEmptyStringConstraint
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- SubstringConstraint can test whether a string contains
- the expected substring.
-
-
-
-
- Initializes a new instance of the class.
-
- The expected.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- StartsWithConstraint can test whether a string starts
- with an expected substring.
-
-
-
-
- Initializes a new instance of the class.
-
- The expected string
-
-
-
- Test whether the constraint is matched by the actual value.
- This is a template method, which calls the IsMatch method
- of the derived class.
-
-
-
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- EndsWithConstraint can test whether a string ends
- with an expected substring.
-
-
-
-
- Initializes a new instance of the class.
-
- The expected string
-
-
-
- Test whether the constraint is matched by the actual value.
- This is a template method, which calls the IsMatch method
- of the derived class.
-
-
-
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- RegexConstraint can test whether a string matches
- the pattern provided.
-
-
-
-
- Initializes a new instance of the class.
-
- The pattern.
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True for success, false for failure
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- ThrowsConstraint is used to test the exception thrown by
- a delegate by applying a constraint to it.
-
-
-
-
- Initializes a new instance of the class,
- using a constraint to be applied to the exception.
-
- A constraint to apply to the caught exception.
-
-
-
- Executes the code of the delegate and captures any exception.
- If a non-null base constraint was provided, it applies that
- constraint to the exception.
-
- A delegate representing the code to be tested
- True if an exception is thrown and the constraint succeeds, otherwise false
-
-
-
- Converts an ActualValueDelegate to a TestDelegate
- before calling the primary overload.
-
-
-
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- Returns the string representation of this constraint
-
-
-
-
- Get the actual exception thrown - used by Assert.Throws.
-
-
-
-
- ThrowsNothingConstraint tests that a delegate does not
- throw an exception.
-
-
-
-
- Test whether the constraint is satisfied by a given value
-
- The value to be tested
- True if no exception is thrown, otherwise false
-
-
-
- Converts an ActualValueDelegate to a TestDelegate
- before calling the primary overload.
-
-
-
-
-
-
- Write the constraint description to a MessageWriter
-
- The writer on which the description is displayed
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. The default implementation simply writes
- the raw value of actual, leaving it to the writer to
- perform any formatting.
-
- The writer on which the actual value is displayed
-
-
-
- Modes in which the tolerance value for a comparison can
- be interpreted.
-
-
-
-
- The tolerance was created with a value, without specifying
- how the value would be used. This is used to prevent setting
- the mode more than once and is generally changed to Linear
- upon execution of the test.
-
-
-
-
- The tolerance is used as a numeric range within which
- two compared values are considered to be equal.
-
-
-
-
- Interprets the tolerance as the percentage by which
- the two compared values my deviate from each other.
-
-
-
-
- Compares two values based in their distance in
- representable numbers.
-
-
-
-
- The Tolerance class generalizes the notion of a tolerance
- within which an equality test succeeds. Normally, it is
- used with numeric types, but it can be used with any
- type that supports taking a difference between two
- objects and comparing that difference to a value.
-
-
-
-
- Constructs a linear tolerance of a specdified amount
-
-
-
-
- Constructs a tolerance given an amount and ToleranceMode
-
-
-
-
- Tests that the current Tolerance is linear with a
- numeric value, throwing an exception if it is not.
-
-
-
-
- Returns an empty Tolerance object, equivalent to
- specifying no tolerance. In most cases, it results
- in an exact match but for floats and doubles a
- default tolerance may be used.
-
-
-
-
- Returns a zero Tolerance object, equivalent to
- specifying an exact match.
-
-
-
-
- Gets the ToleranceMode for the current Tolerance
-
-
-
-
- Gets the value of the current Tolerance instance.
-
-
-
-
- Returns a new tolerance, using the current amount as a percentage.
-
-
-
-
- Returns a new tolerance, using the current amount in Ulps.
-
-
-
-
- Returns a new tolerance with a TimeSpan as the amount, using
- the current amount as a number of days.
-
-
-
-
- Returns a new tolerance with a TimeSpan as the amount, using
- the current amount as a number of hours.
-
-
-
-
- Returns a new tolerance with a TimeSpan as the amount, using
- the current amount as a number of minutes.
-
-
-
-
- Returns a new tolerance with a TimeSpan as the amount, using
- the current amount as a number of seconds.
-
-
-
-
- Returns a new tolerance with a TimeSpan as the amount, using
- the current amount as a number of milliseconds.
-
-
-
-
- Returns a new tolerance with a TimeSpan as the amount, using
- the current amount as a number of clock ticks.
-
-
-
-
- Returns true if the current tolerance is empty.
-
-
-
-
- TypeConstraint is the abstract base for constraints
- that take a Type as their expected value.
-
-
-
-
- The expected Type used by the constraint
-
-
-
-
- Construct a TypeConstraint for a given Type
-
-
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. TypeConstraints override this method to write
- the name of the type.
-
- The writer on which the actual value is displayed
-
-
-
- ExactTypeConstraint is used to test that an object
- is of the exact type provided in the constructor
-
-
-
-
- Construct an ExactTypeConstraint for a given Type
-
- The expected Type.
-
-
-
- Test that an object is of the exact type specified
-
- The actual value.
- True if the tested object is of the exact type provided, otherwise false.
-
-
-
- Write the description of this constraint to a MessageWriter
-
- The MessageWriter to use
-
-
-
- ExceptionTypeConstraint is a special version of ExactTypeConstraint
- used to provided detailed info about the exception thrown in
- an error message.
-
-
-
-
- Constructs an ExceptionTypeConstraint
-
-
-
-
- Write the actual value for a failing constraint test to a
- MessageWriter. Overriden to write additional information
- in the case of an Exception.
-
- The MessageWriter to use
-
-
-
- InstanceOfTypeConstraint is used to test that an object
- is of the same type provided or derived from it.
-
-
-
-
- Construct an InstanceOfTypeConstraint for the type provided
-
- The expected Type
-
-
-
- Test whether an object is of the specified type or a derived type
-
- The object to be tested
- True if the object is of the provided type or derives from it, otherwise false.
-
-
-
- Write a description of this constraint to a MessageWriter
-
- The MessageWriter to use
-
-
-
- AssignableFromConstraint is used to test that an object
- can be assigned from a given Type.
-
-
-
-
- Construct an AssignableFromConstraint for the type provided
-
-
-
-
-
- Test whether an object can be assigned from the specified type
-
- The object to be tested
- True if the object can be assigned a value of the expected Type, otherwise false.
-
-
-
- Write a description of this constraint to a MessageWriter
-
- The MessageWriter to use
-
-
-
- AssignableToConstraint is used to test that an object
- can be assigned to a given Type.
-
-
-
-
- Construct an AssignableToConstraint for the type provided
-
-
-
-
-
- Test whether an object can be assigned to the specified type
-
- The object to be tested
- True if the object can be assigned a value of the expected Type, otherwise false.
-
-
-
- Write a description of this constraint to a MessageWriter
-
- The MessageWriter to use
-
-
-
- Thrown when an assertion failed.
-
-
-
-
- The error message that explains
- the reason for the exception
-
-
- The error message that explains
- the reason for the exception
- The exception that caused the
- current exception
-
-
-
- Serialization Constructor
-
-
-
-
- Thrown when an assertion failed.
-
-
-
-
-
-
- The error message that explains
- the reason for the exception
- The exception that caused the
- current exception
-
-
-
- Serialization Constructor
-
-
-
-
- Thrown when a test executes inconclusively.
-
-
-
-
- The error message that explains
- the reason for the exception
-
-
- The error message that explains
- the reason for the exception
- The exception that caused the
- current exception
-
-
-
- Serialization Constructor
-
-
-
-
- Thrown when an assertion failed.
-
-
-
-
-
-
- The error message that explains
- the reason for the exception
- The exception that caused the
- current exception
-
-
-
- Serialization Constructor
-
-
-
-
-
-
-
-
-
-
- Compares two objects of a given Type for equality within a tolerance
-
- The first object to compare
- The second object to compare
- The tolerance to use in the comparison
-
-
-
-
- The different targets a test action attribute can be applied to
-
-
-
-
- Default target, which is determined by where the action attribute is attached
-
-
-
-
- Target a individual test case
-
-
-
-
- Target a suite of test cases
-
-
-
-
- Delegate used by tests that execute code and
- capture any thrown exception.
-
-
-
-
- The Assert class contains a collection of static methods that
- implement the most common assertions used in NUnit.
-
-
-
-
- We don't actually want any instances of this object, but some people
- like to inherit from it to add other static methods. Hence, the
- protected constructor disallows any instances of this object.
-
-
-
-
- The Equals method throws an AssertionException. This is done
- to make sure there is no mistake by calling this function.
-
-
-
-
-
-
- override the default ReferenceEquals to throw an AssertionException. This
- implementation makes sure there is no mistake in calling this function
- as part of Assert.
-
-
-
-
-
-
- Helper for Assert.AreEqual(double expected, double actual, ...)
- allowing code generation to work consistently.
-
- The expected value
- The actual value
- The maximum acceptable difference between the
- the expected and the actual
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Throws a with the message and arguments
- that are passed in. This allows a test to be cut short, with a result
- of success returned to NUnit.
-
- The message to initialize the with.
- Arguments to be used in formatting the message
-
-
-
- Throws a with the message and arguments
- that are passed in. This allows a test to be cut short, with a result
- of success returned to NUnit.
-
- The message to initialize the with.
-
-
-
- Throws a with the message and arguments
- that are passed in. This allows a test to be cut short, with a result
- of success returned to NUnit.
-
-
-
-
- Throws an with the message and arguments
- that are passed in. This is used by the other Assert functions.
-
- The message to initialize the with.
- Arguments to be used in formatting the message
-
-
-
- Throws an with the message that is
- passed in. This is used by the other Assert functions.
-
- The message to initialize the with.
-
-
-
- Throws an .
- This is used by the other Assert functions.
-
-
-
-
- Throws an with the message and arguments
- that are passed in. This causes the test to be reported as ignored.
-
- The message to initialize the with.
- Arguments to be used in formatting the message
-
-
-
- Throws an with the message that is
- passed in. This causes the test to be reported as ignored.
-
- The message to initialize the with.
-
-
-
- Throws an .
- This causes the test to be reported as ignored.
-
-
-
-
- Throws an with the message and arguments
- that are passed in. This causes the test to be reported as inconclusive.
-
- The message to initialize the with.
- Arguments to be used in formatting the message
-
-
-
- Throws an with the message that is
- passed in. This causes the test to be reported as inconclusive.
-
- The message to initialize the with.
-
-
-
- Throws an .
- This causes the test to be reported as Inconclusive.
-
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint expression to be applied
- The actual value to test
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint expression to be applied
- An ActualValueDelegate returning the value to be tested
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint expression to be applied
- An ActualValueDelegate returning the value to be tested
- The message that will be displayed on failure
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- An ActualValueDelegate returning the value to be tested
- A Constraint expression to be applied
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display if the condition is false
- Arguments to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display if the condition is false
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
-
-
-
- Asserts that the code represented by a delegate throws an exception
- that satisfies the constraint provided.
-
- A TestDelegate to be executed
- A ThrowsConstraint used in the test
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
- Used as a synonym for That in rare cases where a private setter
- causes a Visual Basic compilation error.
-
- A Constraint to be applied
- The actual value to test
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
- Used as a synonym for That in rare cases where a private setter
- causes a Visual Basic compilation error.
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
- Used as a synonym for That in rare cases where a private setter
- causes a Visual Basic compilation error.
-
-
- This method is provided for use by VB developers needing to test
- the value of properties with private setters.
-
- A Constraint expression to be applied
- The actual value to test
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- A constraint to be satisfied by the exception
- A TestSnippet delegate
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- A constraint to be satisfied by the exception
- A TestSnippet delegate
- The message that will be displayed on failure
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- A constraint to be satisfied by the exception
- A TestSnippet delegate
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- The exception Type expected
- A TestSnippet delegate
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- The exception Type expected
- A TestSnippet delegate
- The message that will be displayed on failure
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- The exception Type expected
- A TestSnippet delegate
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- Type of the expected exception
- A TestSnippet delegate
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- Type of the expected exception
- A TestSnippet delegate
- The message that will be displayed on failure
-
-
-
- Verifies that a delegate throws a particular exception when called.
-
- Type of the expected exception
- A TestSnippet delegate
-
-
-
- Verifies that a delegate throws an exception when called
- and returns it.
-
- A TestDelegate
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate throws an exception when called
- and returns it.
-
- A TestDelegate
- The message that will be displayed on failure
-
-
-
- Verifies that a delegate throws an exception when called
- and returns it.
-
- A TestDelegate
-
-
-
- Verifies that a delegate throws an exception of a certain Type
- or one derived from it when called and returns it.
-
- The expected Exception Type
- A TestDelegate
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate throws an exception of a certain Type
- or one derived from it when called and returns it.
-
- The expected Exception Type
- A TestDelegate
- The message that will be displayed on failure
-
-
-
- Verifies that a delegate throws an exception of a certain Type
- or one derived from it when called and returns it.
-
- The expected Exception Type
- A TestDelegate
-
-
-
- Verifies that a delegate throws an exception of a certain Type
- or one derived from it when called and returns it.
-
- The expected Exception Type
- A TestDelegate
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate throws an exception of a certain Type
- or one derived from it when called and returns it.
-
- The expected Exception Type
- A TestDelegate
- The message that will be displayed on failure
-
-
-
- Verifies that a delegate throws an exception of a certain Type
- or one derived from it when called and returns it.
-
- The expected Exception Type
- A TestDelegate
-
-
-
- Verifies that a delegate does not throw an exception
-
- A TestSnippet delegate
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Verifies that a delegate does not throw an exception.
-
- A TestSnippet delegate
- The message that will be displayed on failure
-
-
-
- Verifies that a delegate does not throw an exception.
-
- A TestSnippet delegate
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
-
-
-
- Asserts that a condition is false. If the condition is true the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that a condition is false. If the condition is true the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
-
-
-
- Asserts that a condition is false. If the condition is true the method throws
- an .
-
- The evaluated condition
-
-
-
- Asserts that a condition is false. If the condition is true the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that a condition is false. If the condition is true the method throws
- an .
-
- The evaluated condition
- The message to display in case of failure
-
-
-
- Asserts that a condition is false. If the condition is true the method throws
- an .
-
- The evaluated condition
-
-
-
- Verifies that the object that is passed in is not equal to null
- If the object is null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the object that is passed in is not equal to null
- If the object is null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
-
-
-
- Verifies that the object that is passed in is not equal to null
- If the object is null then an
- is thrown.
-
- The object that is to be tested
-
-
-
- Verifies that the object that is passed in is not equal to null
- If the object is null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the object that is passed in is not equal to null
- If the object is null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
-
-
-
- Verifies that the object that is passed in is not equal to null
- If the object is null then an
- is thrown.
-
- The object that is to be tested
-
-
-
- Verifies that the object that is passed in is equal to null
- If the object is not null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the object that is passed in is equal to null
- If the object is not null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
-
-
-
- Verifies that the object that is passed in is equal to null
- If the object is not null then an
- is thrown.
-
- The object that is to be tested
-
-
-
- Verifies that the object that is passed in is equal to null
- If the object is not null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the object that is passed in is equal to null
- If the object is not null then an
- is thrown.
-
- The object that is to be tested
- The message to display in case of failure
-
-
-
- Verifies that the object that is passed in is equal to null
- If the object is not null then an
- is thrown.
-
- The object that is to be tested
-
-
-
- Verifies that the double that is passed in is an NaN value.
- If the object is not NaN then an
- is thrown.
-
- The value that is to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the double that is passed in is an NaN value.
- If the object is not NaN then an
- is thrown.
-
- The value that is to be tested
- The message to display in case of failure
-
-
-
- Verifies that the double that is passed in is an NaN value.
- If the object is not NaN then an
- is thrown.
-
- The value that is to be tested
-
-
-
- Verifies that the double that is passed in is an NaN value.
- If the object is not NaN then an
- is thrown.
-
- The value that is to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the double that is passed in is an NaN value.
- If the object is not NaN then an
- is thrown.
-
- The value that is to be tested
- The message to display in case of failure
-
-
-
- Verifies that the double that is passed in is an NaN value.
- If the object is not NaN then an
- is thrown.
-
- The value that is to be tested
-
-
-
- Assert that a string is empty - that is equal to string.Empty
-
- The string to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Assert that a string is empty - that is equal to string.Empty
-
- The string to be tested
- The message to display in case of failure
-
-
-
- Assert that a string is empty - that is equal to string.Empty
-
- The string to be tested
-
-
-
- Assert that an array, list or other collection is empty
-
- An array, list or other collection implementing ICollection
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Assert that an array, list or other collection is empty
-
- An array, list or other collection implementing ICollection
- The message to display in case of failure
-
-
-
- Assert that an array, list or other collection is empty
-
- An array, list or other collection implementing ICollection
-
-
-
- Assert that a string is not empty - that is not equal to string.Empty
-
- The string to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Assert that a string is not empty - that is not equal to string.Empty
-
- The string to be tested
- The message to display in case of failure
-
-
-
- Assert that a string is not empty - that is not equal to string.Empty
-
- The string to be tested
-
-
-
- Assert that an array, list or other collection is not empty
-
- An array, list or other collection implementing ICollection
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Assert that an array, list or other collection is not empty
-
- An array, list or other collection implementing ICollection
- The message to display in case of failure
-
-
-
- Assert that an array, list or other collection is not empty
-
- An array, list or other collection implementing ICollection
-
-
-
- Assert that a string is either null or equal to string.Empty
-
- The string to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Assert that a string is either null or equal to string.Empty
-
- The string to be tested
- The message to display in case of failure
-
-
-
- Assert that a string is either null or equal to string.Empty
-
- The string to be tested
-
-
-
- Assert that a string is not null or empty
-
- The string to be tested
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Assert that a string is not null or empty
-
- The string to be tested
- The message to display in case of failure
-
-
-
- Assert that a string is not null or empty
-
- The string to be tested
-
-
-
- Asserts that an object may be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object may be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
-
-
-
- Asserts that an object may be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
-
-
-
- Asserts that an object may be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object may be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
-
-
-
- Asserts that an object may be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
-
-
-
- Asserts that an object may not be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object may not be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
-
-
-
- Asserts that an object may not be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
-
-
-
- Asserts that an object may not be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object may not be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
- The message to display in case of failure
-
-
-
- Asserts that an object may not be assigned a value of a given Type.
-
- The expected Type.
- The object under examination
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
-
-
-
- Asserts that an object is an instance of a given type.
-
- The expected Type
- The object being examined
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
- The message to display in case of failure
-
-
-
- Asserts that an object is not an instance of a given type.
-
- The expected Type
- The object being examined
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are equal. If they are not, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two doubles are equal considering a delta. If the
- expected value is infinity then the delta value is ignored. If
- they are not equal then an is
- thrown.
-
- The expected value
- The actual value
- The maximum acceptable difference between the
- the expected and the actual
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two doubles are equal considering a delta. If the
- expected value is infinity then the delta value is ignored. If
- they are not equal then an is
- thrown.
-
- The expected value
- The actual value
- The maximum acceptable difference between the
- the expected and the actual
- The message to display in case of failure
-
-
-
- Verifies that two doubles are equal considering a delta. If the
- expected value is infinity then the delta value is ignored. If
- they are not equal then an is
- thrown.
-
- The expected value
- The actual value
- The maximum acceptable difference between the
- the expected and the actual
-
-
-
- Verifies that two doubles are equal considering a delta. If the
- expected value is infinity then the delta value is ignored. If
- they are not equal then an is
- thrown.
-
- The expected value
- The actual value
- The maximum acceptable difference between the
- the expected and the actual
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two doubles are equal considering a delta. If the
- expected value is infinity then the delta value is ignored. If
- they are not equal then an is
- thrown.
-
- The expected value
- The actual value
- The maximum acceptable difference between the
- the expected and the actual
- The message to display in case of failure
-
-
-
- Verifies that two doubles are equal considering a delta. If the
- expected value is infinity then the delta value is ignored. If
- they are not equal then an is
- thrown.
-
- The expected value
- The actual value
- The maximum acceptable difference between the
- the expected and the actual
-
-
-
- Verifies that two objects are equal. Two objects are considered
- equal if both are null, or if both have the same value. NUnit
- has special semantics for some object types.
- If they are not equal an is thrown.
-
- The value that is expected
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two objects are equal. Two objects are considered
- equal if both are null, or if both have the same value. NUnit
- has special semantics for some object types.
- If they are not equal an is thrown.
-
- The value that is expected
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two objects are equal. Two objects are considered
- equal if both are null, or if both have the same value. NUnit
- has special semantics for some object types.
- If they are not equal an is thrown.
-
- The value that is expected
- The actual value
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two values are not equal. If they are equal, then an
- is thrown.
-
- The expected value
- The actual value
-
-
-
- Verifies that two objects are not equal. Two objects are considered
- equal if both are null, or if both have the same value. NUnit
- has special semantics for some object types.
- If they are equal an is thrown.
-
- The value that is expected
- The actual value
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that two objects are not equal. Two objects are considered
- equal if both are null, or if both have the same value. NUnit
- has special semantics for some object types.
- If they are equal an is thrown.
-
- The value that is expected
- The actual value
- The message to display in case of failure
-
-
-
- Verifies that two objects are not equal. Two objects are considered
- equal if both are null, or if both have the same value. NUnit
- has special semantics for some object types.
- If they are equal an is thrown.
-
- The value that is expected
- The actual value
-
-
-
- Asserts that two objects refer to the same object. If they
- are not the same an is thrown.
-
- The expected object
- The actual object
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that two objects refer to the same object. If they
- are not the same an is thrown.
-
- The expected object
- The actual object
- The message to display in case of failure
-
-
-
- Asserts that two objects refer to the same object. If they
- are not the same an is thrown.
-
- The expected object
- The actual object
-
-
-
- Asserts that two objects do not refer to the same object. If they
- are the same an is thrown.
-
- The expected object
- The actual object
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that two objects do not refer to the same object. If they
- are the same an is thrown.
-
- The expected object
- The actual object
- The message to display in case of failure
-
-
-
- Asserts that two objects do not refer to the same object. If they
- are the same an is thrown.
-
- The expected object
- The actual object
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
- The message to display in case of failure
-
-
-
- Verifies that the first value is greater than or equal tothe second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be greater
- The second value, expected to be less
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
- The message to display in case of failure
-
-
-
- Verifies that the first value is less than or equal to the second
- value. If it is not, then an
- is thrown.
-
- The first value, expected to be less
- The second value, expected to be greater
-
-
-
- Asserts that an object is contained in a list.
-
- The expected object
- The list to be examined
- The message to display in case of failure
- Array of objects to be used in formatting the message
-
-
-
- Asserts that an object is contained in a list.
-
- The expected object
- The list to be examined
- The message to display in case of failure
-
-
-
- Asserts that an object is contained in a list.
-
- The expected object
- The list to be examined
-
-
-
- Gets the number of assertions executed so far and
- resets the counter to zero.
-
-
-
-
- AssertionHelper is an optional base class for user tests,
- allowing the use of shorter names for constraints and
- asserts and avoiding conflict with the definition of
- , from which it inherits much of its
- behavior, in certain mock object frameworks.
-
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure. Works
- identically to Assert.That
-
- A Constraint to be applied
- The actual value to test
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure. Works
- identically to Assert.That.
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure. Works
- identically to Assert.That
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint expression to be applied
- An ActualValueDelegate returning the value to be tested
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint expression to be applied
- An ActualValueDelegate returning the value to be tested
- The message that will be displayed on failure
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- An ActualValueDelegate returning the value to be tested
- A Constraint expression to be applied
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an assertion exception on failure.
-
- A Constraint to be applied
- The actual value to test
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an . Works Identically to Assert.That.
-
- The evaluated condition
- The message to display if the condition is false
- Arguments to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an . Works Identically to Assert.That.
-
- The evaluated condition
- The message to display if the condition is false
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an . Works Identically Assert.That.
-
- The evaluated condition
-
-
-
- Asserts that the code represented by a delegate throws an exception
- that satisfies the constraint provided.
-
- A TestDelegate to be executed
- A ThrowsConstraint used in the test
-
-
-
- Returns a ListMapper based on a collection.
-
- The original collection
-
-
-
-
- Provides static methods to express the assumptions
- that must be met for a test to give a meaningful
- result. If an assumption is not met, the test
- should produce an inconclusive result.
-
-
-
-
- The Equals method throws an AssertionException. This is done
- to make sure there is no mistake by calling this function.
-
-
-
-
-
-
- override the default ReferenceEquals to throw an AssertionException. This
- implementation makes sure there is no mistake in calling this function
- as part of Assert.
-
-
-
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- The actual value to test
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- The actual value to test
- The message that will be displayed on failure
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- The actual value to test
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- An ActualValueDelegate returning the value to be tested
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- An ActualValueDelegate returning the value to be tested
- The message that will be displayed on failure
-
-
-
- Apply a constraint to an actual value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- An ActualValueDelegate returning the value to be tested
- A Constraint expression to be applied
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- The actual value to test
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- The actual value to test
- The message that will be displayed on failure
-
-
-
- Apply a constraint to a referenced value, succeeding if the constraint
- is satisfied and throwing an InconclusiveException on failure.
-
- A Constraint expression to be applied
- The actual value to test
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display if the condition is false
- Arguments to be used in formatting the message
-
-
-
- Asserts that a condition is true. If the condition is false the method throws
- an .
-
- The evaluated condition
- The message to display if the condition is false
-
-
-
- Asserts that a condition is true. If the condition is false the
- method throws an .
-
- The evaluated condition
-
-
-
- Asserts that the code represented by a delegate throws an exception
- that satisfies the constraint provided.
-
- A TestDelegate to be executed
- A ThrowsConstraint used in the test
-
-
-
- A set of Assert methods operationg on one or more collections
-
-
-
-
- The Equals method throws an AssertionException. This is done
- to make sure there is no mistake by calling this function.
-
-
-
-
-
-
- override the default ReferenceEquals to throw an AssertionException. This
- implementation makes sure there is no mistake in calling this function
- as part of Assert.
-
-
-
-
-
-
- Asserts that all items contained in collection are of the type specified by expectedType.
-
- IEnumerable containing objects to be considered
- System.Type that all objects in collection must be instances of
-
-
-
- Asserts that all items contained in collection are of the type specified by expectedType.
-
- IEnumerable containing objects to be considered
- System.Type that all objects in collection must be instances of
- The message that will be displayed on failure
-
-
-
- Asserts that all items contained in collection are of the type specified by expectedType.
-
- IEnumerable containing objects to be considered
- System.Type that all objects in collection must be instances of
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that all items contained in collection are not equal to null.
-
- IEnumerable containing objects to be considered
-
-
-
- Asserts that all items contained in collection are not equal to null.
-
- IEnumerable containing objects to be considered
- The message that will be displayed on failure
-
-
-
- Asserts that all items contained in collection are not equal to null.
-
- IEnumerable of objects to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Ensures that every object contained in collection exists within the collection
- once and only once.
-
- IEnumerable of objects to be considered
-
-
-
- Ensures that every object contained in collection exists within the collection
- once and only once.
-
- IEnumerable of objects to be considered
- The message that will be displayed on failure
-
-
-
- Ensures that every object contained in collection exists within the collection
- once and only once.
-
- IEnumerable of objects to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that expected and actual are exactly equal. The collections must have the same count,
- and contain the exact same objects in the same order.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
-
-
-
- Asserts that expected and actual are exactly equal. The collections must have the same count,
- and contain the exact same objects in the same order.
- If comparer is not null then it will be used to compare the objects.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The IComparer to use in comparing objects from each IEnumerable
-
-
-
- Asserts that expected and actual are exactly equal. The collections must have the same count,
- and contain the exact same objects in the same order.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
-
-
-
- Asserts that expected and actual are exactly equal. The collections must have the same count,
- and contain the exact same objects in the same order.
- If comparer is not null then it will be used to compare the objects.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The IComparer to use in comparing objects from each IEnumerable
- The message that will be displayed on failure
-
-
-
- Asserts that expected and actual are exactly equal. The collections must have the same count,
- and contain the exact same objects in the same order.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that expected and actual are exactly equal. The collections must have the same count,
- and contain the exact same objects in the same order.
- If comparer is not null then it will be used to compare the objects.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The IComparer to use in comparing objects from each IEnumerable
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
-
-
-
- Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
-
-
-
- Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that expected and actual are not exactly equal.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
-
-
-
- Asserts that expected and actual are not exactly equal.
- If comparer is not null then it will be used to compare the objects.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The IComparer to use in comparing objects from each IEnumerable
-
-
-
- Asserts that expected and actual are not exactly equal.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
-
-
-
- Asserts that expected and actual are not exactly equal.
- If comparer is not null then it will be used to compare the objects.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The IComparer to use in comparing objects from each IEnumerable
- The message that will be displayed on failure
-
-
-
- Asserts that expected and actual are not exactly equal.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that expected and actual are not exactly equal.
- If comparer is not null then it will be used to compare the objects.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The IComparer to use in comparing objects from each IEnumerable
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that expected and actual are not equivalent.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
-
-
-
- Asserts that expected and actual are not equivalent.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
-
-
-
- Asserts that expected and actual are not equivalent.
-
- The first IEnumerable of objects to be considered
- The second IEnumerable of objects to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that collection contains actual as an item.
-
- IEnumerable of objects to be considered
- Object to be found within collection
-
-
-
- Asserts that collection contains actual as an item.
-
- IEnumerable of objects to be considered
- Object to be found within collection
- The message that will be displayed on failure
-
-
-
- Asserts that collection contains actual as an item.
-
- IEnumerable of objects to be considered
- Object to be found within collection
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that collection does not contain actual as an item.
-
- IEnumerable of objects to be considered
- Object that cannot exist within collection
-
-
-
- Asserts that collection does not contain actual as an item.
-
- IEnumerable of objects to be considered
- Object that cannot exist within collection
- The message that will be displayed on failure
-
-
-
- Asserts that collection does not contain actual as an item.
-
- IEnumerable of objects to be considered
- Object that cannot exist within collection
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that superset is not a subject of subset.
-
- The IEnumerable superset to be considered
- The IEnumerable subset to be considered
-
-
-
- Asserts that superset is not a subject of subset.
-
- The IEnumerable superset to be considered
- The IEnumerable subset to be considered
- The message that will be displayed on failure
-
-
-
- Asserts that superset is not a subject of subset.
-
- The IEnumerable superset to be considered
- The IEnumerable subset to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Asserts that superset is a subset of subset.
-
- The IEnumerable superset to be considered
- The IEnumerable subset to be considered
-
-
-
- Asserts that superset is a subset of subset.
-
- The IEnumerable superset to be considered
- The IEnumerable subset to be considered
- The message that will be displayed on failure
-
-
-
- Asserts that superset is a subset of subset.
-
- The IEnumerable superset to be considered
- The IEnumerable subset to be considered
- The message that will be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Assert that an array, list or other collection is empty
-
- An array, list or other collection implementing IEnumerable
- The message to be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Assert that an array, list or other collection is empty
-
- An array, list or other collection implementing IEnumerable
- The message to be displayed on failure
-
-
-
- Assert that an array,list or other collection is empty
-
- An array, list or other collection implementing IEnumerable
-
-
-
- Assert that an array, list or other collection is empty
-
- An array, list or other collection implementing IEnumerable
- The message to be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Assert that an array, list or other collection is empty
-
- An array, list or other collection implementing IEnumerable
- The message to be displayed on failure
-
-
-
- Assert that an array,list or other collection is empty
-
- An array, list or other collection implementing IEnumerable
-
-
-
- Assert that an array, list or other collection is ordered
-
- An array, list or other collection implementing IEnumerable
- The message to be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Assert that an array, list or other collection is ordered
-
- An array, list or other collection implementing IEnumerable
- The message to be displayed on failure
-
-
-
- Assert that an array, list or other collection is ordered
-
- An array, list or other collection implementing IEnumerable
-
-
-
- Assert that an array, list or other collection is ordered
-
- An array, list or other collection implementing IEnumerable
- A custom comparer to perform the comparisons
- The message to be displayed on failure
- Arguments to be used in formatting the message
-
-
-
- Assert that an array, list or other collection is ordered
-
- An array, list or other collection implementing IEnumerable
- A custom comparer to perform the comparisons
- The message to be displayed on failure
-
-
-
- Assert that an array, list or other collection is ordered
-
- An array, list or other collection implementing IEnumerable
- A custom comparer to perform the comparisons
-
-
-
- Static helper class used in the constraint-based syntax
-
-
-
-
- Creates a new SubstringConstraint
-
- The value of the substring
- A SubstringConstraint
-
-
-
- Creates a new CollectionContainsConstraint.
-
- The item that should be found.
- A new CollectionContainsConstraint
-
-
-
- Summary description for DirectoryAssert
-
-
-
-
- The Equals method throws an AssertionException. This is done
- to make sure there is no mistake by calling this function.
-
-
-
-
-
-
- override the default ReferenceEquals to throw an AssertionException. This
- implementation makes sure there is no mistake in calling this function
- as part of Assert.
-
-
-
-
-
-
- We don't actually want any instances of this object, but some people
- like to inherit from it to add other static methods. Hence, the
- protected constructor disallows any instances of this object.
-
-
-
-
- Verifies that two directories are equal. Two directories are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A directory containing the value that is expected
- A directory containing the actual value
- The message to display if directories are not equal
- Arguments to be used in formatting the message
-
-
-
- Verifies that two directories are equal. Two directories are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A directory containing the value that is expected
- A directory containing the actual value
- The message to display if directories are not equal
-
-
-
- Verifies that two directories are equal. Two directories are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A directory containing the value that is expected
- A directory containing the actual value
-
-
-
- Verifies that two directories are equal. Two directories are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A directory path string containing the value that is expected
- A directory path string containing the actual value
- The message to display if directories are not equal
- Arguments to be used in formatting the message
-
-
-
- Verifies that two directories are equal. Two directories are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A directory path string containing the value that is expected
- A directory path string containing the actual value
- The message to display if directories are not equal
-
-
-
- Verifies that two directories are equal. Two directories are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A directory path string containing the value that is expected
- A directory path string containing the actual value
-
-
-
- Asserts that two directories are not equal. If they are equal
- an is thrown.
-
- A directory containing the value that is expected
- A directory containing the actual value
- The message to display if directories are not equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that two directories are not equal. If they are equal
- an is thrown.
-
- A directory containing the value that is expected
- A directory containing the actual value
- The message to display if directories are not equal
-
-
-
- Asserts that two directories are not equal. If they are equal
- an is thrown.
-
- A directory containing the value that is expected
- A directory containing the actual value
-
-
-
- Asserts that two directories are not equal. If they are equal
- an is thrown.
-
- A directory path string containing the value that is expected
- A directory path string containing the actual value
- The message to display if directories are equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that two directories are not equal. If they are equal
- an is thrown.
-
- A directory path string containing the value that is expected
- A directory path string containing the actual value
- The message to display if directories are equal
-
-
-
- Asserts that two directories are not equal. If they are equal
- an is thrown.
-
- A directory path string containing the value that is expected
- A directory path string containing the actual value
-
-
-
- Asserts that the directory is empty. If it is not empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that the directory is empty. If it is not empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
-
-
-
- Asserts that the directory is empty. If it is not empty
- an is thrown.
-
- A directory to search
-
-
-
- Asserts that the directory is empty. If it is not empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that the directory is empty. If it is not empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
-
-
-
- Asserts that the directory is empty. If it is not empty
- an is thrown.
-
- A directory to search
-
-
-
- Asserts that the directory is not empty. If it is empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that the directory is not empty. If it is empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
-
-
-
- Asserts that the directory is not empty. If it is empty
- an is thrown.
-
- A directory to search
-
-
-
- Asserts that the directory is not empty. If it is empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that the directory is not empty. If it is empty
- an is thrown.
-
- A directory to search
- The message to display if directories are not equal
-
-
-
- Asserts that the directory is not empty. If it is empty
- an is thrown.
-
- A directory to search
-
-
-
- Asserts that path contains actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
- Arguments to be used in formatting the message
-
-
-
- Asserts that path contains actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
-
-
-
- Asserts that path contains actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
-
-
-
- Asserts that path contains actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
- Arguments to be used in formatting the message
-
-
-
- Asserts that path contains actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
-
-
-
- Asserts that path contains actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
-
-
-
- Asserts that path does not contain actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
- Arguments to be used in formatting the message
-
-
-
- Asserts that path does not contain actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
-
-
-
- Asserts that path does not contain actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
-
-
-
- Asserts that path does not contain actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
- Arguments to be used in formatting the message
-
-
-
- Asserts that path does not contain actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
- The message to display if directory is not within the path
-
-
-
- Asserts that path does not contain actual as a subdirectory or
- an is thrown.
-
- A directory to search
- sub-directory asserted to exist under directory
-
-
-
- Summary description for FileAssert.
-
-
-
-
- The Equals method throws an AssertionException. This is done
- to make sure there is no mistake by calling this function.
-
-
-
-
-
-
- override the default ReferenceEquals to throw an AssertionException. This
- implementation makes sure there is no mistake in calling this function
- as part of Assert.
-
-
-
-
-
-
- We don't actually want any instances of this object, but some people
- like to inherit from it to add other static methods. Hence, the
- protected constructor disallows any instances of this object.
-
-
-
-
- Verifies that two Streams are equal. Two Streams are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- The expected Stream
- The actual Stream
- The message to display if Streams are not equal
- Arguments to be used in formatting the message
-
-
-
- Verifies that two Streams are equal. Two Streams are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- The expected Stream
- The actual Stream
- The message to display if objects are not equal
-
-
-
- Verifies that two Streams are equal. Two Streams are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- The expected Stream
- The actual Stream
-
-
-
- Verifies that two files are equal. Two files are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A file containing the value that is expected
- A file containing the actual value
- The message to display if Streams are not equal
- Arguments to be used in formatting the message
-
-
-
- Verifies that two files are equal. Two files are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A file containing the value that is expected
- A file containing the actual value
- The message to display if objects are not equal
-
-
-
- Verifies that two files are equal. Two files are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- A file containing the value that is expected
- A file containing the actual value
-
-
-
- Verifies that two files are equal. Two files are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- The path to a file containing the value that is expected
- The path to a file containing the actual value
- The message to display if Streams are not equal
- Arguments to be used in formatting the message
-
-
-
- Verifies that two files are equal. Two files are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- The path to a file containing the value that is expected
- The path to a file containing the actual value
- The message to display if objects are not equal
-
-
-
- Verifies that two files are equal. Two files are considered
- equal if both are null, or if both have the same value byte for byte.
- If they are not equal an is thrown.
-
- The path to a file containing the value that is expected
- The path to a file containing the actual value
-
-
-
- Asserts that two Streams are not equal. If they are equal
- an is thrown.
-
- The expected Stream
- The actual Stream
- The message to be displayed when the two Stream are the same.
- Arguments to be used in formatting the message
-
-
-
- Asserts that two Streams are not equal. If they are equal
- an is thrown.
-
- The expected Stream
- The actual Stream
- The message to be displayed when the Streams are the same.
-
-
-
- Asserts that two Streams are not equal. If they are equal
- an is thrown.
-
- The expected Stream
- The actual Stream
-
-
-
- Asserts that two files are not equal. If they are equal
- an is thrown.
-
- A file containing the value that is expected
- A file containing the actual value
- The message to display if Streams are not equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that two files are not equal. If they are equal
- an is thrown.
-
- A file containing the value that is expected
- A file containing the actual value
- The message to display if objects are not equal
-
-
-
- Asserts that two files are not equal. If they are equal
- an is thrown.
-
- A file containing the value that is expected
- A file containing the actual value
-
-
-
- Asserts that two files are not equal. If they are equal
- an is thrown.
-
- The path to a file containing the value that is expected
- The path to a file containing the actual value
- The message to display if Streams are not equal
- Arguments to be used in formatting the message
-
-
-
- Asserts that two files are not equal. If they are equal
- an is thrown.
-
- The path to a file containing the value that is expected
- The path to a file containing the actual value
- The message to display if objects are not equal
-
-
-
- Asserts that two files are not equal. If they are equal
- an is thrown.
-
- The path to a file containing the value that is expected
- The path to a file containing the actual value
-
-
-
- GlobalSettings is a place for setting default values used
- by the framework in performing asserts.
-
-
-
-
- Default tolerance for floating point equality
-
-
-
-
- Helper class with properties and methods that supply
- a number of constraints used in Asserts.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding only if a specified number of them succeed.
-
-
-
-
- Returns a new PropertyConstraintExpression, which will either
- test for the existence of the named property on the object
- being tested or apply any following constraint to that property.
-
-
-
-
- Returns a new AttributeConstraint checking for the
- presence of a particular attribute on an object.
-
-
-
-
- Returns a new AttributeConstraint checking for the
- presence of a particular attribute on an object.
-
-
-
-
- Returns a new CollectionContainsConstraint checking for the
- presence of a particular object in the collection.
-
-
-
-
- Returns a ConstraintExpression that negates any
- following constraint.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them succeed.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if at least one of them succeeds.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them fail.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Length property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Count property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the Message property of the object being tested.
-
-
-
-
- Returns a new ConstraintExpression, which will apply the following
- constraint to the InnerException property of the object being tested.
-
-
-
-
- Interface implemented by a user fixture in order to
- validate any expected exceptions. It is only called
- for test methods marked with the ExpectedException
- attribute.
-
-
-
-
- Method to handle an expected exception
-
- The exception to be handled
-
-
-
- Helper class with properties and methods that supply
- a number of constraints used in Asserts.
-
-
-
-
- Returns a constraint that tests two items for equality
-
-
-
-
- Returns a constraint that tests that two references are the same object
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is greater than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the
- actual value is less than or equal to the suppled argument
-
-
-
-
- Returns a constraint that tests whether the actual
- value is of the exact type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual
- value is of the exact type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is of the type supplied as an argument or a derived type.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is assignable from the type supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is a collection containing the same elements as the
- collection supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the actual value
- is a subset of the collection supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value matches the Regex pattern supplied as an argument.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same as an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same path or under an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the path provided
- is the same path or under an expected path after canonicalization.
-
-
-
-
- Returns a constraint that tests whether the actual value falls
- within a specified range.
-
-
-
-
- Returns a ConstraintExpression that negates any
- following constraint.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them succeed.
-
-
-
-
- Returns a constraint that tests for null
-
-
-
-
- Returns a constraint that tests for True
-
-
-
-
- Returns a constraint that tests for False
-
-
-
-
- Returns a constraint that tests for a positive value
-
-
-
-
- Returns a constraint that tests for a negative value
-
-
-
-
- Returns a constraint that tests for NaN
-
-
-
-
- Returns a constraint that tests for empty
-
-
-
-
- Returns a constraint that tests whether a collection
- contains all unique items.
-
-
-
-
- Returns a constraint that tests whether an object graph is serializable in binary format.
-
-
-
-
- Returns a constraint that tests whether an object graph is serializable in xml format.
-
-
-
-
- Returns a constraint that tests whether a collection is ordered
-
-
-
-
- The Iz class is a synonym for Is intended for use in VB,
- which regards Is as a keyword.
-
-
-
-
- The List class is a helper class with properties and methods
- that supply a number of constraints used with lists and collections.
-
-
-
-
- List.Map returns a ListMapper, which can be used to map
- the original collection to another collection.
-
-
-
-
-
-
- ListMapper is used to transform a collection used as an actual argument
- producing another collection to be used in the assertion.
-
-
-
-
- Construct a ListMapper based on a collection
-
- The collection to be transformed
-
-
-
- Produces a collection containing all the values of a property
-
- The collection of property values
-
-
-
-
- Randomizer returns a set of random values in a repeatable
- way, to allow re-running of tests if necessary.
-
-
-
-
- Get a randomizer for a particular member, returning
- one that has already been created if it exists.
- This ensures that the same values are generated
- each time the tests are reloaded.
-
-
-
-
- Get a randomizer for a particular parameter, returning
- one that has already been created if it exists.
- This ensures that the same values are generated
- each time the tests are reloaded.
-
-
-
-
- Construct a randomizer using a random seed
-
-
-
-
- Construct a randomizer using a specified seed
-
-
-
-
- Return an array of random doubles between 0.0 and 1.0.
-
-
-
-
-
-
- Return an array of random doubles with values in a specified range.
-
-
-
-
- Return an array of random ints with values in a specified range.
-
-
-
-
- Get a random seed for use in creating a randomizer.
-
-
-
-
- The SpecialValue enum is used to represent TestCase arguments
- that cannot be used as arguments to an Attribute.
-
-
-
-
- Null represents a null value, which cannot be used as an
- argument to an attriute under .NET 1.x
-
-
-
-
- Basic Asserts on strings.
-
-
-
-
- The Equals method throws an AssertionException. This is done
- to make sure there is no mistake by calling this function.
-
-
-
-
-
-
- override the default ReferenceEquals to throw an AssertionException. This
- implementation makes sure there is no mistake in calling this function
- as part of Assert.
-
-
-
-
-
-
- Asserts that a string is found within another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string is found within another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
-
-
-
- Asserts that a string is found within another string.
-
- The expected string
- The string to be examined
-
-
-
- Asserts that a string is not found within another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string is found within another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
-
-
-
- Asserts that a string is found within another string.
-
- The expected string
- The string to be examined
-
-
-
- Asserts that a string starts with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string starts with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
-
-
-
- Asserts that a string starts with another string.
-
- The expected string
- The string to be examined
-
-
-
- Asserts that a string does not start with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string does not start with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
-
-
-
- Asserts that a string does not start with another string.
-
- The expected string
- The string to be examined
-
-
-
- Asserts that a string ends with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string ends with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
-
-
-
- Asserts that a string ends with another string.
-
- The expected string
- The string to be examined
-
-
-
- Asserts that a string does not end with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string does not end with another string.
-
- The expected string
- The string to be examined
- The message to display in case of failure
-
-
-
- Asserts that a string does not end with another string.
-
- The expected string
- The string to be examined
-
-
-
- Asserts that two strings are equal, without regard to case.
-
- The expected string
- The actual string
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that two strings are equal, without regard to case.
-
- The expected string
- The actual string
- The message to display in case of failure
-
-
-
- Asserts that two strings are equal, without regard to case.
-
- The expected string
- The actual string
-
-
-
- Asserts that two strings are not equal, without regard to case.
-
- The expected string
- The actual string
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that two strings are Notequal, without regard to case.
-
- The expected string
- The actual string
- The message to display in case of failure
-
-
-
- Asserts that two strings are not equal, without regard to case.
-
- The expected string
- The actual string
-
-
-
- Asserts that a string matches an expected regular expression pattern.
-
- The regex pattern to be matched
- The actual string
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string matches an expected regular expression pattern.
-
- The regex pattern to be matched
- The actual string
- The message to display in case of failure
-
-
-
- Asserts that a string matches an expected regular expression pattern.
-
- The regex pattern to be matched
- The actual string
-
-
-
- Asserts that a string does not match an expected regular expression pattern.
-
- The regex pattern to be used
- The actual string
- The message to display in case of failure
- Arguments used in formatting the message
-
-
-
- Asserts that a string does not match an expected regular expression pattern.
-
- The regex pattern to be used
- The actual string
- The message to display in case of failure
-
-
-
- Asserts that a string does not match an expected regular expression pattern.
-
- The regex pattern to be used
- The actual string
-
-
-
- The TestCaseData class represents a set of arguments
- and other parameter info to be used for a parameterized
- test case. It provides a number of instance modifiers
- for use in initializing the test case.
-
- Note: Instance modifiers are getters that return
- the same instance after modifying it's state.
-
-
-
-
- The argument list to be provided to the test
-
-
-
-
- The expected result to be returned
-
-
-
-
- Set to true if this has an expected result
-
-
-
-
- The expected exception Type
-
-
-
-
- The FullName of the expected exception
-
-
-
-
- The name to be used for the test
-
-
-
-
- The description of the test
-
-
-
-
- A dictionary of properties, used to add information
- to tests without requiring the class to change.
-
-
-
-
- If true, indicates that the test case is to be ignored
-
-
-
-
- If true, indicates that the test case is marked explicit
-
-
-
-
- The reason for ignoring a test case
-
-
-
-
- Initializes a new instance of the class.
-
- The arguments.
-
-
-
- Initializes a new instance of the class.
-
- The argument.
-
-
-
- Initializes a new instance of the class.
-
- The first argument.
- The second argument.
-
-
-
- Initializes a new instance of the class.
-
- The first argument.
- The second argument.
- The third argument.
-
-
-
- Sets the expected result for the test
-
- The expected result
- A modified TestCaseData
-
-
-
- Sets the expected exception type for the test
-
- Type of the expected exception.
- The modified TestCaseData instance
-
-
-
- Sets the expected exception type for the test
-
- FullName of the expected exception.
- The modified TestCaseData instance
-
-
-
- Sets the name of the test case
-
- The modified TestCaseData instance
-
-
-
- Sets the description for the test case
- being constructed.
-
- The description.
- The modified TestCaseData instance.
-
-
-
- Applies a category to the test
-
-
-
-
-
-
- Applies a named property to the test
-
-
-
-
-
-
-
- Applies a named property to the test
-
-
-
-
-
-
-
- Applies a named property to the test
-
-
-
-
-
-
-
- Ignores this TestCase.
-
-
-
-
-
- Ignores this TestCase, specifying the reason.
-
- The reason.
-
-
-
-
- Marks this TestCase as Explicit
-
-
-
-
-
- Marks this TestCase as Explicit, specifying the reason.
-
- The reason.
-
-
-
-
- Gets the argument list to be provided to the test
-
-
-
-
- Gets the expected result
-
-
-
-
- Returns true if the result has been set
-
-
-
-
- Gets the expected exception Type
-
-
-
-
- Gets the FullName of the expected exception
-
-
-
-
- Gets the name to be used for the test
-
-
-
-
- Gets the description of the test
-
-
-
-
- Gets a value indicating whether this is ignored.
-
- true if ignored; otherwise, false.
-
-
-
- Gets a value indicating whether this is explicit.
-
- true if explicit; otherwise, false.
-
-
-
- Gets the ignore reason.
-
- The ignore reason.
-
-
-
- Gets a list of categories associated with this test.
-
-
-
-
- Gets the property dictionary for this test
-
-
-
-
- Provide the context information of the current test
-
-
-
-
- Constructs a TestContext using the provided context dictionary
-
- A context dictionary
-
-
-
- Get the current test context. This is created
- as needed. The user may save the context for
- use within a test, but it should not be used
- outside the test for which it is created.
-
-
-
-
- Gets a TestAdapter representing the currently executing test in this context.
-
-
-
-
- Gets a ResultAdapter representing the current result for the test
- executing in this context.
-
-
-
-
- Gets the directory containing the current test assembly.
-
-
-
-
- Gets the directory to be used for outputing files created
- by this test run.
-
-
-
-
- TestAdapter adapts a Test for consumption by
- the user test code.
-
-
-
-
- Constructs a TestAdapter for this context
-
- The context dictionary
-
-
-
- The name of the test.
-
-
-
-
- The FullName of the test
-
-
-
-
- The properties of the test.
-
-
-
-
- ResultAdapter adapts a TestResult for consumption by
- the user test code.
-
-
-
-
- Construct a ResultAdapter for a context
-
- The context holding the result
-
-
-
- The TestState of current test. This maps to the ResultState
- used in nunit.core and is subject to change in the future.
-
-
-
-
- The TestStatus of current test. This enum will be used
- in future versions of NUnit and so is to be preferred
- to the TestState value.
-
-
-
-
- Provides details about a test
-
-
-
-
- Creates an instance of TestDetails
-
- The fixture that the test is a member of, if available.
- The method that implements the test, if available.
- The full name of the test.
- A string representing the type of test, e.g. "Test Case".
- Indicates if the test represents a suite of tests.
-
-
-
- The fixture that the test is a member of, if available.
-
-
-
-
- The method that implements the test, if available.
-
-
-
-
- The full name of the test.
-
-
-
-
- A string representing the type of test, e.g. "Test Case".
-
-
-
-
- Indicates if the test represents a suite of tests.
-
-
-
-
- The ResultState enum indicates the result of running a test
-
-
-
-
- The result is inconclusive
-
-
-
-
- The test was not runnable.
-
-
-
-
- The test has been skipped.
-
-
-
-
- The test has been ignored.
-
-
-
-
- The test succeeded
-
-
-
-
- The test failed
-
-
-
-
- The test encountered an unexpected exception
-
-
-
-
- The test was cancelled by the user
-
-
-
-
- The TestStatus enum indicates the result of running a test
-
-
-
-
- The test was inconclusive
-
-
-
-
- The test has skipped
-
-
-
-
- The test succeeded
-
-
-
-
- The test failed
-
-
-
-
- Helper class with static methods used to supply constraints
- that operate on strings.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value contains the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value starts with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value ends with the substring supplied as an argument.
-
-
-
-
- Returns a constraint that succeeds if the actual
- value matches the Regex pattern supplied as an argument.
-
-
-
-
- Returns a constraint that fails if the actual
- value matches the pattern supplied as an argument.
-
-
-
-
- Returns a ConstraintExpression, which will apply
- the following constraint to all members of a collection,
- succeeding if all of them succeed.
-
-
-
-
- TextMessageWriter writes constraint descriptions and messages
- in displayable form as a text stream. It tailors the display
- of individual message components to form the standard message
- format of NUnit assertion failure messages.
-
-
-
-
- Prefix used for the expected value line of a message
-
-
-
-
- Prefix used for the actual value line of a message
-
-
-
-
- Length of a message prefix
-
-
-
-
- Construct a TextMessageWriter
-
-
-
-
- Construct a TextMessageWriter, specifying a user message
- and optional formatting arguments.
-
-
-
-
-
-
- Method to write single line message with optional args, usually
- written to precede the general failure message, at a givel
- indentation level.
-
- The indentation level of the message
- The message to be written
- Any arguments used in formatting the message
-
-
-
- Display Expected and Actual lines for a constraint. This
- is called by MessageWriter's default implementation of
- WriteMessageTo and provides the generic two-line display.
-
- The constraint that failed
-
-
-
- Display Expected and Actual lines for given values. This
- method may be called by constraints that need more control over
- the display of actual and expected values than is provided
- by the default implementation.
-
- The expected value
- The actual value causing the failure
-
-
-
- Display Expected and Actual lines for given values, including
- a tolerance value on the expected line.
-
- The expected value
- The actual value causing the failure
- The tolerance within which the test was made
-
-
-
- Display the expected and actual string values on separate lines.
- If the mismatch parameter is >=0, an additional line is displayed
- line containing a caret that points to the mismatch point.
-
- The expected string value
- The actual string value
- The point at which the strings don't match or -1
- If true, case is ignored in string comparisons
- If true, clip the strings to fit the max line length
-
-
-
- Writes the text for a connector.
-
- The connector.
-
-
-
- Writes the text for a predicate.
-
- The predicate.
-
-
-
- Write the text for a modifier.
-
- The modifier.
-
-
-
- Writes the text for an expected value.
-
- The expected value.
-
-
-
- Writes the text for an actual value.
-
- The actual value.
-
-
-
- Writes the text for a generalized value.
-
- The value.
-
-
-
- Writes the text for a collection value,
- starting at a particular point, to a max length
-
- The collection containing elements to write.
- The starting point of the elements to write
- The maximum number of elements to write
-
-
-
- Write the generic 'Expected' line for a constraint
-
- The constraint that failed
-
-
-
- Write the generic 'Expected' line for a given value
-
- The expected value
-
-
-
- Write the generic 'Expected' line for a given value
- and tolerance.
-
- The expected value
- The tolerance within which the test was made
-
-
-
- Write the generic 'Actual' line for a constraint
-
- The constraint for which the actual value is to be written
-
-
-
- Write the generic 'Actual' line for a given value
-
- The actual value causing a failure
-
-
-
- Gets or sets the maximum line length for this writer
-
-
-
-
- Helper class with properties and methods that supply
- constraints that operate on exceptions.
-
-
-
-
- Creates a constraint specifying the exact type of exception expected
-
-
-
-
- Creates a constraint specifying the exact type of exception expected
-
-
-
-
- Creates a constraint specifying the type of exception expected
-
-
-
-
- Creates a constraint specifying the type of exception expected
-
-
-
-
- Creates a constraint specifying an expected exception
-
-
-
-
- Creates a constraint specifying an exception with a given InnerException
-
-
-
-
- Creates a constraint specifying an expected TargetInvocationException
-
-
-
-
- Creates a constraint specifying an expected TargetInvocationException
-
-
-
-
- Creates a constraint specifying an expected TargetInvocationException
-
-
-
-
- Creates a constraint specifying that no exception is thrown
-
-
-
-
diff --git a/packages/NUnit.2.6.1/license.txt b/packages/NUnit.2.6.1/license.txt
deleted file mode 100644
index 530a6e0..0000000
--- a/packages/NUnit.2.6.1/license.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Copyright © 2002-2012 Charlie Poole
-Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
-Copyright © 2000-2002 Philip A. Craig
-
-This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.
-
-Portions Copyright © 2002-2012 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
-
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source distribution.
diff --git a/packages/repositories.config b/packages/repositories.config
deleted file mode 100644
index df5bf15..0000000
--- a/packages/repositories.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file